Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.xpath.Expression
org.apache.xpath.objects.XObject
Field Summary | |
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
Method Summary | |
void |
|
void |
|
boolean |
|
boolean |
|
void |
|
Object |
|
static XObject |
|
static XObject |
|
boolean |
|
void |
|
void |
|
void |
|
boolean | |
XObject |
|
void |
|
XObject |
|
int |
|
String |
|
boolean |
|
boolean |
|
DTMIterator |
|
boolean | |
boolean |
|
NodeSetDTM |
|
NodeList |
|
NodeIterator |
|
boolean | |
double |
|
double |
|
Object |
|
void |
|
int |
|
int |
|
DocumentFragment |
|
DocumentFragment |
|
String |
|
String |
|
XMLString |
|
Methods inherited from class org.apache.xpath.Expression | |
asIterator , asIteratorRaw , asNode , assertion , bool , canTraverseOutsideSubtree , deepEquals , error , execute , execute , execute , execute , executeCharsToContentHandler , exprAddChild , exprGetChild , exprGetNumChildren , exprGetParent , exprSetParent , fixupVariables , getColumnNumber , getExpressionOwner , getLineNumber , getPublicId , getSystemId , isNodesetExpr , isStableNumber , num , warn , xstr |
public static final int CLASS_BOOLEAN
Constant for BOOLEAN object type
- Field Value:
- 1
public static final int CLASS_NODESET
Constant for NODESET object type
- Field Value:
- 4
public static final int CLASS_NULL
Constant for NULL object type
- Field Value:
- -1
public static final int CLASS_NUMBER
Constant for NUMBER object type
- Field Value:
- 2
public static final int CLASS_RTREEFRAG
Constant for RESULT TREE FRAGMENT object type
- Field Value:
- 5
public static final int CLASS_STRING
Constant for STRING object type
- Field Value:
- 3
public static final int CLASS_UNKNOWN
Constant for UNKNOWN object type
- Field Value:
- 0
public static final int CLASS_UNRESOLVEDVARIABLE
Represents an unresolved variable type as an integer.
- Field Value:
- 600
public XObject()
Create an XObject.
public XObject(Object obj)
Create an XObject.
- Parameters:
obj
- Can be any object, should be a specific type for derived classes, or null.
public void allowDetachToRelease(boolean allowRelease)
Specify if it's OK for detach to release the iterator for reuse. This function should be called with a value of false for objects that are stored in variables. Calling this with a value of false on a XNodeSet will cause the nodeset to be cached.
- Parameters:
allowRelease
- true if it is OK for detach to release this iterator for pooling.
public void appendToFsb(FastStringBuffer fsb)
Cast result object to a string. NEEDSDOC @param fsb
public boolean bool() throws TransformerException
Cast result object to a boolean. Always issues an error.
- Returns:
- false
- Throws:
TransformerException
-
public boolean boolWithSideEffects() throws TransformerException
Cast result object to a boolean, but allow side effects, such as the incrementing of an iterator.
- Returns:
- True if there is a next node in the nodeset
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
- Specified by:
- callVisitors in interface XPathVisitable
- See Also:
XPathVisitable.callVisitors(ExpressionOwner, XPathVisitor)
public Object castToType(int t, XPathContext support) throws TransformerException
Cast object to type t.
- Parameters:
t
- Type of object to cast this tosupport
- XPath context to use for the conversion
- Returns:
- This object as the given type t
- Throws:
TransformerException
-
public static XObject create(Object val)
Create the right XObject based on the type of the object passed. This function can not make an XObject that exposes DOM Nodes, NodeLists, and NodeIterators to the XSLT stylesheet as node-sets.
- Parameters:
val
- The java object which this object will wrap.
- Returns:
- the right XObject based on the type of the object passed.
public static XObject create(Object val, XPathContext xctxt)
Create the right XObject based on the type of the object passed. This functioncan make an XObject that exposes DOM Nodes, NodeLists, and NodeIterators to the XSLT stylesheet as node-sets.
- Parameters:
val
- The java object which this object will wrap.xctxt
- The XPath context.
- Returns:
- the right XObject based on the type of the object passed.
public boolean deepEquals(Expression expr)
- Overrides:
- deepEquals in interface Expression
- See Also:
Expression.deepEquals(Expression)
public void destruct()
Forces the object to release it's resources. This is more harsh than detach().
public void detach()
Detaches theDTMIterator
from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state. Afterdetach
has been invoked, calls tonextNode
orpreviousNode
will raise a runtime exception.
public void dispatchCharactersEvents(ContentHandler ch) throws SAXException
Directly call the characters method on the passed ContentHandler for the string-value. Multiple calls to the ContentHandler's characters methods may well occur for a single call to this method.
- Parameters:
ch
- A non-null reference to a ContentHandler.
- Throws:
SAXException
-
public boolean equals(XObject obj2)
Tell if two objects are functionally equal.
- Parameters:
obj2
- Object to compare this to
- Returns:
- True if this object is equal to the given object
public XObject execute(XPathContext xctxt) throws TransformerException
For support of literal objects in xpaths.
- Overrides:
- execute in interface Expression
- Parameters:
xctxt
- The XPath execution context.
- Returns:
- This object.
- Throws:
TransformerException
-
public void fixupVariables(java.util.Vector vars, int globalsSize)
XObjects should not normally need to fix up variables.
- Overrides:
- fixupVariables in interface Expression
public XObject getFresh()
Get a fresh copy of the object. For use with variables.
- Returns:
- This object, unless overridden by subclass.
public int getType()
Tell what kind of class this is.
- Returns:
- CLASS_UNKNOWN
public String getTypeString()
Given a request type, return the equivalent string. For diagnostic purposes.
- Returns:
- type string "#UNKNOWN" + object class name
public boolean greaterThan(XObject obj2) throws TransformerException
Tell if one object is greater than the other.
- Parameters:
obj2
- Object to compare this to
- Returns:
- True if this object is greater than the given object
- Throws:
TransformerException
-
public boolean greaterThanOrEqual(XObject obj2) throws TransformerException
Tell if one object is greater than or equal to the other.
- Parameters:
obj2
- Object to compare this to
- Returns:
- True if this object is greater than or equal to the given object
- Throws:
TransformerException
-
public DTMIterator iter() throws TransformerException
Cast result object to a nodelist. Always issues an error.
- Returns:
- null
- Throws:
TransformerException
-
public boolean lessThan(XObject obj2) throws TransformerException
Tell if one object is less than the other.
- Parameters:
obj2
- Object to compare this to
- Returns:
- True if this object is less than the given object
- Throws:
TransformerException
-
public boolean lessThanOrEqual(XObject obj2) throws TransformerException
Tell if one object is less than or equal to the other.
- Parameters:
obj2
- Object to compare this to
- Returns:
- True if this object is less than or equal to the given object
- Throws:
TransformerException
-
public NodeSetDTM mutableNodeset() throws TransformerException
Cast result object to a nodelist. Always issues an error.
- Returns:
- The object as a NodeSetDTM.
- Throws:
TransformerException
-
public NodeList nodelist() throws TransformerException
Cast result object to a nodelist. Always issues an error.
- Returns:
- null
- Throws:
TransformerException
-
public NodeIterator nodeset() throws TransformerException
Cast result object to a nodelist. Always issues an error.
- Returns:
- null
- Throws:
TransformerException
-
public boolean notEquals(XObject obj2) throws TransformerException
Tell if two objects are functionally not equal.
- Parameters:
obj2
- Object to compare this to
- Returns:
- True if this object is not equal to the given object
- Throws:
TransformerException
-
public double num() throws TransformerException
Cast result object to a number. Always issues an error.
- Returns:
- 0.0
- Throws:
TransformerException
-
public double numWithSideEffects() throws TransformerException
Cast result object to a number, but allow side effects, such as the incrementing of an iterator.
- Returns:
- numeric value of the string conversion from the next node in the NodeSetDTM, or NAN if no node was found
public Object object()
Return a java object that's closest to the representation that should be handed to an extension.
- Returns:
- The object that this class wraps
public void reset()
Reset for fresh reuse.
public int rtf()
For functions to override.
- Returns:
- null
public int rtf(XPathContext support)
Cast result object to a result tree fragment.
- Parameters:
support
- XPath context to use for the conversion
- Returns:
- the objec as a result tree fragment.
public DocumentFragment rtree(XPathContext support)
Cast result object to a result tree fragment.
- Parameters:
support
- XPath context to use for the conversion
- Returns:
- the objec as a result tree fragment.
public String str()
Cast result object to a string.
- Returns:
- The object as a string
public String toString()
Return the string representation of the object
- Returns:
- the string representation of the object
public XMLString xstr()
Cast result object to a string.
- Returns:
- The string this wraps or the empty string if null