org.inria.ns.reflex.processor.asl.types.xs
Class StringType

java.lang.Object
  extended by org.inria.ns.reflex.processor.asl.types.xs.StringType
All Implemented Interfaces:
NamedType, Type
Direct Known Subclasses:
ExpressionType, PrefixesType

public class StringType
extends Object
implements Type

The implementation of the #xs:string type.

Author:
Philippe Poulard

Field Summary
static StringType STRING_TYPE
          A singleton of this type.
static QName TYPE_NAME
          The qualified name of this type.
 
Constructor Summary
StringType()
           
 
Method Summary
 TypedData cast(Object o, XPathContext context)
          Cast an object to a StringData.
static TypedData createStringData(String string, String remainder)
          Create a string data of this type.
 Comparator getComparator()
          Return a comparator that compares strings.
 Schema getOwnerSchema()
          Return the schema that owns this type definition.
 QName getParentType()
          Return #xs:anySimpleType.
 QName getTypeName()
          Return #xs:string.
 TypedData parse(String string, XPathContext context)
          Create a wrapper for a string.
 TypedData parse(TextCandidate text, XPathContext context)
          Create a wrapper for a string.
 TypedData parse(TypedData data, XPathContext context)
          Create a string data from the remainder of a typed data.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_NAME

public static final QName TYPE_NAME
The qualified name of this type.


STRING_TYPE

public static final StringType STRING_TYPE
A singleton of this type.

Constructor Detail

StringType

public StringType()
Method Detail

getComparator

public Comparator getComparator()
Return a comparator that compares strings.

Specified by:
getComparator in interface Type
Returns:
A non-null comparator that may comparate datas of this type.
See Also:
Type.getComparator()

createStringData

public static final TypedData createStringData(String string,
                                               String remainder)
Create a string data of this type.

Parameters:
string - The input string.
remainder - The remainder.
Returns:
A new string data.

parse

public TypedData parse(TextCandidate text,
                       XPathContext context)
                throws TypeFormatException
Create a wrapper for a string.

Specified by:
parse in interface Type
Parameters:
string - The input string.
context - Not used.
Returns:
The string data that wraps the input string.
Throws:
TypeFormatException - Never thrown.

parse

public TypedData parse(String string,
                       XPathContext context)
                throws TypeFormatException
Create a wrapper for a string.

Parameters:
string - The input string.
context - Not used.
Returns:
The string data that wraps the input string.
Throws:
TypeFormatException - Never thrown.

parse

public TypedData parse(TypedData data,
                       XPathContext context)
                throws TypeFormatException
Create a string data from the remainder of a typed data.

Parameters:
data - The data that has the remainder string.
context - Not used.
Returns:
The string data that wraps the input string.
Throws:
TypeFormatException - Never thrown.

cast

public TypedData cast(Object o,
                      XPathContext context)
               throws TypeFormatException
Cast an object to a StringData.

Specified by:
cast in interface Type
Parameters:
o - The object to cast.
context - Not used.
Returns:
The string data that wraps the input string.
Throws:
TypeFormatException - Never thrown.

getTypeName

public QName getTypeName()
Return #xs:string.

Specified by:
getTypeName in interface NamedType
Returns:
xs:string.

getParentType

public QName getParentType()
Return #xs:anySimpleType.

Specified by:
getParentType in interface Type
Returns:
xs:anySimpleType.
See Also:
AnySimpleType

getOwnerSchema

public Schema getOwnerSchema()
Return the schema that owns this type definition.

Specified by:
getOwnerSchema in interface Type
Returns:
The schema that owns this type definition.
See Also:
Type.getOwnerSchema()