public final class XMLFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_DOM_COALESCING
DocumentBuilderFactory is by default coalescing
|
static boolean |
DEFAULT_DOM_EXPAND_ENTITY_REFERENCES
DocumentBuilderFactory is by default entity reference expanding
|
static boolean |
DEFAULT_DOM_IGNORING_COMMENTS
DocumentBuilderFactory is by default ignoring comments
|
static boolean |
DEFAULT_DOM_IGNORING_ELEMENT_CONTENT_WHITESPACE
DocumentBuilderFactory is by default not ignoring element content
whitespace
|
static boolean |
DEFAULT_DOM_NAMESPACE_AWARE
DocumentBuilderFactory is by default namespace aware
|
static boolean |
DEFAULT_DOM_VALIDATING
DocumentBuilderFactory is by default not DTD validating
|
static boolean |
DEFAULT_DOM_XINCLUDE_AWARE
DocumentBuilderFactory is by default not XInclude aware
|
| Modifier and Type | Method and Description |
|---|---|
static DocumentBuilderFactory |
createDefaultDocumentBuilderFactory()
Create a new
DocumentBuilderFactory using the defaults defined in
this class (DEFAULT_DOM_NAMESPACE_AWARE,
DEFAULT_DOM_VALIDATING etc.). |
static DocumentBuilder |
createDocumentBuilder()
Create a document builder without a certain schema, using the default
DocumentBuilderFactory. |
static DocumentBuilder |
createDocumentBuilder(DocumentBuilderFactory aDocBuilderFactory)
Create a document builder without a certain schema, using the passed
DocumentBuilderFactory. |
static DocumentBuilder |
createDocumentBuilder(Schema aSchema)
Create a document builder for a certain schema.
|
static DocumentBuilderFactory |
createDocumentBuilderFactory(Schema aSchema)
Create a new
DocumentBuilderFactory for the specified schema, with
the following settings: coalescing, comment ignoring and namespace aware. |
static DocumentBuilder |
getDocumentBuilder() |
static DocumentBuilderFactory |
getDocumentBuilderFactory() |
static DOMImplementation |
getDOMImplementation() |
static Document |
newDocument()
Create a new XML document without document type using version
EXMLVersion.XML_10. |
static Document |
newDocument(DocumentBuilder aDocBuilder)
Create a new XML document without document type using version
EXMLVersion.XML_10. |
static Document |
newDocument(DocumentBuilder aDocBuilder,
EXMLVersion eVersion)
Create a new XML document without document type using a custom document
builder.
|
static Document |
newDocument(DocumentBuilder aDocBuilder,
EXMLVersion eVersion,
String sQualifiedName,
String sPublicId,
String sSystemId)
Create a new document with a document type using a custom document builder.
|
static Document |
newDocument(EXMLVersion eVersion)
Create a new XML document without document type using the default document
builder.
|
static Document |
newDocument(EXMLVersion eVersion,
String sQualifiedName,
String sPublicId,
String sSystemId)
Create a new document with a document type using the default document
builder.
|
static Document |
newDocument(String sQualifiedName,
String sPublicId,
String sSystemId)
Create a new document with a document type using version
EXMLVersion.XML_10. |
public static final boolean DEFAULT_DOM_NAMESPACE_AWARE
public static final boolean DEFAULT_DOM_VALIDATING
public static final boolean DEFAULT_DOM_IGNORING_ELEMENT_CONTENT_WHITESPACE
public static final boolean DEFAULT_DOM_EXPAND_ENTITY_REFERENCES
public static final boolean DEFAULT_DOM_IGNORING_COMMENTS
public static final boolean DEFAULT_DOM_COALESCING
public static final boolean DEFAULT_DOM_XINCLUDE_AWARE
@Nonnull public static DocumentBuilderFactory createDefaultDocumentBuilderFactory()
DocumentBuilderFactory using the defaults defined in
this class (DEFAULT_DOM_NAMESPACE_AWARE,
DEFAULT_DOM_VALIDATING etc.).null.@Nonnull public static DocumentBuilderFactory createDocumentBuilderFactory(@Nonnull Schema aSchema)
DocumentBuilderFactory for the specified schema, with
the following settings: coalescing, comment ignoring and namespace aware.aSchema - The schema to use. May not be null.null.@Nonnull public static DocumentBuilderFactory getDocumentBuilderFactory()
null.@Nonnull public static DocumentBuilder getDocumentBuilder()
null.@Nonnull public static DOMImplementation getDOMImplementation()
null.@Nonnull public static DocumentBuilder createDocumentBuilder()
DocumentBuilderFactory.null.@Nonnull public static DocumentBuilder createDocumentBuilder(@Nonnull Schema aSchema)
aSchema - The schema to use. May not be null.null.@Nonnull public static DocumentBuilder createDocumentBuilder(@Nonnull DocumentBuilderFactory aDocBuilderFactory)
DocumentBuilderFactory.aDocBuilderFactory - The document builder factory to be used. May not be
null.null.InitializationException - In case some DOM initialization goes wrong@Nonnull public static Document newDocument()
EXMLVersion.XML_10. The default document builder is used.null.@Nonnull public static Document newDocument(@Nonnull DocumentBuilder aDocBuilder)
EXMLVersion.XML_10. A custom document builder is used.aDocBuilder - The document builder to use. May not be null.null.@Nonnull public static Document newDocument(@Nullable EXMLVersion eVersion)
eVersion - The XML version to use. If null is passed,
EXMLVersion.XML_10 will be used.null.@Nonnull public static Document newDocument(@Nonnull DocumentBuilder aDocBuilder, @Nullable EXMLVersion eVersion)
aDocBuilder - The document builder to use. May not be null.eVersion - The XML version to use. If null is passed,
EXMLVersion.XML_10 will be used.null.@Nonnull public static Document newDocument(@Nonnull String sQualifiedName, @Nullable String sPublicId, @Nullable String sSystemId)
EXMLVersion.XML_10.sQualifiedName - The qualified name to use.sPublicId - The public ID of the document type.sSystemId - The system ID of the document type.null.@Nonnull public static Document newDocument(@Nullable EXMLVersion eVersion, @Nonnull String sQualifiedName, @Nullable String sPublicId, @Nullable String sSystemId)
eVersion - The XML version to use. If null is passed,
EXMLVersion.XML_10 will be used.sQualifiedName - The qualified name to use.sPublicId - The public ID of the document type.sSystemId - The system ID of the document type.null.@Nonnull public static Document newDocument(@Nonnull DocumentBuilder aDocBuilder, @Nullable EXMLVersion eVersion, @Nonnull String sQualifiedName, @Nullable String sPublicId, @Nullable String sSystemId)
aDocBuilder - the document builder to be used. May not be null.eVersion - The XML version to use. If null is passed,
EXMLVersion.XML_10 will be used.sQualifiedName - The qualified name to use.sPublicId - The public ID of the document type.sSystemId - The system ID of the document type.null.Copyright © 2014–2015 Philip Helger. All rights reserved.