com.icl.saxon.expr
Class StringValue
public final class StringValue
A string value
boolean | asBoolean() - Convert the string value to a boolean
|
double | asNumber() - Convert the string value to a number
|
String | asString() - Get the string value as a String
|
int | conversionPreference(Class required) - Get conversion preference for this value to a Java class.
|
Object | convertToJava(Class target) - Convert to Java object (for passing to external functions)
|
void | display(int level) - Diagnostic print of expression structure
|
boolean | equals(StringValue other) - Determine if two StringValues are equal
|
static int[] | expand(String s) - Expand a string containing surrogate pairs into an array of 32-bit characters
|
int | getDataType() - Return the type of the expression (if known)
|
int | getLength() - Get the length of this string, as defined in XPath.
|
static int | getLength(String s) - Get the length of a string, as defined in XPath.
|
asBoolean , asNumber , asString , compare , conversionPreference , convertToJava , equals , evaluate , getDependencies , inverse , notEquals , numericCompare , reduce , simplify , stringToNumber |
containsReferences , display , enumerate , evaluate , evaluateAsBoolean , evaluateAsNodeSet , evaluateAsNumber , evaluateAsString , getDataType , getDependencies , getStaticContext , indent , isContextDocumentNodeSet , make , outputStringValue , reduce , setStaticContext , simplify , usesCurrent |
StringValue
public StringValue(String value)
Constructor
value
- the String value. Null is taken as equivalent to "".
asBoolean
public boolean asBoolean()
Convert the string value to a boolean
- asBoolean in interface Value
- false if the string value is zero-length, true otherwise
asNumber
public double asNumber()
Convert the string value to a number
- asNumber in interface Value
asString
public String asString()
Get the string value as a String
- asString in interface Value
conversionPreference
public int conversionPreference(Class required)
Get conversion preference for this value to a Java class. A low result
indicates higher preference.
- conversionPreference in interface Value
convertToJava
public Object convertToJava(Class target)
throws XPathException
Convert to Java object (for passing to external functions)
- convertToJava in interface Value
display
public void display(int level)
Diagnostic print of expression structure
- display in interface Expression
equals
public boolean equals(StringValue other)
Determine if two StringValues are equal
expand
public static int[] expand(String s)
Expand a string containing surrogate pairs into an array of 32-bit characters
getDataType
public int getDataType()
Return the type of the expression (if known)
- getDataType in interface Expression
- 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
public static int getLength(String s)
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.
s
- The string whose length is required