Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| WebLogic Integration
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.document
Class DocumentFactory

    java.lang.Object
      |
      +--com.bea.document.DocumentFactory

public class DocumentFactory
extends java.lang.Object

Default factory for creating instances of IDocument.

Author:
  Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.

Constructor Summary
`DocumentFactory()`

Method Summary
`static IDocument` | `createDocument()` Create a blank document.
`static IDocument` | `createDocument(org.w3c.dom.Document document)` Create a document using the given DOM document.
`static IDocument` | `createDocument(org.w3c.dom.Element documentRootElement)` Create a document using a copy of the given Element as the document root element.
`static IDocument` | `createDocument(java.io.File file)` Create a document by reading XML text previously saved to a file.
`static IDocument` | `createDocument(java.io.File file, java.lang.String encoding)` Create a document by reading XML text previously saved to a file.
`static IDocument` | `createDocument(IDocument document)` Create a new document that is a deep copy of the given document.
`static IDocument` | `createDocument(org.xml.sax.InputSource inputSource)` Create a document by reading the XML text for the document from the given InputSource.
`static IDocument` | `createDocument(java.io.Reader reader)` Create a document by reading the XML text for the document from the given Reader.
`static IDocument` | `createDocument(java.lang.String xml)` Create a document using the given XML text.
`static IDocument` | `createDocument(java.lang.String xml, boolean deferParse)` Create a document using the given XML text, optionally deferring the parse of that XML until a later time (i.e.
`static IDocumentDefinition` | `createDocumentDefinition()` Create a document definition instance.
`static IDocumentDefinition` | `createDocumentDefinition(java.lang.String documentTypeName)` Create a document definition with the given document type name.
`static IDocumentDefinition` | `createNullDocumentDefinition()` Create a document definition for an empty/null document type.
`static java.lang.String` | `serializeElement(org.w3c.dom.Element elem)` Serialize the given Element out as XML and return a String.
`static void` | `serializeElement(java.io.Writer writer, org.w3c.dom.Element elem)` Serialize the given Element as XML out to the given Writer.
`static void` | `serializeElement(java.io.Writer writer, int indent, int indentSize, org.w3c.dom.Element elem)` Serialize the given Element as XML out to the given Writer, using the given indent level and indentSize.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DocumentFactory

    public DocumentFactory()

Method Detail

### createDocument

    public static IDocument createDocument()

  Create a blank document.

### createDocument

    public static IDocument createDocument(java.lang.String xml)
                                    throws DocumentParseException,
                                           DocumentException

  Create a document using the given XML text.

### createDocument

    public static IDocument createDocument(java.lang.String xml,
                                           boolean deferParse)
                                    throws DocumentParseException,
                                           DocumentException

  Create a document using the given XML text, optionally deferring the parse of that XML until a later time (i.e. until any access that would require a parsed DOM).

### createDocument

    public static IDocument createDocument(org.w3c.dom.Element documentRootElement)

  Create a document using a copy of the given Element as the document root element.

### createDocument

    public static IDocument createDocument(java.io.Reader reader)
                                    throws DocumentParseException,
                                           DocumentException

  Create a document by reading the XML text for the document from the given Reader.

### createDocument

    public static IDocument createDocument(java.io.File file)
                                    throws DocumentParseException,
                                           DocumentException

  Create a document by reading XML text previously saved to a file. The data within this file will be interpreted according to the default XML encodings UTF-8 or UTF-16, or according to the encoding value specified in the XML declaration embedded in the XML text. The detection of the desired encoding is left up to the XML parser. It will auto-detect the encoding and proceed if it finds a supported encoding is in use. In general, if this method is used to populate an IDocument instance, the method getEncoding() on this instance will return null, as it is impossible for the instance to determine the actual encoding in use. This knowledge is restricted to the XML parser itself, and there is no standard mechanism for retrieving the encoding from the XML parser. If the encoding for the data in this file is know, it is recommended that you specify the encoding by using the createDocument(File, String) method instead.

  Parameters:
    `file` -
  Throws:
    DocumentParseException -
    DocumentException -
  See Also:
    createDocument(File, String)

### createDocument

    public static IDocument createDocument(java.io.File file,
                                           java.lang.String encoding)
                                    throws DocumentParseException,
                                           DocumentException

  Create a document by reading XML text previously saved to a file. The data within this file will be interpreted according to the given encoding value.

  Parameters:
    `file` -
    `encoding` - The Java encoding style for the content in the given file.
  Throws:
    DocumentParseException -
    DocumentException -

### createDocument

    public static IDocument createDocument(org.xml.sax.InputSource inputSource)
                                    throws DocumentParseException,
                                           DocumentException

  Create a document by reading the XML text for the document from the given InputSource.

### createDocument

    public static IDocument createDocument(org.w3c.dom.Document document)

  Create a document using the given DOM document. This DOM document is used as is, and is NOT copied.

### createDocument

    public static IDocument createDocument(IDocument document)

  Create a new document that is a deep copy of the given document. The new document is independent of (not linked to) the old document.

### createDocumentDefinition

    public static IDocumentDefinition createDocumentDefinition()

  Create a document definition instance. The returned instance has no name and no schema.

### createDocumentDefinition

    public static IDocumentDefinition createDocumentDefinition(java.lang.String documentTypeName)

  Create a document definition with the given document type name. The returned instance has no schema.

### createNullDocumentDefinition

    public static IDocumentDefinition createNullDocumentDefinition()

  Create a document definition for an empty/null document type. The returned instance will return true from the isNull() method, and cannot store a schema, but can be used to store a name and description.

### serializeElement

    public static java.lang.String serializeElement(org.w3c.dom.Element elem)
                                             throws DocumentException

  Serialize the given Element out as XML and return a String.

### serializeElement

    public static void serializeElement(java.io.Writer writer,
                                        org.w3c.dom.Element elem)
                                 throws java.io.IOException,
                                        DocumentException

  Serialize the given Element as XML out to the given Writer.

### serializeElement

    public static void serializeElement(java.io.Writer writer,
                                        int indent,
                                        int indentSize,
                                        org.w3c.dom.Element elem)
                                 throws java.io.IOException,
                                        DocumentException

  Serialize the given Element as XML out to the given Writer, using the given indent level and indentSize. For example, if you wish to serialize an element with a base indent of 10 spaces and each level under the element to be indented by 2 spaces, pass indent 10 and indentSize 2.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| WebLogic Integration
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

WebLogic Integration (WLI)