com.levigo.jadice.document.metadata
Class MetadataBuilder

java.lang.Object
  extended by com.levigo.jadice.document.metadata.MetadataBuilder

public final class MetadataBuilder
extends Object


Nested Class Summary
static class MetadataBuilder.InvalidCharacterHandling
          An enum of strategies for the handling of invalid characters in content (attributes, text, CDATA).
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addNamespace

public MetadataBuilder addNamespace(String prefix,
                                    String namespaceURI)
Add a namespace to the document that will be created

Parameters:
prefix - The prefix of the namespace
namespaceURI - The URI of the namespace
Returns:
this

addDefaultNamespace

public MetadataBuilder addDefaultNamespace(String defaultNamespaceURI)
Set the default namespace to use in the document declaration. I.e. <html xmlns="http://www.w3.org/1999/xhtml">

Parameters:
defaultNamespaceURI - URI to use as default when tags are not prefixed
Returns:
this

addRoot

public MutableMetadataNode addRoot(String tagName)
Create a root node for this XML document

Parameters:
tagName - Name of the element
Returns:
XMLDoc instance to build and navigate in the document

newDocument

public static MetadataBuilder newDocument(boolean ignoreNamespaces)

from

public static MutableMetadataNode from(File file,
                                       boolean ignoreNamespaces)

from

public static MutableMetadataNode from(URL xmlLocation,
                                       boolean ignoreNamespaces)

from

public static MutableMetadataNode from(String xmlData,
                                       boolean ignoreNamespaces)

from

public static MutableMetadataNode from(Reader reader,
                                       boolean ignoreNamespaces)

from

public static MutableMetadataNode from(InputStream is,
                                       boolean ignoreNamespaces)

from

public static MutableMetadataNode from(InputSource source,
                                       boolean ignoreNamespaces)

from

public static MutableMetadataNode from(Node node,
                                       boolean ignoreNamespaces)

from

public static MutableMetadataNode from(MetadataNode tag,
                                       boolean ignoreNamespaces)

fromCurrentTag

public static MutableMetadataNode fromCurrentTag(MetadataNode tag,
                                                 boolean ignoreNamespaces)
Create another MutableMetadataNode instance from the hierarchy under the current tag. The current tag becomes the root tag.

Parameters:
tag - The current XML Tag positionned to the new root tag
ignoreNamespaces - Wheter to build a namespace aware document
Returns:
The inner XMLTag instance

from

public static MutableMetadataNode from(Source source,
                                       boolean ignoreNamespaces)

createLazyMetadata

public static Metadata createLazyMetadata(MetadataProvider delegate)

setInvalidCharacterHandling

public MetadataBuilder setInvalidCharacterHandling(MetadataBuilder.InvalidCharacterHandling strategy)


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.