Package org.apache.xpath.objects
Class XStringForChars
- java.lang.Object
-
- org.apache.xpath.Expression
-
- org.apache.xpath.objects.XObject
-
- org.apache.xpath.objects.XString
-
- org.apache.xpath.objects.XStringForChars
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,javax.xml.transform.SourceLocator,XMLString,ExpressionNode,XPathVisitable
public class XStringForChars extends XString
This class will wrap a FastStringBuffer and allow for- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.xpath.objects.XString
EMPTYSTRING
-
Fields inherited from class org.apache.xpath.objects.XObject
CLASS_BOOLEAN, CLASS_NODESET, CLASS_NULL, CLASS_NUMBER, CLASS_RTREEFRAG, CLASS_STRING, CLASS_UNKNOWN, CLASS_UNRESOLVEDVARIABLE
-
-
Constructor Summary
Constructors Constructor Description XStringForChars(char[] val, int start, int length)Construct a XNodeSet object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendToFsb(FastStringBuffer fsb)Cast result object to a string.charcharAt(int index)Returns the character at the specified index.voiddispatchAsComment(org.xml.sax.ext.LexicalHandler lh)Directly call the comment method on the passed LexicalHandler for the string-value.voiddispatchCharactersEvents(org.xml.sax.ContentHandler ch)Directly call the characters method on the passed ContentHandler for the string-value.FastStringBufferfsb()Cast result object to a string.voidgetChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)Copies characters from this string into the destination character array.booleanhasString()Tell if this object contains a java String object.intlength()Returns the length of this string.java.lang.Objectobject()Since this object is incomplete without the length and the offset, we have to convert to a string when this function is called.java.lang.Stringstr()Cast result object to a string.-
Methods inherited from class org.apache.xpath.objects.XString
bool, callVisitors, compareTo, compareToIgnoreCase, concat, endsWith, equals, equals, equals, equals, equalsIgnoreCase, fixWhiteSpace, getType, getTypeString, hashCode, indexOf, indexOf, indexOf, indexOf, indexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, num, rtf, startsWith, startsWith, startsWith, startsWith, substring, substring, toDouble, toLowerCase, toLowerCase, toUpperCase, toUpperCase, trim, xstr
-
Methods inherited from class org.apache.xpath.objects.XObject
allowDetachToRelease, boolWithSideEffects, castToType, create, create, deepEquals, destruct, detach, execute, fixupVariables, getFresh, greaterThan, greaterThanOrEqual, iter, lessThan, lessThanOrEqual, mutableNodeset, nodelist, nodeset, notEquals, numWithSideEffects, reset, rtf, rtree, rtree, toString
-
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
-
-
-
-
Method Detail
-
fsb
public FastStringBuffer fsb()
Cast result object to a string.- Returns:
- The string this wraps or the empty string if null
-
appendToFsb
public void appendToFsb(FastStringBuffer fsb)
Cast result object to a string.- Overrides:
appendToFsbin classXObject
-
hasString
public boolean hasString()
Tell if this object contains a java String object.
-
str
public java.lang.String str()
Cast result object to a string.
-
object
public java.lang.Object object()
Since this object is incomplete without the length and the offset, we have to convert to a string when this function is called.
-
dispatchCharactersEvents
public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXExceptionDirectly 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.- Specified by:
dispatchCharactersEventsin interfaceXMLString- Overrides:
dispatchCharactersEventsin classXString- Parameters:
ch- A non-null reference to a ContentHandler.- Throws:
org.xml.sax.SAXException
-
dispatchAsComment
public void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh) throws org.xml.sax.SAXExceptionDirectly call the comment method on the passed LexicalHandler for the string-value.- Specified by:
dispatchAsCommentin interfaceXMLString- Overrides:
dispatchAsCommentin classXString- Parameters:
lh- A non-null reference to a LexicalHandler.- Throws:
org.xml.sax.SAXException
-
length
public int length()
Returns the length of this string.
-
charAt
public char charAt(int index)
Returns the character at the specified index. An index ranges from0tolength() - 1. The first character of the sequence is at index0, the next at index1, and so on, as for array indexing.- Specified by:
charAtin interfaceXMLString- Overrides:
charAtin classXString- Parameters:
index- the index of the character.- Returns:
- the character at the specified index of this string.
The first character is at index
0. - Throws:
java.lang.IndexOutOfBoundsException- if theindexargument is negative or not less than the length of this string.
-
getChars
public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)Copies characters from this string into the destination character array.- Specified by:
getCharsin interfaceXMLString- Overrides:
getCharsin classXString- Parameters:
srcBegin- index of the first character in the string to copy.srcEnd- index after the last character in the string to copy.dst- the destination array.dstBegin- the start offset in the destination array.- Throws:
java.lang.IndexOutOfBoundsException- If any of the following is true:srcBeginis negative.srcBeginis greater thansrcEndsrcEndis greater than the length of this stringdstBeginis negativedstBegin+(srcEnd-srcBegin)is larger thandst.length
java.lang.NullPointerException- ifdstisnull
-
-