public class XstreamPathConverter extends Object implements com.thoughtworks.xstream.converters.Converter
Constructor and Description |
---|
XstreamPathConverter() |
Modifier and Type | Method and Description |
---|---|
boolean |
canConvert(Class clazz) |
protected boolean |
doBasicPathsMatch(com.thoughtworks.xstream.io.path.Path pathObj1,
com.thoughtworks.xstream.io.path.Path pathObj2)
This method uses a streaming-like approach to compare 2 paths with a single iteration.
|
void |
marshal(Object o,
com.thoughtworks.xstream.io.HierarchicalStreamWriter hierarchicalStreamWriter,
com.thoughtworks.xstream.converters.MarshallingContext marshallingContext) |
protected void |
readPath(com.thoughtworks.xstream.io.path.PathTrackingReader reader,
com.thoughtworks.xstream.io.path.PathTracker tracker,
XstreamPathValueTracker pathValueTracker)
Reads through the tree looking for a specific path and returns the value at that node
|
Object |
unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
com.thoughtworks.xstream.converters.UnmarshallingContext context) |
protected void |
updatePath(com.thoughtworks.xstream.io.path.PathTrackingReader reader,
com.thoughtworks.xstream.io.path.Path path,
com.thoughtworks.xstream.io.path.Path currentPath,
XstreamPathValueTracker pathValueTracker) |
public static final String PATH_KEY
public void marshal(Object o, com.thoughtworks.xstream.io.HierarchicalStreamWriter hierarchicalStreamWriter, com.thoughtworks.xstream.converters.MarshallingContext marshallingContext)
marshal
in interface com.thoughtworks.xstream.converters.Converter
public Object unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context) throws com.thoughtworks.xstream.converters.ConversionException
unmarshal
in interface com.thoughtworks.xstream.converters.Converter
reader
- context
- XstreamPathValueTracker
com.thoughtworks.xstream.converters.ConversionException
protected void readPath(com.thoughtworks.xstream.io.path.PathTrackingReader reader, com.thoughtworks.xstream.io.path.PathTracker tracker, XstreamPathValueTracker pathValueTracker)
The reader is moved to the next node in the path
For example, if readPath(reader, "a", "b", "c") is called, then the value at /a/b/c is
returned and the reader is advanced to "
reader
- tracker
- pathValueTracker
- protected void updatePath(com.thoughtworks.xstream.io.path.PathTrackingReader reader, com.thoughtworks.xstream.io.path.Path path, com.thoughtworks.xstream.io.path.Path currentPath, XstreamPathValueTracker pathValueTracker)
protected boolean doBasicPathsMatch(com.thoughtworks.xstream.io.path.Path pathObj1, com.thoughtworks.xstream.io.path.Path pathObj2)
pathObj1
- The first pathpathObj2
- The second pathpublic boolean canConvert(Class clazz)
canConvert
in interface com.thoughtworks.xstream.converters.ConverterMatcher
This work is licensed under a Creative Commons Attribution 4.0 International License.