Class XstreamPathConverter
java.lang.Object
org.codice.ddf.spatial.ogc.csw.catalog.converter.XstreamPathConverter
- All Implemented Interfaces:
com.thoughtworks.xstream.converters.Converter,com.thoughtworks.xstream.converters.ConverterMatcher
public class XstreamPathConverter
extends Object
implements com.thoughtworks.xstream.converters.Converter
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanConvert(Class clazz) protected booleandoBasicPathsMatch(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.voidmarshal(Object o, com.thoughtworks.xstream.io.HierarchicalStreamWriter hierarchicalStreamWriter, com.thoughtworks.xstream.converters.MarshallingContext marshallingContext) protected voidreadPath(com.thoughtworks.xstream.io.path.PathTrackingReader reader, com.thoughtworks.xstream.io.path.PathTracker tracker, XstreamPathValueTracker pathValueTracker, boolean endElement) Reads through the tree looking for a specific path and returns the value at that nodeunmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context) protected voidupdatePath(com.thoughtworks.xstream.io.path.PathTrackingReader reader, com.thoughtworks.xstream.io.path.Path path, com.thoughtworks.xstream.io.path.Path currentPath, XstreamPathValueTracker pathValueTracker, boolean endElement)
-
Field Details
-
PATH_KEY
- See Also:
-
-
Constructor Details
-
XstreamPathConverter
public XstreamPathConverter()
-
-
Method Details
-
marshal
public void marshal(Object o, com.thoughtworks.xstream.io.HierarchicalStreamWriter hierarchicalStreamWriter, com.thoughtworks.xstream.converters.MarshallingContext marshallingContext) - Specified by:
marshalin interfacecom.thoughtworks.xstream.converters.Converter
-
unmarshal
public Object unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context) throws com.thoughtworks.xstream.converters.ConversionException - Specified by:
unmarshalin interfacecom.thoughtworks.xstream.converters.Converter- Parameters:
reader-context-- Returns:
XstreamPathValueTracker- Throws:
com.thoughtworks.xstream.converters.ConversionException
-
readPath
protected void readPath(com.thoughtworks.xstream.io.path.PathTrackingReader reader, com.thoughtworks.xstream.io.path.PathTracker tracker, XstreamPathValueTracker pathValueTracker, boolean endElement) Reads through the tree looking for a specific path and returns the value at that nodeThe 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 "
" {code} invalid input: '<'-- reader starts here value {code} - Parameters:
reader-tracker-pathValueTracker-
-
updatePath
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, boolean endElement) -
doBasicPathsMatch
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. The comparison excludes count indexes in the path as well as the value of attributes in determining equivalence. For the purposes of this method, "/a/b/c" matches "/a/b[2]/c/@attr". Also checks that "a/b/c/*" will match "/a/b/c/d".- Parameters:
pathObj1- The first pathpathObj2- The second path- Returns:
- If the paths match
-
canConvert
- Specified by:
canConvertin interfacecom.thoughtworks.xstream.converters.ConverterMatcher
-