Class StringValue
java.lang.Object
com.icl.saxon.expr.Expression
com.icl.saxon.expr.Value
com.icl.saxon.expr.StringValue
A string value
-
Field Summary
Fields inherited from class Expression
staticContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanConvert the string value to a booleandoubleasNumber()Convert the string value to a numberasString()Get the string value as a StringintconversionPreference(Class required) Get conversion preference for this value to a Java class.convertToJava(Class target) Convert to Java object (for passing to external functions)voiddisplay(int level) Diagnostic print of expression structurebooleanequals(StringValue other) Determine if two StringValues are equalstatic int[]Expand a string containing surrogate pairs into an array of 32-bit charactersintReturn the type of the expression (if known)intGet the length of this string, as defined in XPath.static intGet the length of a string, as defined in XPath.Methods inherited from class Value
compare, equals, evaluate, getDependencies, inverse, notEquals, numericCompare, reduce, simplify, stringToNumberMethods inherited from class Expression
containsReferences, enumerate, evaluateAsBoolean, evaluateAsNodeSet, evaluateAsNumber, evaluateAsString, getStaticContext, indent, isContextDocumentNodeSet, make, outputStringValue, setStaticContext, usesCurrent
-
Constructor Details
-
StringValue
Constructor- Parameters:
value- the String value. Null is taken as equivalent to "".
-
-
Method Details
-
asString
-
asNumber
-
asBoolean
-
getDataType
public int getDataType()Return the type of the expression (if known)- Specified by:
getDataTypein classExpression- Returns:
- Value.STRING (always)
-
getLength
public int getLength()Get the length of this string, as defined in XPath. This is not the same as the Java length, as a Unicode surrogate pair counts as a single character -
getLength
Get the length of a string, as defined in XPath. This is not the same as the Java length, as a Unicode surrogate pair counts as a single character.- Parameters:
s- The string whose length is required
-
expand
Expand a string containing surrogate pairs into an array of 32-bit characters -
equals
Determine if two StringValues are equal -
conversionPreference
Get conversion preference for this value to a Java class. A low result indicates higher preference.- Specified by:
conversionPreferencein classValue
-
convertToJava
Convert to Java object (for passing to external functions)- Specified by:
convertToJavain classValue- Parameters:
target- The class required by the external function- Returns:
- an object of the target class
- Throws:
XPathException
-
display
public void display(int level) Diagnostic print of expression structure- Specified by:
displayin classExpression
-