|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xpath.Expression | +--org.apache.xpath.objects.XObject
This class represents an XPath object, and is capable of converting the object to various types, such as a string. This class acts as the base class to other XPath type objects, such as XString, and provides polymorphic casting capabilities.
Field Summary | |
static int |
CLASS_BOOLEAN
Constant for BOOLEAN object type |
static int |
CLASS_NODESET
Constant for NODESET object type |
static int |
CLASS_NULL
Constant for NULL object type |
static int |
CLASS_NUMBER
Constant for NUMBER object type |
static int |
CLASS_RTREEFRAG
Constant for RESULT TREE FRAGMENT object type |
static int |
CLASS_STRING
Constant for STRING object type |
static int |
CLASS_UNKNOWN
Constant for UNKNOWN object type |
static int |
CLASS_UNRESOLVEDVARIABLE
Represents an unresolved variable type as an integer. |
Constructor Summary | |
XObject()
Create an XObject. |
|
XObject(java.lang.Object obj)
Create an XObject. |
Method Summary | |
void |
allowDetachToRelease(boolean allowRelease)
Specify if it's OK for detach to release the iterator for reuse. |
void |
appendToFsb(FastStringBuffer fsb)
Cast result object to a string. |
boolean |
bool()
Cast result object to a boolean. |
boolean |
boolWithSideEffects()
Cast result object to a boolean, but allow side effects, such as the incrementing of an iterator. |
void |
callVisitors(ExpressionOwner owner,
XPathVisitor visitor)
|
java.lang.Object |
castToType(int t,
XPathContext support)
Cast object to type t. |
static XObject |
create(java.lang.Object val)
Create the right XObject based on the type of the object passed. |
static XObject |
create(java.lang.Object val,
XPathContext xctxt)
Create the right XObject based on the type of the object passed. |
boolean |
deepEquals(Expression expr)
|
void |
destruct()
Forces the object to release it's resources. |
void |
detach()
Detaches the DTMIterator from the set which it iterated
over, releasing any computational resources and placing the iterator
in the INVALID state. |
void |
dispatchCharactersEvents(ContentHandler ch)
Directly call the characters method on the passed ContentHandler for the string-value. |
boolean |
equals(XObject obj2)
Tell if two objects are functionally equal. |
XObject |
execute(XPathContext xctxt)
For support of literal objects in xpaths. |
void |
fixupVariables(java.util.Vector vars,
int globalsSize)
XObjects should not normally need to fix up variables. |
XObject |
getFresh()
Get a fresh copy of the object. |
int |
getType()
Tell what kind of class this is. |
java.lang.String |
getTypeString()
Given a request type, return the equivalent string. |
boolean |
greaterThan(XObject obj2)
Tell if one object is greater than the other. |
boolean |
greaterThanOrEqual(XObject obj2)
Tell if one object is greater than or equal to the other. |
DTMIterator |
iter()
Cast result object to a nodelist. |
boolean |
lessThan(XObject obj2)
Tell if one object is less than the other. |
boolean |
lessThanOrEqual(XObject obj2)
Tell if one object is less than or equal to the other. |
NodeSetDTM |
mutableNodeset()
Cast result object to a nodelist. |
NodeList |
nodelist()
Cast result object to a nodelist. |
NodeIterator |
nodeset()
Cast result object to a nodelist. |
boolean |
notEquals(XObject obj2)
Tell if two objects are functionally not equal. |
double |
num()
Cast result object to a number. |
double |
numWithSideEffects()
Cast result object to a number, but allow side effects, such as the incrementing of an iterator. |
java.lang.Object |
object()
Return a java object that's closest to the representation that should be handed to an extension. |
void |
reset()
Reset for fresh reuse. |
int |
rtf()
For functions to override. |
int |
rtf(XPathContext support)
Cast result object to a result tree fragment. |
DocumentFragment |
rtree()
For functions to override. |
DocumentFragment |
rtree(XPathContext support)
Cast result object to a result tree fragment. |
java.lang.String |
str()
Cast result object to a string. |
java.lang.String |
toString()
Return the string representation of the object |
XMLString |
xstr()
Cast result object to a string. |
Methods inherited from class org.apache.xpath.Expression |
asIterator,
asIteratorRaw,
asNode,
assertion,
bool,
canTraverseOutsideSubtree,
error,
execute,
execute,
execute,
executeCharsToContentHandler,
exprAddChild,
exprGetChild,
exprGetNumChildren,
exprGetParent,
exprSetParent,
getColumnNumber,
getExpressionOwner,
getLineNumber,
getPublicId,
getSystemId,
isNodesetExpr,
isStableNumber,
num,
warn,
xstr |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int CLASS_NULL
public static final int CLASS_UNKNOWN
public static final int CLASS_BOOLEAN
public static final int CLASS_NUMBER
public static final int CLASS_STRING
public static final int CLASS_NODESET
public static final int CLASS_RTREEFRAG
public static final int CLASS_UNRESOLVEDVARIABLE
Constructor Detail |
public XObject()
public XObject(java.lang.Object obj)
obj
- Can be any object, should be a specific type
for derived classes, or null.Method Detail |
public XObject execute(XPathContext xctxt) throws TransformerException
xctxt
- The XPath execution context.public void allowDetachToRelease(boolean allowRelease)
allowRelease
- true if it is OK for detach to release this iterator
for pooling.public void detach()
DTMIterator
from the set which it iterated
over, releasing any computational resources and placing the iterator
in the INVALID state. After detach
has been invoked,
calls to nextNode
or previousNode
will
raise a runtime exception.public void destruct()
public void reset()
public void dispatchCharactersEvents(ContentHandler ch) throws SAXException
ch
- A non-null reference to a ContentHandler.public static XObject create(java.lang.Object val)
val
- The java object which this object will wrap.public static XObject create(java.lang.Object val, XPathContext xctxt)
val
- The java object which this object will wrap.xctxt
- The XPath context.public int getType()
public java.lang.String getTypeString()
public double num() throws TransformerException
public double numWithSideEffects() throws TransformerException
public boolean bool() throws TransformerException
public boolean boolWithSideEffects() throws TransformerException
public XMLString xstr()
public java.lang.String str()
public java.lang.String toString()
public int rtf(XPathContext support)
support
- XPath context to use for the conversionpublic DocumentFragment rtree(XPathContext support)
support
- XPath context to use for the conversionpublic DocumentFragment rtree()
public int rtf()
public java.lang.Object object()
public DTMIterator iter() throws TransformerException
public XObject getFresh()
public NodeIterator nodeset() throws TransformerException
public NodeList nodelist() throws TransformerException
public NodeSetDTM mutableNodeset() throws TransformerException
public java.lang.Object castToType(int t, XPathContext support) throws TransformerException
t
- Type of object to cast this tosupport
- XPath context to use for the conversionpublic boolean lessThan(XObject obj2) throws TransformerException
obj2
- Object to compare this topublic boolean lessThanOrEqual(XObject obj2) throws TransformerException
obj2
- Object to compare this topublic boolean greaterThan(XObject obj2) throws TransformerException
obj2
- Object to compare this topublic boolean greaterThanOrEqual(XObject obj2) throws TransformerException
obj2
- Object to compare this topublic boolean equals(XObject obj2)
obj2
- Object to compare this topublic boolean notEquals(XObject obj2) throws TransformerException
obj2
- Object to compare this topublic void fixupVariables(java.util.Vector vars, int globalsSize)
public void appendToFsb(FastStringBuffer fsb)
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
XPathVisitable.callVisitors(ExpressionOwner, XPathVisitor)
public boolean deepEquals(Expression expr)
Expression.deepEquals(Expression)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |