| java.lang.Object net.sf.saxon.value.Value net.sf.saxon.value.AtomicValue net.sf.saxon.value.StringValue
All known Subclasses: net.sf.saxon.value.RestrictedStringValue, net.sf.saxon.value.UntypedAtomicValue, net.sf.saxon.value.AnyURIValue,
StringValue | public class StringValue extends AtomicValue (Code) | | An atomic value of type xs:string
|
Method Summary | |
public static CharSequence | contract(int[] codes, int used) | public AtomicValue | convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context) Convert a value to another primitive data type, with control over how validation is
handled.
Parameters: requiredType - type code of the required atomic type Parameters: validate - true if validation is required. | public static AtomicValue | convertStringToAtomicType(CharSequence value, AtomicType targetType, NameChecker checker) Convert the value to a given type. | public static AtomicValue | convertStringToBuiltInType(CharSequence value, BuiltInAtomicType requiredType, NameChecker checker) Convert a string value to another built-in data type, with control over how validation is
handled.
Parameters: value - the value to be converted Parameters: requiredType - the required atomic type Parameters: checker - if validation is required, a NameChecker. | public Object | convertToJava(Class target, XPathContext context) | public boolean | effectiveBooleanValue(XPathContext context) | public boolean | equals(Object other) Determine if two StringValues are equal, according to XML Schema rules. | public static int[] | expand(CharSequence s) | public ItemType | getItemType(TypeHierarchy th) | public int | getStringLength() Get the length of this string, as defined in XPath. | public static int | getStringLength(CharSequence s) Get the length of a string, as defined in XPath. | final public String | getStringValue() | final public CharSequence | getStringValueCS() Get the value of the item as a CharSequence. | public int | hashCode() | public SequenceIterator | iterateCharacters() | public static StringValue | makeStringValue(CharSequence value) Factory method. | public boolean | schemaEquals(Value obj) Compare two values for equality. | public String | toString() |
length | protected int length(Code) | | |
StringValue | protected StringValue()(Code) | | Protected constructor for use by subtypes
|
StringValue | public StringValue(CharSequence value)(Code) | | Constructor. Note that although a StringValue may wrap any kind of CharSequence
(usually a String, but it can also be, for example, a StringBuffer), the caller
is responsible for ensuring that the value is immutable.
Parameters: value - the String value. Null is taken as equivalent to "". |
contract | public static CharSequence contract(int[] codes, int used)(Code) | | Contract an array of integers containing Unicode codepoints into a Java string
|
convertPrimitive | public AtomicValue convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)(Code) | | Convert a value to another primitive data type, with control over how validation is
handled.
Parameters: requiredType - type code of the required atomic type Parameters: validate - true if validation is required. If set to false, the caller guarantees thatthe value is valid for the target data type, and that further validation is therefore not required.Note that a validation failure may be reported even if validation was not requested. Parameters: context - the result of the conversion, if successful. If unsuccessful, the value returnedwill be a ValidationErrorValue. The caller must check for this condition. No exception is thrown, insteadthe exception will be encapsulated within the ErrorValue. |
convertStringToAtomicType | public static AtomicValue convertStringToAtomicType(CharSequence value, AtomicType targetType, NameChecker checker)(Code) | | Convert the value to a given type. The result of the conversion will be
an atomic value of the required type. This method works where the target
type is a built-in atomic type and also where it is a user-defined atomic
type.
Parameters: targetType - the type to which the value is to be converted Parameters: checker - a NameChecker if validation is required, null if the caller already knows that thevalue is valid the value after conversion if successful; or a ValidationErrorValue if conversion failed. Thecaller must check for this condition. Validation may fail even if validation was not requested. |
convertStringToBuiltInType | public static AtomicValue convertStringToBuiltInType(CharSequence value, BuiltInAtomicType requiredType, NameChecker checker)(Code) | | Convert a string value to another built-in data type, with control over how validation is
handled.
Parameters: value - the value to be converted Parameters: requiredType - the required atomic type Parameters: checker - if validation is required, a NameChecker. If set to null, the caller guarantees thatthe value is valid for the target data type, and that further validation is therefore not required.Note that a validation failure may be reported even if validation was not requested. the result of the conversion, if successful. If unsuccessful, the value returnedwill be a ValidationErrorValue. The caller must check for this condition. No exception is thrown, insteadthe exception will be encapsulated within the ValidationErrorValue. |
equals | public boolean equals(Object other)(Code) | | Determine if two StringValues are equal, according to XML Schema rules. (This method
is not used for XPath comparisons, which are always under the control of a collation.)
throws: ClassCastException - if the values are not comparable |
expand | public static int[] expand(CharSequence s)(Code) | | Expand a string containing surrogate pairs into an array of 32-bit characters
|
getStringLength | public int getStringLength()(Code) | | 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
|
getStringLength | public static int getStringLength(CharSequence s)(Code) | | 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 |
getStringValue | final public String getStringValue()(Code) | | Get the string value as a String
|
getStringValueCS | final public CharSequence getStringValueCS()(Code) | | Get the value of the item as a CharSequence. This is in some cases more efficient than
the version of the method that returns a String.
|
hashCode | public int hashCode()(Code) | | |
iterateCharacters | public SequenceIterator iterateCharacters()(Code) | | Iterate over a string, returning a sequence of integers representing the Unicode code-point values
|
makeStringValue | public static StringValue makeStringValue(CharSequence value)(Code) | | Factory method. Unlike the constructor, this avoids creating a new StringValue in the case
of a zero-length string (and potentially other strings, in future)
Parameters: value - the String value. Null is taken as equivalent to "". the corresponding StringValue |
schemaEquals | public boolean schemaEquals(Value obj)(Code) | | Compare two values for equality. This supports identity constraints in XML Schema,
which allow list-valued elements and attributes to participate in key and uniqueness constraints.
This method returns false if any error occurs during the comparison, or if any of the items
in either sequence is a node rather than an atomic value. The default implementation of
schemaEquals() is the same as equals(), but subclasses can override this.
|
Fields inherited from net.sf.saxon.value.Value | final public static Class[] EMPTY_CLASS_ARRAY(Code)(Java Doc)
|
Methods inherited from net.sf.saxon.value.Value | public static Item asItem(ValueRepresentation value, XPathContext context) throws XPathException(Code)(Java Doc) public static SequenceIterator asIterator(ValueRepresentation val, XPathContext context) throws XPathException(Code)(Java Doc) public static Value asValue(ValueRepresentation val)(Code)(Java Doc) public void checkPermittedContents(SchemaType parentType, StaticContext env, boolean whole) throws XPathException(Code)(Java Doc) public static CharSequence collapseWhitespace(CharSequence in)(Code)(Java Doc) public static Object convert(Item item) throws XPathException(Code)(Java Doc) public static Value convertJavaObjectToXPath(Object object, SequenceType requiredType, Configuration config) throws XPathException(Code)(Java Doc) public Object convertToJava(Class target, XPathContext context) throws XPathException(Code)(Java Doc) public void display(int level, NamePool pool, PrintStream out)(Code)(Java Doc) public boolean effectiveBooleanValue(XPathContext context) throws XPathException(Code)(Java Doc) public boolean equals(Object obj)(Code)(Java Doc) public String evaluateAsString(XPathContext context) throws XPathException(Code)(Java Doc) public Item evaluateItem(XPathContext context) throws XPathException(Code)(Java Doc) public int getCardinality()(Code)(Java Doc) final public int getDependencies()(Code)(Java Doc) public ItemType getItemType(TypeHierarchy th)(Code)(Java Doc) public static SequenceIterator getIterator(ValueRepresentation val) throws XPathException(Code)(Java Doc) public int getLength() throws XPathException(Code)(Java Doc) final public Container getParentExpression()(Code)(Java Doc) public int getSpecialProperties()(Code)(Java Doc) public String getStringValue() throws XPathException(Code)(Java Doc) public int hashCode()(Code)(Java Doc) public Item itemAt(int n) throws XPathException(Code)(Java Doc) final public Iterator iterateSubExpressions()(Code)(Java Doc) public static QNameValue makeQNameValue(Object object, Configuration config)(Code)(Java Doc) public static CharSequence normalizeWhitespace(CharSequence in)(Code)(Java Doc) final public Expression optimize(Optimizer opt, StaticContext env, ItemType contextItemType)(Code)(Java Doc) public void process(XPathContext context) throws XPathException(Code)(Java Doc) final public Expression promote(PromotionOffer offer)(Code)(Java Doc) public Value reduce() throws XPathException(Code)(Java Doc) public boolean schemaEquals(Value obj)(Code)(Java Doc) final public Expression simplify(StaticContext env)(Code)(Java Doc) public static double stringToNumber(CharSequence s) throws NumberFormatException(Code)(Java Doc) public String toString()(Code)(Java Doc) public static CharSequence trimWhitespace(CharSequence in)(Code)(Java Doc) final public Expression typeCheck(StaticContext env, ItemType contextItemType)(Code)(Java Doc)
|
|
|