N - the name typepublic interface StaxNavigator<N>
| Modifier and Type | Method and Description |
|---|---|
StaxNavigator<N> |
assertNext(N expectedName)
Assert there is a next element with the expected name.
|
N |
child()
Attempts to navigate to the first child found and return its name.
|
boolean |
child(N name)
Attempts to navigate to the first child having the specified name.
|
int |
descendant(N name)
Attempts to navigate to the first descendant with the specified name.
|
boolean |
find(N name)
Attempts to navigate to an element following the current one when it has the specified name.
|
StaxNavigator<N> |
fork()
Creates a navigator scoped around the currently navigated element.
|
StaxNavigator<N> |
fork(Axis axis)
Creates a navigator scoped around the currently navigated element.
|
java.lang.Iterable<StaxNavigator<N>> |
fork(Axis axis,
N name)
Returns an iterable of stax navigator that is built according to the rules:
The current element is added if it matches the specified name.
Subsequent elements are found thanks to the provided axis.
|
java.lang.Iterable<StaxNavigator<N>> |
fork(N name)
Returns an iterable of stax navigator that is built according to the rules:
The current element is added if it matches the specified name.
Subsequent elements are found thanks to the
sibling(Object) method.
|
<N> StaxNavigator<N> |
fork(Naming<N> naming)
Creates a navigator scoped around the currently navigated element.
|
<N> StaxNavigator<N> |
fork(Naming<N> naming,
Axis axis)
Creates a navigator scoped around the currently navigated element.
|
java.lang.String |
getAttribute(javax.xml.namespace.QName name)
Returns an attribute of the current element or null if such attribute does not exist.
|
java.lang.String |
getAttribute(java.lang.String name)
Returns an attribute of the current element or null if such attribute does not exist.
|
java.util.Map<java.lang.String,java.lang.String> |
getAttributes()
Returns all attributes of the current element or null when the no valid node is being navigated.
|
java.lang.String |
getContent()
Returns the current navigated element textual content.
|
int |
getDepth()
Returns the current navigated element depth.
|
java.lang.String |
getLocalName()
Returns the string representation of the local xml element.
|
javax.xml.stream.Location |
getLocation()
Returns the location of the start tag of the currently navigated element.
|
N |
getName()
Returns the current navigated element name.
|
java.lang.String |
getNamespaceByPrefix(java.lang.String prefix)
Returns a namespace URI by its prefix or return null if it is not bound.
|
Naming<N> |
getNaming()
Returns the naming used for this navigator.
|
javax.xml.namespace.QName |
getQName()
Returns the qname of the current xml element.
|
java.util.Map<javax.xml.namespace.QName,java.lang.String> |
getQualifiedAttributes()
Returns all attributes of the current element or null when the no valid node is being navigated.
|
boolean |
getTrimContent()
Returns the trim content configuration.
|
N |
navigate(Axis axis)
Navigates to the next element according to the axis argument and returns its name or null if the end of the stream
is reached.
|
boolean |
navigate(Axis axis,
N name)
Attempt to navigate to the next element according to the axis argument having the specified name.
|
N |
next()
Navigates to the next element and returns its name or null if the end of the stream is reached.
|
boolean |
next(N name)
Attempt to navigate to the next element having the specified name.
|
N |
next(java.util.Set<N> names)
Attempts to navigate to the next element when it belongs to the set of specified names.
|
<V> V |
parseContent(ValueType<V> valueType)
Parses the content of the currently navigated element and return the parsed value.
|
void |
setTrimContent(boolean trimContent)
Configures the content trimming when
getContent() method is invoked. |
N |
sibling()
Attempt to navigate to the next sibling and return its name.
|
boolean |
sibling(N name)
Attempts to navigate to the next sibling having the specified name.
|
N getName() throws StaxNavException
StaxNavException - any StaxNavExceptionNaming<N> getNaming()
java.lang.String getLocalName()
throws StaxNavException
StaxNavException - any StaxNavExceptionjavax.xml.namespace.QName getQName()
throws StaxNavException
StaxNavExceptionjavax.xml.stream.Location getLocation()
throws StaxNavException
StaxNavException - any StaxNavExceptionint getDepth()
throws StaxNavException
StaxNavException - any StaxNavExceptionjava.lang.String getContent()
throws StaxNavException
StaxNavException - any StaxNavExceptionvoid setTrimContent(boolean trimContent)
getContent() method is invoked.trimContent - true to trim contentboolean getTrimContent()
<V> V parseContent(ValueType<V> valueType) throws java.lang.IllegalStateException, java.lang.NullPointerException, StaxNavException, TypeConversionException
V - the generic type of the valuevalueType - the content value typejava.lang.IllegalStateException - if the current element does not point to a contentjava.lang.NullPointerException - if the value type argument is nullStaxNavException - any StaxNavExceptionTypeConversionException - when the a type conversion error occured<N> StaxNavigator<N> fork(Naming<N> naming) throws StaxNavException
StaxNavException - any StaxNavException<N> StaxNavigator<N> fork(Naming<N> naming, Axis axis) throws java.lang.NullPointerException
axis argument value when
a valid element is found otherwise it will not change.axis - the axisjava.lang.NullPointerException - if the axis argument is nullStaxNavigator<N> fork() throws StaxNavException
StaxNavException - any StaxNavExceptionStaxNavigator<N> fork(Axis axis) throws java.lang.NullPointerException
axis argument value when a valid element is found otherwise it will not
change.axis - the axisjava.lang.NullPointerException - if the axis argument is nulljava.lang.Iterable<StaxNavigator<N>> fork(N name) throws java.lang.NullPointerException
sibling(Object) method.name - the name of the root elements of the forked navigatorjava.lang.NullPointerException - if the name argument is nulljava.lang.Iterable<StaxNavigator<N>> fork(Axis axis, N name) throws java.lang.NullPointerException
axis - the axis of navigation for the forksname - the name of the root elements of the forked navigatorjava.lang.NullPointerException - if the name argument is nullboolean find(N name) throws StaxNavException
name - the element name to findStaxNavException - any StaxNavExceptionN navigate(Axis axis) throws StaxNavException
axis - the navigation axisStaxNavException - any StaxNavExceptionboolean navigate(Axis axis, N name) throws StaxNavException
axis - the navigation axisname - the desired element namejava.lang.NullPointerException - if the specified name is nullStaxNavException - any StaxNavExceptionN next() throws StaxNavException
StaxNavException - any StaxNavExceptionboolean next(N name) throws java.lang.NullPointerException, StaxNavException
name - the desired element namejava.lang.NullPointerException - if the specified name is nullStaxNavException - any StaxNavExceptionStaxNavigator<N> assertNext(N expectedName) throws java.lang.NullPointerException, StaxNavException
StaxNavException otherwise navigation occurs
to that element and the method returns this navigator object.expectedName - the expected element namejava.lang.NullPointerException - if the expected name is nullStaxNavExceptionN next(java.util.Set<N> names) throws java.lang.NullPointerException, StaxNavException
names - the set of desired element namesjava.lang.NullPointerException - if the names argument is nullStaxNavException - any StaxNavExceptionN child() throws StaxNavException
StaxNavException - any StaxNavExceptionboolean child(N name) throws java.lang.NullPointerException, StaxNavException
name - the child namejava.lang.NullPointerException - if the name argument is nullStaxNavException - any StaxNavExceptionN sibling() throws StaxNavException
StaxNavException - any StaxNavExceptionboolean sibling(N name) throws java.lang.NullPointerException, StaxNavException
name - the next sibling namejava.lang.NullPointerException - if the name argument is nullStaxNavException - any StaxNavExceptionjava.lang.String getAttribute(java.lang.String name)
throws java.lang.NullPointerException,
StaxNavException
name - the attribute namejava.lang.NullPointerException - if the name argument is nullStaxNavException - any StaxNavExceptionjava.lang.String getAttribute(javax.xml.namespace.QName name)
throws java.lang.NullPointerException,
StaxNavException
name - the attribute namejava.lang.NullPointerException - if the name argument is nullStaxNavException - any StaxNavExceptionjava.util.Map<java.lang.String,java.lang.String> getAttributes()
throws StaxNavException
StaxNavException - any StaxNavExceptionjava.util.Map<javax.xml.namespace.QName,java.lang.String> getQualifiedAttributes()
throws StaxNavException
StaxNavException - any StaxNavExceptionjava.lang.String getNamespaceByPrefix(java.lang.String prefix)
throws java.lang.NullPointerException,
StaxNavException
prefix - the prefixjava.lang.NullPointerException - if the prefix is nullStaxNavException - any StaxNavExceptionint descendant(N name) throws java.lang.NullPointerException, StaxNavException
name - the descendant namejava.lang.NullPointerException - if the name is nullStaxNavException - any StaxNavExceptionCopyright © 2014 eXo Platform SAS. All Rights Reserved.