org.inria.ns.reflex.processor.asl.types.adt
Class PrefixType

java.lang.Object
  extended by org.inria.ns.reflex.processor.asl.types.adt.PrefixType
All Implemented Interfaces:
NamedType, Type

public class PrefixType
extends Object
implements Type

The #adt:prefix type.

Author:
Philippe Poulard

Field Summary
static PrefixType PREFIX_TYPE_
          A singleton of this type.
static QName TYPE_NAME_
          The qualified name of this type.
 
Constructor Summary
PrefixType()
           
 
Method Summary
 TypedData cast(Object o, XPathContext context)
          Cast an object to a PrefixData.
 Comparator getComparator()
          Return a comparator that compares strings.
 Schema getOwnerSchema()
          Return the schema that owns this type definition.
 QName getParentType()
          Return the parent type in the type hierarchy.
 QName getTypeName()
          Return #adt:prefix.
 TypedData parse(String prefix, XPathContext context)
          Create a wrapper for a prefix.
 TypedData parse(TextCandidate text, XPathContext context)
          Create a wrapper for a prefix.
 TypedData parse(TypedData data, XPathContext context)
          Create a prefix 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.


PREFIX_TYPE_

public static final PrefixType PREFIX_TYPE_
A singleton of this type.

Constructor Detail

PrefixType

public PrefixType()
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()

parse

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

Specified by:
parse in interface Type
Parameters:
text - The input string.
context - Contains the namespace mapping for prefix resolution.
Returns:
The prefix data that wraps the namespace URI of the prefix.
Throws:
TypeFormatException - If there is no namespace URI bound to the prefix.

parse

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

Parameters:
prefix - The prefix.
context - Contains the namespace mapping for prefix resolution.
Returns:
The prefix data that wraps the namespace URI of the prefix.
Throws:
TypeFormatException - If there is no namespace URI bound to the prefix.

parse

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

Parameters:
data - The typed data that has a remainder prefix.
context - Contains the namespace mapping for prefix resolution.
Returns:
The prefix data that wraps the namespace URI of the prefix.
Throws:
TypeFormatException - If there is no namespace URI bound to the prefix.

cast

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

Specified by:
cast in interface Type
Parameters:
o - The object to cast.
context - Contains the namespace mapping for prefix resolution.
Returns:
The prefix data that wraps the namespace URI of the prefix.
Throws:
TypeFormatException - If there is no namespace URI bound to the prefix.

getTypeName

public QName getTypeName()
Return #adt:prefix.

Specified by:
getTypeName in interface NamedType
Returns:
adt:prefix.

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()

getParentType

public QName getParentType()
Description copied from interface: Type
Return the parent type in the type hierarchy.

Specified by:
getParentType in interface Type
Returns:
The non-null type name.