public class XmlPathMapper extends Object implements StAXHandler
{}. The others are element
QNames of the form local-name{namespace}, where {namespace} is omitted when the namespace
is empty. The sequence of element QNames may be followed by a single attribute QName of the form:
@local-name{namespace}. Namespaces are encoded using URL-encoding so they will not
contain unexpected characters (such as space and {}).
TODO: a bunch of optimizations are possible here; there is a duplication of work in the subclasses,
unneeded String creation, etc. Come back and fix that once we've settled on a definite implementation!| Modifier and Type | Field and Description |
|---|---|
protected StringBuilder |
currentPath |
protected QName |
currentQName |
| Constructor and Description |
|---|
XmlPathMapper() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
encodeQName(QName qname)
encode a QName in a suitable form for indexing.
|
Map<QName,Integer> |
getAttQNameCounts() |
Map<QName,Integer> |
getEltQNameCounts() |
protected QName |
getEventAttQName(XMLStreamReader reader,
int i) |
Map<String,Integer> |
getPathCounts() |
void |
handleEvent(XMLStreamReader reader,
int eventType)
This method receives StAX events.
|
boolean |
isNamespaceAware() |
void |
reset()
reinitialize any internal state and prepare the handler for re-use
|
void |
setNamespaceAware(boolean namespaceAware) |
protected StringBuilder currentPath
protected QName currentQName
public boolean isNamespaceAware()
public void setNamespaceAware(boolean namespaceAware)
public void handleEvent(XMLStreamReader reader, int eventType)
StAXHandlerhandleEvent in interface StAXHandlerreader - the reader from which events are being readeventType - the XML stream event typeprotected QName getEventAttQName(XMLStreamReader reader, int i)
protected String encodeQName(QName qname)
qname - public void reset()
StAXHandlerreset in interface StAXHandlerCopyright © 2013. All Rights Reserved.