public class XObject extends Expression implements Serializable, Cloneable
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
|
static int |
CLASS_UNRESOLVEDVARIABLE
Represents an unresolved variable type as an integer.
|
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 |
---|---|
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)
This will traverse the heararchy, calling the visitor for
each member.
|
Object |
castToType(int t,
XPathContext support)
Cast object to type t.
|
static XObject |
create(Object val)
Create the right XObject based on the type of the object passed.
|
static XObject |
create(Object val,
XPathContext xctxt)
Create the right XObject based on the type of the object passed.
|
boolean |
deepEquals(Expression expr)
Compare this object with another object and see
if they are equal, include the sub heararchy.
|
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.
|
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)
For support of literal objects in xpaths.
|
void |
fixupVariables(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.
|
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.
|
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.
|
protected void |
setObject(Object obj) |
String |
str()
Cast result object to a string.
|
String |
toString()
Return the string representation of the object
|
XMLString |
xstr()
Cast result object to a string.
|
asIterator, asIteratorRaw, asNode, assertion, bool, canTraverseOutsideSubtree, error, execute, execute, execute, executeCharsToContentHandler, exprAddChild, exprGetChild, exprGetNumChildren, exprGetParent, exprSetParent, getColumnNumber, getExpressionOwner, getLineNumber, getPublicId, getSystemId, isNodesetExpr, isSameClass, isStableNumber, num, warn, xstr
protected 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 static final int CLASS_UNRESOLVEDVARIABLE
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 Expression
xctxt
- The XPath execution context.TransformerException
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.SAXException
public static XObject create(Object val)
val
- The java object which this object will wrap.public static XObject create(Object val, XPathContext xctxt)
val
- The java object which this object will wrap.xctxt
- The XPath context.public int getType()
public String getTypeString()
public double num() throws TransformerException
TransformerException
public double numWithSideEffects() throws TransformerException
TransformerException
public boolean bool() throws TransformerException
TransformerException
public boolean boolWithSideEffects() throws TransformerException
TransformerException
public XMLString xstr()
public String str()
public 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 Object object()
public DTMIterator iter() throws TransformerException
TransformerException
public XObject getFresh()
public org.w3c.dom.traversal.NodeIterator nodeset() throws TransformerException
TransformerException
public NodeList nodelist() throws TransformerException
TransformerException
public NodeSetDTM mutableNodeset() throws TransformerException
TransformerException
public Object castToType(int t, XPathContext support) throws TransformerException
t
- Type of object to cast this tosupport
- XPath context to use for the conversionTransformerException
public boolean lessThan(XObject obj2) throws TransformerException
obj2
- Object to compare this toTransformerException
public boolean lessThanOrEqual(XObject obj2) throws TransformerException
obj2
- Object to compare this toTransformerException
public boolean greaterThan(XObject obj2) throws TransformerException
obj2
- Object to compare this toTransformerException
public boolean greaterThanOrEqual(XObject obj2) throws TransformerException
obj2
- Object to compare this toTransformerException
public boolean equals(XObject obj2)
obj2
- Object to compare this toTransformerException
public boolean notEquals(XObject obj2) throws TransformerException
obj2
- Object to compare this toTransformerException
protected void error(String msg) throws TransformerException
msg
- Error message to issueTransformerException
protected void error(String msg, Object[] args) throws TransformerException
msg
- Error message to issueargs
- Arguments to use in the messageTransformerException
public void fixupVariables(Vector vars, int globalsSize)
fixupVariables
in class Expression
vars
- List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corresponds to the variable reference qname. The position of the
QName in the vector from the start of the vector will be its position
in the stack frame (but variables above the globalsTop value will need
to be offset to the current stack frame).
NEEDSDOC @param globalsSizepublic void appendToFsb(FastStringBuffer fsb)
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
XPathVisitable
callVisitors
in interface XPathVisitable
owner
- The owner of the visitor, where that path may be
rewritten if needed.visitor
- The visitor whose appropriate method will be called.XPathVisitable.callVisitors(ExpressionOwner, XPathVisitor)
public boolean deepEquals(Expression expr)
Expression
deepEquals
in class Expression
expr
- Another expression object.Expression.deepEquals(Expression)
Copyright © 2016 JBoss by Red Hat. All rights reserved.