public class XMLContentHandlerImpl extends ContentHandlerImpl
ContentHandler
content handler implementation for dealing with XML content.Modifier and Type | Class and Description |
---|---|
static class |
XMLContentHandlerImpl.XMI |
ContentHandlerImpl.Describer
ContentHandler.ByteOrderMark, ContentHandler.Registry, ContentHandler.Validity
BYTE_ORDER_MARK_PROPERTY, CHARSET_PROPERTY, CONTENT_TYPE_PROPERTY, INVALID_CONTENT_DESCRIPTION, LINE_DELIMITER_PROPERTY, OPTION_REQUESTED_PROPERTIES, UNSPECIFIED_CONTENT_TYPE, VALIDITY_PROPERTY
Constructor and Description |
---|
XMLContentHandlerImpl() |
Modifier and Type | Method and Description |
---|---|
protected XMLResource |
createXMLResource()
Creates a specialized XML resource for consuming just the root elements
as well as the first nested element,
if the root element is an
XMI root element . |
protected java.lang.String |
getCharset(URI uri,
java.io.InputStream inputStream,
java.util.Map<?,?> options,
java.util.Map<java.lang.Object,java.lang.Object> context)
Returns the character set of the input stream; it's computed from the encoding specified in the XML content.
|
static boolean |
isXMINameAndNamespace(java.lang.String name,
java.lang.String namespace)
Returns whether the given name and namespace represents a specialize XMI root element tag.
|
static boolean |
isXMINamespace(java.lang.String namespace)
Returns whether the given namespace represents an XMI namespace.
|
protected XMLResource |
load(URI uri,
java.io.InputStream inputStream,
java.util.Map<?,?> options,
java.util.Map<java.lang.Object,java.lang.Object> context)
Returns the XML resource loaded from the input stream.
|
canHandle, contentDescription, createContentDescription, getByteOrderMark, getLineDelimiter, getLineDelimiter, getRequestedProperties, isRequestedProperty
public static boolean isXMINameAndNamespace(java.lang.String name, java.lang.String namespace)
name
- the element name to consider.namespace
- the element namespace to consider.public static boolean isXMINamespace(java.lang.String namespace)
namespace
- the element namespace to consider.protected XMLResource createXMLResource()
XMI root element
.protected java.lang.String getCharset(URI uri, java.io.InputStream inputStream, java.util.Map<?,?> options, java.util.Map<java.lang.Object,java.lang.Object> context) throws java.io.IOException
getCharset
in class ContentHandlerImpl
uri
- the URI of the input stream.inputStream
- the input stream of the XML content.options
- any options that might influence the loading of the XML content.context
- a cache for previously computed information.java.io.IOException
- if there is a problem loading the XML content.protected XMLResource load(URI uri, java.io.InputStream inputStream, java.util.Map<?,?> options, java.util.Map<java.lang.Object,java.lang.Object> context) throws java.io.IOException
uri
- the URI of the input stream.inputStream
- the input stream of the XML content.options
- any options that might influence the loading the the XML content.context
- a cache for previously computed information.java.io.IOException
- if there is a problem loading the XML content.