public final class MetadataBuilder extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MetadataBuilder.InvalidCharacterHandling
An enum of strategies for the handling of invalid characters in content (attributes, text,
CDATA).
|
Modifier and Type | Method and Description |
---|---|
MetadataBuilder |
addDefaultNamespace(String defaultNamespaceURI)
Set the default namespace to use in the document declaration.
|
MetadataBuilder |
addNamespace(String prefix,
String namespaceURI)
Add a namespace to the document that will be created
|
MutableMetadataNode |
addRoot(String tagName)
Create a root node for this XML document
|
static Metadata |
createLazyMetadata(MetadataProvider delegate) |
static MutableMetadataNode |
from(File file,
boolean ignoreNamespaces) |
static MutableMetadataNode |
from(InputSource source,
boolean ignoreNamespaces) |
static MutableMetadataNode |
from(InputStream is,
boolean ignoreNamespaces) |
static MutableMetadataNode |
from(MetadataNode tag,
boolean ignoreNamespaces) |
static MutableMetadataNode |
from(Node node,
boolean ignoreNamespaces) |
static MutableMetadataNode |
from(Reader reader,
boolean ignoreNamespaces) |
static MutableMetadataNode |
from(Source source,
boolean ignoreNamespaces) |
static MutableMetadataNode |
from(String xmlData,
boolean ignoreNamespaces) |
static MutableMetadataNode |
from(URL xmlLocation,
boolean ignoreNamespaces) |
static MutableMetadataNode |
fromCurrentTag(MetadataNode tag,
boolean ignoreNamespaces)
Create another
MutableMetadataNode instance from the hierarchy under the current tag. |
static MetadataBuilder |
newDocument(boolean ignoreNamespaces) |
MetadataBuilder |
setInvalidCharacterHandling(MetadataBuilder.InvalidCharacterHandling strategy) |
public MetadataBuilder addNamespace(String prefix, String namespaceURI)
prefix
- The prefix of the namespacenamespaceURI
- The URI of the namespacepublic MetadataBuilder addDefaultNamespace(String defaultNamespaceURI)
<html xmlns="http://www.w3.org/1999/xhtml">
defaultNamespaceURI
- URI to use as default when tags are not prefixedpublic MutableMetadataNode addRoot(String tagName)
tagName
- Name of the elementpublic static MetadataBuilder newDocument(boolean ignoreNamespaces)
public static MutableMetadataNode from(File file, boolean ignoreNamespaces)
public static MutableMetadataNode from(URL xmlLocation, boolean ignoreNamespaces)
public static MutableMetadataNode from(String xmlData, boolean ignoreNamespaces)
public static MutableMetadataNode from(Reader reader, boolean ignoreNamespaces)
public static MutableMetadataNode from(InputStream is, boolean ignoreNamespaces)
public static MutableMetadataNode from(InputSource source, boolean ignoreNamespaces)
public static MutableMetadataNode from(Node node, boolean ignoreNamespaces)
public static MutableMetadataNode from(MetadataNode tag, boolean ignoreNamespaces)
public static MutableMetadataNode fromCurrentTag(MetadataNode tag, boolean ignoreNamespaces)
MutableMetadataNode
instance from the hierarchy under the current tag.
The current tag becomes the root tag.tag
- The current XML Tag positionned to the new root tagignoreNamespaces
- Wheter to build a namespace aware documentpublic static MutableMetadataNode from(Source source, boolean ignoreNamespaces)
public static Metadata createLazyMetadata(MetadataProvider delegate)
public MetadataBuilder setInvalidCharacterHandling(MetadataBuilder.InvalidCharacterHandling strategy)
Copyright © 2024 levigo holding gmbh. All rights reserved.