| java.lang.Object org.apache.xpath.Expression org.apache.xpath.objects.XObject
All known Subclasses: org.apache.xpath.objects.XString, org.apache.xpath.objects.XBoolean, org.apache.xpath.axes.NodeSequence, org.apache.xalan.templates.XUnresolvedVariable, org.apache.xpath.objects.XNumber, org.apache.xpath.objects.XRTreeFrag, org.apache.xalan.templates.XUnresolvedVariableSimple,
XObject | public class XObject extends Expression implements Serializable,Cloneable(Code) | | 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.
|
Constructor Summary | |
public | XObject() Create an XObject. | public | XObject(Object obj) Create an XObject. |
Method Summary | |
public void | allowDetachToRelease(boolean allowRelease) Specify if it's OK for detach to release the iterator for reuse. | public void | appendToFsb(org.apache.xml.utils.FastStringBuffer fsb) Cast result object to a string. | public boolean | bool() Cast result object to a boolean. | public boolean | boolWithSideEffects() Cast result object to a boolean, but allow side effects, such as the
incrementing of an iterator. | public void | callVisitors(ExpressionOwner owner, XPathVisitor visitor) | public Object | castToType(int t, XPathContext support) Cast object to type t. | public static XObject | create(Object val) Create 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 function can 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. Parameters: xctxt - The XPath context. | public boolean | deepEquals(Expression expr) | public void | destruct() Forces the object to release it's resources. | public void | detach() Detaches the DTMIterator from the set which it iterated
over, releasing any computational resources and placing the iterator
in the INVALID state. | public void | dispatchCharactersEvents(org.xml.sax.ContentHandler ch) Directly call the
characters method on the passed ContentHandler for the
string-value. | public 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. | public XObject | execute(XPathContext xctxt) For support of literal objects in xpaths.
Parameters: xctxt - The XPath execution context. | public void | fixupVariables(java.util.Vector vars, int globalsSize) XObjects should not normally need to fix up variables. | public XObject | getFresh() Get a fresh copy of the object. | public int | getType() Tell what kind of class this is. | public String | getTypeString() Given a request type, return the equivalent string. | public boolean | greaterThan(XObject obj2) Tell if one object is greater than the other. | public boolean | greaterThanOrEqual(XObject obj2) Tell if one object is greater than or equal to the other. | public DTMIterator | iter() Cast result object to a nodelist. | public boolean | lessThan(XObject obj2) Tell if one object is less than the other. | public boolean | lessThanOrEqual(XObject obj2) Tell if one object is less than or equal to the other. | public NodeSetDTM | mutableNodeset() Cast result object to a nodelist. | public NodeList | nodelist() Cast result object to a nodelist. | public NodeIterator | nodeset() Cast result object to a nodelist. | public boolean | notEquals(XObject obj2) Tell if two objects are functionally not equal. | public double | num() Cast result object to a number. | public double | numWithSideEffects() Cast result object to a number, but allow side effects, such as the
incrementing of an iterator. | public Object | object() Return a java object that's closest to the representation
that should be handed to an extension. | public void | reset() Reset for fresh reuse. | public int | rtf(XPathContext support) Cast result object to a result tree fragment. | public int | rtf() For functions to override. | public DocumentFragment | rtree(XPathContext support) Cast result object to a result tree fragment. | public DocumentFragment | rtree() For functions to override. | public String | str() Cast result object to a string. | public String | toString() | public XMLString | xstr() Cast result object to a string. |
CLASS_BOOLEAN | final public static int CLASS_BOOLEAN(Code) | | Constant for BOOLEAN object type
|
CLASS_NODESET | final public static int CLASS_NODESET(Code) | | Constant for NODESET object type
|
CLASS_NULL | final public static int CLASS_NULL(Code) | | Constant for NULL object type
|
CLASS_NUMBER | final public static int CLASS_NUMBER(Code) | | Constant for NUMBER object type
|
CLASS_RTREEFRAG | final public static int CLASS_RTREEFRAG(Code) | | Constant for RESULT TREE FRAGMENT object type
|
CLASS_STRING | final public static int CLASS_STRING(Code) | | Constant for STRING object type
|
CLASS_UNKNOWN | final public static int CLASS_UNKNOWN(Code) | | Constant for UNKNOWN object type
|
CLASS_UNRESOLVEDVARIABLE | final public static int CLASS_UNRESOLVEDVARIABLE(Code) | | Represents an unresolved variable type as an integer.
|
m_obj | protected Object m_obj(Code) | | The java object which this object wraps.
|
serialVersionUID | final static long serialVersionUID(Code) | | |
XObject | public XObject()(Code) | | Create an XObject.
|
XObject | public XObject(Object obj)(Code) | | Create an XObject.
Parameters: obj - Can be any object, should be a specific typefor derived classes, or null. |
allowDetachToRelease | public void allowDetachToRelease(boolean allowRelease)(Code) | | 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 iteratorfor pooling. |
boolWithSideEffects | public boolean boolWithSideEffects() throws javax.xml.transform.TransformerException(Code) | | Cast result object to a boolean, but allow side effects, such as the
incrementing of an iterator.
True if there is a next node in the nodeset |
create | public static XObject create(Object val)(Code) | | 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. the right XObject based on the type of the object passed. |
create | public static XObject create(Object val, XPathContext xctxt)(Code) | | Create the right XObject based on the type of the object passed.
This function can 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. Parameters: xctxt - The XPath context. the right XObject based on the type of the object passed. |
destruct | public void destruct()(Code) | | Forces the object to release it's resources. This is more harsh than
detach().
|
detach | public void detach()(Code) | | Detaches the 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.
|
dispatchCharactersEvents | public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException(Code) | | 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: org.xml.sax.SAXException - |
fixupVariables | public void fixupVariables(java.util.Vector vars, int globalsSize)(Code) | | XObjects should not normally need to fix up variables.
|
getFresh | public XObject getFresh()(Code) | | Get a fresh copy of the object. For use with variables.
This object, unless overridden by subclass. |
getType | public int getType()(Code) | | Tell what kind of class this is.
CLASS_UNKNOWN |
getTypeString | public String getTypeString()(Code) | | Given a request type, return the equivalent string.
For diagnostic purposes.
type string "#UNKNOWN" + object class name |
numWithSideEffects | public double numWithSideEffects() throws javax.xml.transform.TransformerException(Code) | | Cast result object to a number, but allow side effects, such as the
incrementing of an iterator.
numeric value of the string conversion from the next node in the NodeSetDTM, or NAN if no node was found |
object | public Object object()(Code) | | Return a java object that's closest to the representation
that should be handed to an extension.
The object that this class wraps |
reset | public void reset()(Code) | | Reset for fresh reuse.
|
rtf | public int rtf(XPathContext support)(Code) | | Cast result object to a result tree fragment.
Parameters: support - XPath context to use for the conversion the objec as a result tree fragment. |
rtf | public int rtf()(Code) | | For functions to override.
null |
rtree | public DocumentFragment rtree(XPathContext support)(Code) | | Cast result object to a result tree fragment.
Parameters: support - XPath context to use for the conversion the objec as a result tree fragment. |
str | public String str()(Code) | | Cast result object to a string.
The object as a string |
toString | public String toString()(Code) | | Return the string representation of the object
the string representation of the object |
xstr | public XMLString xstr()(Code) | | Cast result object to a string.
The string this wraps or the empty string if null |
Methods inherited from org.apache.xpath.Expression | public DTMIterator asIterator(XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException(Code)(Java Doc) public DTMIterator asIteratorRaw(XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException(Code)(Java Doc) public int asNode(XPathContext xctxt) throws javax.xml.transform.TransformerException(Code)(Java Doc) public void assertion(boolean b, java.lang.String msg)(Code)(Java Doc) public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException(Code)(Java Doc) public boolean canTraverseOutsideSubtree()(Code)(Java Doc) abstract public boolean deepEquals(Expression expr)(Code)(Java Doc) public void error(XPathContext xctxt, String msg, Object[] args) throws javax.xml.transform.TransformerException(Code)(Java Doc) public XObject execute(XPathContext xctxt, int currentNode) throws javax.xml.transform.TransformerException(Code)(Java Doc) public XObject execute(XPathContext xctxt, int currentNode, DTM dtm, int expType) throws javax.xml.transform.TransformerException(Code)(Java Doc) abstract public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException(Code)(Java Doc) public XObject execute(XPathContext xctxt, boolean destructiveOK) throws javax.xml.transform.TransformerException(Code)(Java Doc) public void executeCharsToContentHandler(XPathContext xctxt, ContentHandler handler) throws javax.xml.transform.TransformerException, org.xml.sax.SAXException(Code)(Java Doc) public void exprAddChild(ExpressionNode n, int i)(Code)(Java Doc) public ExpressionNode exprGetChild(int i)(Code)(Java Doc) public int exprGetNumChildren()(Code)(Java Doc) public ExpressionNode exprGetParent()(Code)(Java Doc) public void exprSetParent(ExpressionNode n)(Code)(Java Doc) abstract public void fixupVariables(java.util.Vector vars, int globalsSize)(Code)(Java Doc) public int getColumnNumber()(Code)(Java Doc) public ExpressionNode getExpressionOwner()(Code)(Java Doc) public int getLineNumber()(Code)(Java Doc) public String getPublicId()(Code)(Java Doc) public String getSystemId()(Code)(Java Doc) public boolean isNodesetExpr()(Code)(Java Doc) final protected boolean isSameClass(Expression expr)(Code)(Java Doc) public boolean isStableNumber()(Code)(Java Doc) public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException(Code)(Java Doc) public void warn(XPathContext xctxt, String msg, Object[] args) throws javax.xml.transform.TransformerException(Code)(Java Doc) public XMLString xstr(XPathContext xctxt) throws javax.xml.transform.TransformerException(Code)(Java Doc)
|
|
|