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:
Serializable
,Expression
,Item
,ValueRepresentation
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:
-
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 -
Method Summary
Modifier and TypeMethodDescriptionconvertPrimitive
(BuiltInAtomicType requiredType, boolean validate, XPathContext context) Convert to target data typeReturn the type of the expressionstatic AtomicValue
makeRestrictedString
(CharSequence value, int type, NameChecker checker) Factory method to create a restricted string value from a stringtoString()
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
-
Constructor Details
-
RestrictedStringValue
public RestrictedStringValue()
-
-
Method Details
-
makeRestrictedString
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
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 typevalidate
- 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.context
-- Returns:
- an AtomicValue, a value of the required type; or an ErrorValue
-
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
-