Package org.apache.commons.jxpath.util
Class BasicTypeConverter.ValuePointer
- java.lang.Object
-
- org.apache.commons.jxpath.util.BasicTypeConverter.ValuePointer
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Comparable,Pointer
- Enclosing class:
- BasicTypeConverter
static final class BasicTypeConverter.ValuePointer extends java.lang.Object implements Pointer
Value pointer
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Objectbeanprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description ValuePointer(java.lang.Object object)Create a new ValuePointer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringasPath()Returns a string that is a proper "canonical" XPath that corresponds to this pointer.java.lang.Objectclone()Pointers are cloneable.intcompareTo(java.lang.Object object)java.lang.ObjectgetNode()Returns the raw value of the object, property or collection element this pointer represents.java.lang.ObjectgetRootNode()Returns the node this pointer is based on.java.lang.ObjectgetValue()Returns the value of the object, property or collection element this pointer represents.voidsetValue(java.lang.Object value)Modifies the value of the object, property or collection element this pointer represents.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
bean
private java.lang.Object bean
-
-
Method Detail
-
getValue
public java.lang.Object getValue()
Description copied from interface:PointerReturns the value of the object, property or collection element this pointer represents. May convert the value to one of the canonical InfoSet types: String, Number, Boolean, Set. For example, in the case of an XML element, getValue() will return the text contained by the element rather than the element itself.
-
getNode
public java.lang.Object getNode()
Description copied from interface:PointerReturns the raw value of the object, property or collection element this pointer represents. Never converts the object to a canonical type: returns it as is. For example, for an XML element, getNode() will return the element itself rather than the text it contains.
-
getRootNode
public java.lang.Object getRootNode()
Description copied from interface:PointerReturns the node this pointer is based on.- Specified by:
getRootNodein interfacePointer- Returns:
- Object
-
setValue
public void setValue(java.lang.Object value)
Description copied from interface:PointerModifies the value of the object, property or collection element this pointer represents.
-
clone
public java.lang.Object clone()
Description copied from interface:PointerPointers are cloneable.
-
compareTo
public int compareTo(java.lang.Object object)
- Specified by:
compareToin interfacejava.lang.Comparable
-
asPath
public java.lang.String asPath()
Description copied from interface:PointerReturns a string that is a proper "canonical" XPath that corresponds to this pointer. Consider this example:Pointer ptr = ctx.getPointer("//employees[firstName = 'John']")The value of
ptr.asPath()will look something like"/departments[2]/employees[3]", so, basically, it represents the concrete location(s) of the result of a search performed by JXPath. If an object in the pointer's path is a Dynamic Property object (like a Map), the asPath method generates an XPath that looks like this:" /departments[@name = 'HR']/employees[3]".
-
-