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:
Expression, Item, java.io.Serializable

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 inherited from class net.sf.saxon.value.StringValue
StringValue.CharacterIterator
 
Field Summary
 
Fields inherited from class net.sf.saxon.value.StringValue
EMPTY_STRING, length, value
 
Fields inherited from interface net.sf.saxon.expr.Expression
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD
 
Constructor Summary
RestrictedStringValue(java.lang.CharSequence value, int type)
          Constructor
 
Method Summary
 AtomicValue convert(int requiredType, XPathContext context)
          Convert to target data type
 ItemType getItemType()
          Return the type of the expression
 java.lang.String toString()
          Get string value.
 
Methods inherited from class net.sf.saxon.value.StringValue
convertToJava, effectiveBooleanValue, equals, expand, getLength, getLength, getStringValue, hashCode, iterateCharacters
 
Methods inherited from class net.sf.saxon.value.AtomicValue
convert, display, evaluateAsString, evaluateItem, getCardinality, getComponent, getImplementationMethod, getPrimitiveValue, getTypedValue, iterate, process
 
Methods inherited from class net.sf.saxon.value.Value
analyze, asItem, asValue, collapseWhitespace, convertJavaObjectToXPath, getDependencies, getParentExpression, getSpecialProperties, inverse, iterateSubExpressions, normalizeWhitespace, promote, simplify, stringToNumber, trimWhitespace
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RestrictedStringValue

public RestrictedStringValue(java.lang.CharSequence value,
                             int type)
                      throws XPathException
Constructor

Parameters:
value - the String value. Null is taken as equivalent to "".
Method Detail

getItemType

public ItemType getItemType()
Return the type of the expression

Specified by:
getItemType in interface Expression
Overrides:
getItemType in class StringValue
Returns:
Type.STRING (always)

convert

public AtomicValue convert(int requiredType,
                           XPathContext context)
                    throws XPathException
Convert to target data type

Overrides:
convert in class StringValue
Parameters:
requiredType - an integer identifying the required atomic type
Returns:
an AtomicValue, a value of the required type
Throws:
XPathException - if the conversion is not possible

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 class StringValue