public class XObject extends Expression
| Modifier and Type | Field and Description |
|---|---|
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
|
protected Object |
m_obj
The java object which this object wraps.
|
| Constructor and Description |
|---|
XObject()
Create an XObject.
|
XObject(Object obj)
Create an XObject.
|
| Modifier and Type | Method and Description |
|---|---|
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(XPathVisitor visitor)
This will traverse the hierarchy, calling the visitor for each member.
|
boolean |
deepEquals(Expression expr)
Compare this object with another object and see if they are equal, include the sub heararchy.
|
void |
detach()
Detaches the
DTMIterator from the set which it iterated over, releasing any
computational resources and placing the iterator in the INVALID state. |
boolean |
equals(XObject obj2)
Tell if two objects are functionally equal.
|
protected void |
error(String msg)
Tell the user of an error, and probably throw an exception.
|
protected void |
error(String msg,
Object[] args)
Tell the user of an error, and probably throw an exception.
|
XObject |
execute(XPathContext xctxt)
Execute an expression in the XPath runtime context, and return the result of the expression.
|
int |
getType()
Tell what kind of class this is.
|
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.
|
org.w3c.dom.traversal.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.
|
Object |
object()
Return a java object that's closest to the representation that should be handed to an
extension.
|
protected void |
setObject(Object obj) |
String |
str()
Cast result object to a string.
|
String |
toString() |
XString |
xstr()
Cast result object to a string.
|
asIterator, asNode, assertion, bool, canTraverseOutsideSubtree, error, execute, execute, execute, exprGetParent, exprSetParent, getColumnNumber, getExpressionOwner, getLineNumber, getPublicId, getSystemId, isSameClass, isStableNumber, numprotected Object m_obj
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 XObject()
public XObject(Object obj)
obj - Can be any object, should be a specific type for derived classes, or null.protected void setObject(Object obj)
public XObject execute(XPathContext xctxt) throws TransformerException
execute in class Expressionxctxt - The XPath runtime context.XObject.TransformerException - if a runtime exception occurs.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 int getType()
public String getTypeString()
public double num()
throws TransformerException
TransformerException - in case of errorpublic double numWithSideEffects()
throws TransformerException
TransformerExceptionpublic boolean bool()
throws TransformerException
TransformerException - in case of errorpublic boolean boolWithSideEffects()
throws TransformerException
TransformerExceptionpublic XString xstr()
public String str()
public Object object()
public DTMIterator iter() throws TransformerException
TransformerException - in case of errorpublic org.w3c.dom.traversal.NodeIterator nodeset() throws TransformerException
TransformerException - in case of errorpublic NodeList nodelist() throws TransformerException
TransformerException - in case of errorpublic NodeSetDTM mutableNodeset() throws TransformerException
TransformerException - in case of errorpublic boolean lessThan(XObject obj2) throws TransformerException
obj2 - Object to compare this toTransformerException - in case of errorpublic boolean lessThanOrEqual(XObject obj2) throws TransformerException
obj2 - Object to compare this toTransformerException - in case of errorpublic boolean greaterThan(XObject obj2) throws TransformerException
obj2 - Object to compare this toTransformerException - in case of errorpublic boolean greaterThanOrEqual(XObject obj2) throws TransformerException
obj2 - Object to compare this toTransformerException - in case of errorpublic boolean equals(XObject obj2)
obj2 - Object to compare this topublic boolean notEquals(XObject obj2) throws TransformerException
obj2 - Object to compare this toTransformerException - in case of errorprotected void error(String msg) throws TransformerException
msg - Error message to issueTransformerException - in case of errorprotected void error(String msg, Object[] args) throws TransformerException
msg - Error message to issueargs - Arguments to use in the messageTransformerException - in case of errorpublic void callVisitors(XPathVisitor visitor)
visitor - The visitor whose appropriate method will be called.public boolean deepEquals(Expression expr)
deepEquals in class Expressionexpr - Another expression object.Copyright © 2022–2024 HtmlUnit. All rights reserved.