net.sf.saxon.value

Class RestrictedStringValue

public final class RestrictedStringValue extends StringValue

A value conforming to one of the built-in subtypes of String, specifically normalizedString, token, language, Name, NCName, ID, IDREF, ENTITY, NMTOKEN. This class doesnt' handle the types derived by list: IDREFS, NMTOKENS, ENTITIES.
Method Summary
AtomicValueconvertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
Convert to target data type
ItemTypegetItemType(TypeHierarchy th)
Return the type of the expression
static AtomicValuemakeRestrictedString(CharSequence value, int type, NameChecker checker)
Factory method to create a restricted string value from a string
StringtoString()

Method Detail

convertPrimitive

public AtomicValue convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
Convert to target data type

Parameters: requiredType an integer identifying the required atomic type context

Returns: an AtomicValue, a value of the required type; or an ErrorValue

getItemType

public ItemType getItemType(TypeHierarchy th)
Return the type of the expression

Parameters: th

makeRestrictedString

public static AtomicValue makeRestrictedString(CharSequence value, int type, NameChecker checker)
Factory method to create a restricted string value from a string

Parameters: value the String value. Null is taken as equivalent to "". checker a NameChecker if validation is required, null if the caller already knows that the value is valid

Returns: either the required RestrictedStringValue if the value is valid, or an ErrorValue encapsulating the error message if not.

toString

public String toString()