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 TypeMethodDescriptionvoidappendErrors(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).voidclose()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.intNumber 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.booleanDoes the node have any more children remaining that have not yet been read?voidmoveDown()Select the current child as current node.voidmoveUp()Select the parent node as current node.voidsetInputAsMap(Map<String, ?> map) com.thoughtworks.xstream.io.HierarchicalStreamReaderReturn 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.HierarchicalStreamReaderIf 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:
appendErrorsin 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.HierarchicalStreamReaderClose the reader, if necessary.- Specified by:
closein interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader- See Also:
-
HierarchicalStreamReader.close()
-
getAttribute
Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReaderGet the value of an attribute of the current node.- Specified by:
getAttributein interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader- See Also:
-
HierarchicalStreamReader.getAttribute(java.lang.String)
-
getAttribute
Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReaderGet the value of an attribute of the current node, by index.- Specified by:
getAttributein interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader- See Also:
-
HierarchicalStreamReader.getAttribute(int)
-
getAttributeCount
public int getAttributeCount()Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReaderNumber of attributes in current node.- Specified by:
getAttributeCountin interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader- See Also:
-
HierarchicalStreamReader.getAttributeCount()
-
getAttributeName
Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReaderName of attribute in current node.- Specified by:
getAttributeNamein interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader- See Also:
-
HierarchicalStreamReader.getAttributeName(int)
-
getAttributeNames
Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReaderNames of attributes (as Strings).- Specified by:
getAttributeNamesin interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader- See Also:
-
HierarchicalStreamReader.getAttributeNames()
-
getNodeName
Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReaderGet the name of the current node.- Specified by:
getNodeNamein interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader- See Also:
-
HierarchicalStreamReader.getNodeName()
-
getValue
Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReaderGet the value (text content) of the current node.- Specified by:
getValuein interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader- See Also:
-
HierarchicalStreamReader.getValue()
-
hasMoreChildren
public boolean hasMoreChildren()Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReaderDoes the node have any more children remaining that have not yet been read?- Specified by:
hasMoreChildrenin interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader- See Also:
-
HierarchicalStreamReader.hasMoreChildren()
-
moveDown
public void moveDown()Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReaderSelect the current child as current node. A call to this function must be balanced with a call toHierarchicalStreamReader.moveUp().- Specified by:
moveDownin interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader- See Also:
-
HierarchicalStreamReader.moveDown()
-
moveUp
public void moveUp()Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReaderSelect the parent node as current node.- Specified by:
moveUpin 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.HierarchicalStreamReaderReturn 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:
underlyingReaderin interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader- See Also:
-
HierarchicalStreamReader.underlyingReader()
-
setInputAsMap
- Specified by:
setInputAsMapin interfaceJsStreamReader- Parameters:
map-
-