org.inria.ns.reflex.processor.asl.types
Interface Type

All Superinterfaces:
NamedType
All Known Implementing Classes:
AnySimpleType, AnyType, ByteType, DateTimeType, DateType, DecimalType, DoubleType, ExpressionType, FloatType, IntegerType, IntType, LongType, NegativeIntegerType, NonNegativeIntegerType, NonPositiveIntegerType, PositiveIntegerType, PrefixesType, PrefixType, QNameType, ShortType, StringType, TimeType, TypeAction

public interface Type
extends NamedType

A type.

Author:
Philippe Poulard

Method Summary
 TypedData cast(Object o, XPathContext context)
          Casts an object to a typed data.
 Comparator getComparator()
          Return the comparator for this type.
 Schema getOwnerSchema()
          The schema instance that owns this definition.
 QName getParentType()
          Return the parent type in the type hierarchy.
 TypedData parse(TextCandidate tc, XPathContext context)
          Parses a string to a typed data.
 
Methods inherited from interface org.inria.ns.reflex.processor.asl.types.NamedType
getTypeName
 

Method Detail

parse

TypedData parse(TextCandidate tc,
                XPathContext context)
                throws TypeFormatException
Parses a string to a typed data.

Parameters:
tc - The string to parse, as a text candidate.
context - The context to use when parsing the string.

The variable resolver of the context may deliver a data set that may contain useful properties while parsing. Particularly, types defined with the <asl:type> element are using a data set. The data set should contain the schema client handler on behalf this parsing will be performed. User defined data parsers uses the client when it is defined with active tags such as <asl:sequence>, <asl:choice> etc. Built-in data parsers usually ignore it. Additionally, the data set is used to store the typed data currently parsing, $asl:data.

Returns:
The typed data that wraps the object obtained after parsing and the remainder of the string.
Throws:
TypeFormatException - When the input string is not of the type expected.

cast

TypedData cast(Object o,
               XPathContext context)
               throws TypeFormatException
Casts an object to a typed data.

Parameters:
o - The object to cast.
context - The context to use when parsing the string.

The variable resolver of the context may deliver a data set that may contain useful properties while parsing.

Returns:
The typed data that wraps the object obtained after casting.
Throws:
TypeFormatException - When the input object is not of the type expected.

getOwnerSchema

Schema getOwnerSchema()
The schema instance that owns this definition.

Returns:
The schema instance that owns this definition.

getParentType

QName getParentType()
Return the parent type in the type hierarchy.

Returns:
The non-null type name.

getComparator

Comparator getComparator()
Return the comparator for this type.

Returns:
A non-null comparator that may comparate datas of this type.