Package net.sf.saxon.value
Class RestrictedStringValue
- java.lang.Object
-
- net.sf.saxon.value.Value
-
- net.sf.saxon.value.AtomicValue
-
- net.sf.saxon.value.StringValue
-
- net.sf.saxon.value.RestrictedStringValue
-
- All Implemented Interfaces:
java.io.Serializable
,Expression
,Item
,ValueRepresentation
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.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.sf.saxon.value.StringValue
StringValue.CharacterIterator
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.value.StringValue
EMPTY_STRING, FALSE, length, SINGLE_SPACE, TRUE, value
-
Fields inherited from class net.sf.saxon.value.Value
EMPTY_CLASS_ARRAY
-
Fields inherited from interface net.sf.saxon.expr.Expression
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD
-
Fields inherited from interface net.sf.saxon.om.ValueRepresentation
EMPTY_VALUE_ARRAY
-
-
Constructor Summary
Constructors Constructor Description RestrictedStringValue()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AtomicValue
convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
Convert to target data typeItemType
getItemType(TypeHierarchy th)
Return the type of the expressionstatic AtomicValue
makeRestrictedString(java.lang.CharSequence value, int type, NameChecker checker)
Factory method to create a restricted string value from a stringjava.lang.String
toString()
Get string value.-
Methods inherited from class net.sf.saxon.value.StringValue
codepointEquals, containsSurrogatePairs, contract, convertStringToAtomicType, convertStringToBuiltInType, convertToJava, effectiveBooleanValue, equals, expand, expand, getStringLength, getStringLength, getStringValue, getStringValueCS, hashCode, isZeroLength, iterateCharacters, makeStringValue
-
Methods inherited from class net.sf.saxon.value.AtomicValue
checkPermittedContents, convert, convert, display, evaluateAsString, evaluateItem, getCardinality, getComponent, getImplementationMethod, getLength, getPrimitiveValue, getTypedValue, hasBuiltInType, iterate, process
-
Methods inherited from class net.sf.saxon.value.Value
asItem, asIterator, asValue, convert, convertJavaObjectToXPath, getDependencies, getIterator, getParentExpression, getSpecialProperties, itemAt, iterateSubExpressions, makeQNameValue, optimize, promote, reduce, simplify, stringToNumber, typeCheck
-
-
-
-
Method Detail
-
makeRestrictedString
public static AtomicValue makeRestrictedString(java.lang.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.
-
getItemType
public ItemType getItemType(TypeHierarchy th)
Return the type of the expression- Specified by:
getItemType
in interfaceExpression
- Overrides:
getItemType
in classStringValue
- Parameters:
th
-- Returns:
- Type.STRING (always)
-
convertPrimitive
public AtomicValue convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
Convert to target data type- Overrides:
convertPrimitive
in classStringValue
- Parameters:
requiredType
- an integer identifying the required atomic typecontext
-validate
- true if validation is required. If set to false, the caller guarantees that the 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.- Returns:
- an AtomicValue, a value of the required type; or an ErrorValue
-
toString
public java.lang.String toString()
Description copied from class:AtomicValue
Get string value. In general toString() for an atomic value displays the value as it would be written in XPath: that is, as a literal if available, or as a call on a constructor function otherwise.- Overrides:
toString
in classStringValue
-
-