Package it.ovunque.serializza.xstream
Class LettoreJs
java.lang.Object
it.ovunque.serializza.xstream.LettoreJs
- All Implemented Interfaces:
com.thoughtworks.xstream.io.HierarchicalStreamReader
,JsStreamReader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendErrors
(com.thoughtworks.xstream.converters.ErrorWriter arg0) 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 arg0) Get the value of an attribute of the current node, by index.getAttribute
(String nome) Get the value of an attribute of the current node.int
Number of attributes in current node.getAttributeName
(int arg0) Name of attribute in current node.Iterator<?>
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?static void
impostaClasse
(Class<?> cl) 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
-
LettoreJs
-
-
Method Details
-
impostaClasse
-
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
-
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
-
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
-
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
-
appendErrors
public void appendErrors(com.thoughtworks.xstream.converters.ErrorWriter arg0) 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
-
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
-
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
-
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
-
getAttributeNames
Description copied from interface:com.thoughtworks.xstream.io.HierarchicalStreamReader
Names of attributes (as Strings).- Specified by:
getAttributeNames
in interfacecom.thoughtworks.xstream.io.HierarchicalStreamReader
-
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
-
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
-
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
-
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
-
setInputAsMap
- Specified by:
setInputAsMap
in interfaceJsStreamReader
-