Package it.ovunque.serializza.xstream
Class JsInnestedReader
java.lang.Object
it.ovunque.serializza.xstream.JsInnestedReader
- All Implemented Interfaces:
com.thoughtworks.xstream.io.HierarchicalStreamReader
,JsStreamReader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendErrors
(com.thoughtworks.xstream.converters.ErrorWriter errorWriter) If any errors are detected, allow the reader to add any additional information that can aid debugging (such as line numbers, XPath expressions, etc).void
close()
Close the reader, if necessary.getAttribute
(int index) Get the value of an attribute of the current node, by index.getAttribute
(String name) Get the value of an attribute of the current node.int
Number of attributes in current node.getAttributeName
(int index) Name of attribute in current node.Names of attributes (as Strings).Get the name of the current node.getValue()
Get the value (text content) of the current node.boolean
Does the node have any more children remaining that have not yet been read?void
moveDown()
Select the current child as current node.void
moveUp()
Select the parent node as current node.void
setInputAsMap
(Map<String, ?> map) com.thoughtworks.xstream.io.HierarchicalStreamReader
Return the underlying HierarchicalStreamReader implementation.
-
Constructor Details
-
JsInnestedReader
- Parameters:
in
-
-
-
Method Details
-
appendErrors
public void appendErrors(com.thoughtworks.xstream.converters.ErrorWriter errorWriter) Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReader
If any errors are detected, allow the reader to add any additional information that can aid debugging (such as line numbers, XPath expressions, etc).- Specified by:
appendErrors
in interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader
- See Also:
-
HierarchicalStreamReader.appendErrors(com.thoughtworks.xstream.converters.ErrorWriter)
-
close
public void close()Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReader
Close the reader, if necessary.- Specified by:
close
in interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader
- See Also:
-
HierarchicalStreamReader.close()
-
getAttribute
Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReader
Get the value of an attribute of the current node.- Specified by:
getAttribute
in interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader
- See Also:
-
HierarchicalStreamReader.getAttribute(java.lang.String)
-
getAttribute
Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReader
Get the value of an attribute of the current node, by index.- Specified by:
getAttribute
in interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader
- See Also:
-
HierarchicalStreamReader.getAttribute(int)
-
getAttributeCount
public int getAttributeCount()Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReader
Number of attributes in current node.- Specified by:
getAttributeCount
in interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader
- See Also:
-
HierarchicalStreamReader.getAttributeCount()
-
getAttributeName
Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReader
Name of attribute in current node.- Specified by:
getAttributeName
in interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader
- See Also:
-
HierarchicalStreamReader.getAttributeName(int)
-
getAttributeNames
Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReader
Names of attributes (as Strings).- Specified by:
getAttributeNames
in interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader
- See Also:
-
HierarchicalStreamReader.getAttributeNames()
-
getNodeName
Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReader
Get the name of the current node.- Specified by:
getNodeName
in interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader
- See Also:
-
HierarchicalStreamReader.getNodeName()
-
getValue
Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReader
Get the value (text content) of the current node.- Specified by:
getValue
in interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader
- See Also:
-
HierarchicalStreamReader.getValue()
-
hasMoreChildren
public boolean hasMoreChildren()Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReader
Does the node have any more children remaining that have not yet been read?- Specified by:
hasMoreChildren
in interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader
- See Also:
-
HierarchicalStreamReader.hasMoreChildren()
-
moveDown
public void moveDown()Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReader
Select the current child as current node. A call to this function must be balanced with a call toHierarchicalStreamReader.moveUp()
.- Specified by:
moveDown
in interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader
- See Also:
-
HierarchicalStreamReader.moveDown()
-
moveUp
public void moveUp()Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReader
Select the parent node as current node.- Specified by:
moveUp
in interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader
- See Also:
-
HierarchicalStreamReader.moveUp()
-
underlyingReader
public com.thoughtworks.xstream.io.HierarchicalStreamReader underlyingReader()Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReader
Return the underlying HierarchicalStreamReader implementation.If a Converter needs to access methods of a specific HierarchicalStreamReader implementation that are not defined in the HierarchicalStreamReader interface, it should call this method before casting. This is because the reader passed to the Converter is often wrapped/decorated by another implementation to provide additional functionality (such as XPath tracking).
For example:
MySpecificReader mySpecificReader = (MySpecificReader)reader; // INCORRECT! mySpecificReader.doSomethingSpecific();
MySpecificReader mySpecificReader = (MySpecificReader)reader.underlyingReader(); // CORRECT! mySpecificReader.doSomethingSpecific();
Implementations of HierarchicalStreamReader should return 'this', unless they are a decorator, in which case they should delegate to whatever they are wrapping.
- Specified by:
underlyingReader
in interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader
- See Also:
-
HierarchicalStreamReader.underlyingReader()
-
setInputAsMap
- Specified by:
setInputAsMap
in interfaceJsStreamReader
- Parameters:
map
-
-