public interface QNameAwareOMDataSource extends OMDataSource
OMDataSource implementations that have knowledge about
the local name, namespace URI and/or namespace prefix of the element they represent. This
interface is used by OMSourcedElement to lazily determine the name of the element without
expanding it. The information returned by the implementation may be partial; e.g. the data source
may know about the local name and namespace URI but it may be unable to predict the namespace
prefix. The returned information must be accurate, i.e. it must match the name of the root
element in the document returned by OMDataSource.getReader().
This interface should be implemented by OMDataSource implementations that have an
efficient way to determine the root element name (or part of it) from the information effectively
used by OMDataSource.getReader() to construct the XMLStreamReader instance. In
practice this applies to OMDataSource implementations that satisfy one of the following
conditions:
OMDataSource.getReader()
actually using that information). In fact, in this case the application code should use
OMFactory.createOMElement(OMDataSource, String, OMNamespace) or
OMFactory.createOMElement(OMDataSource, QName) to supply the QName information it has.| Modifier and Type | Method and Description |
|---|---|
String |
getLocalName()
Get the local name of the element represented by this data source.
|
String |
getNamespaceURI()
Get the namespace URI of the element represented by this data source.
|
String |
getPrefix()
Get the namespace prefix of the element represented by this data source.
|
getReader, serialize, serialize, serializeString getLocalName()
null if the local name is not knownString getNamespaceURI()
null if the namespace URI is not knownString getPrefix()
null if the prefix is not known; the implementation is expected to
return an empty string if getNamespaceURI() returns an empty string (because
an element without namespace must not have a prefix)Copyright © The Apache Software Foundation. All Rights Reserved.