net.sf.saxon.value
Class RestrictedStringValue

java.lang.Object
  extended by net.sf.saxon.value.Value
      extended by net.sf.saxon.value.AtomicValue
          extended by net.sf.saxon.value.StringValue
              extended by net.sf.saxon.value.RestrictedStringValue
All Implemented Interfaces:
Serializable, Expression, Item

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, length, value
 
Constructor Summary
RestrictedStringValue(CharSequence value, int type)
          Constructor
 
Method Summary
 AtomicValue convert(int requiredType)
          Convert to target data type
 void display(int level, NamePool pool)
          Diagnostic print of expression structure
 ItemType getItemType()
          Return the type of the expression
 String toString()
           
 
Methods inherited from class net.sf.saxon.value.StringValue
conversionPreference, convertToJava, effectiveBooleanValue, equals, expand, getLength, getLength, getStringValue, hashCode, iterateCharacters
 
Methods inherited from class net.sf.saxon.value.AtomicValue
convert, convert, evaluateAsString, evaluateItem, getCardinality, getComponent, getPrimitiveValue, getTypedValue, iterate
 
Methods inherited from class net.sf.saxon.value.Value
analyze, asItem, asValue, collapseWhitespace, getDependencies, getSpecialProperties, getSubExpressions, inverse, normalizeWhitespace, promote, simplify, stringToInteger, stringToNumber, trimWhitespace
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RestrictedStringValue

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

Parameters:
value - the String value. Null is taken as equivalent to "".
Throws:
XPathException
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)
                    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

display

public void display(int level,
                    NamePool pool)
Diagnostic print of expression structure

Specified by:
display in interface Expression
Overrides:
display in class StringValue
Parameters:
level - indentation level for this expression

toString

public String toString()
Overrides:
toString in class StringValue