com.icl.saxon.expr
public final class StringValue extends Value
staticContext
Constructor and Description |
---|
StringValue(String value)
Constructor
|
Modifier and Type | Method and Description |
---|---|
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.
|
compare, equals, evaluate, getDependencies, inverse, notEquals, numericCompare, reduce, simplify, stringToNumber
containsReferences, enumerate, evaluateAsBoolean, evaluateAsNodeSet, evaluateAsNumber, evaluateAsString, getStaticContext, indent, isContextDocumentNodeSet, make, outputStringValue, setStaticContext, usesCurrent
public StringValue(String value)
value
- the String value. Null is taken as equivalent to "".public String asString()
public double asNumber()
public boolean asBoolean()
public int getDataType()
getDataType
in class Expression
public int getLength()
public static int getLength(String s)
s
- The string whose length is requiredpublic static int[] expand(String s)
public boolean equals(StringValue other)
public int conversionPreference(Class required)
conversionPreference
in class Value
public Object convertToJava(Class target) throws XPathException
convertToJava
in class Value
target
- The class required by the external functionXPathException
public void display(int level)
display
in class Expression