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

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

public class NonPositiveIntegerType
extends Object
implements Type

The #xs:nonPositiveInteger type.

Author:
Philippe Poulard

Field Summary
 NumberConstraint NON_POSITIVE_INTEGER_CONSTRAINT
          A constraint for parsing non positive integers.
 
Constructor Summary
NonPositiveIntegerType()
           
 
Method Summary
 TypedData cast(Object o, XPathContext context)
          Cast an object to a xs:nonPositiveInteger.
 Comparator getComparator()
          Return a comparator that compares numbers.
 Schema getOwnerSchema()
          Return the schema that owns this type definition.
 QName getParentType()
          Return #xs:integer.
 QName getTypeName()
          Return #xs:nonPositiveInteger.
 TypedData parse(String numberString, XPathContext context)
          Parses a string to a non positive integer.
 TypedData parse(TextCandidate number, XPathContext context)
          Parses a string to a non positive integer.
 TypedData parse(TypedData data, XPathContext context)
          Parses the remainder of a typed data to a non positive integer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NON_POSITIVE_INTEGER_CONSTRAINT

public NumberConstraint NON_POSITIVE_INTEGER_CONSTRAINT
A constraint for parsing non positive integers. The constraint is applied while parsing.

See Also:
BigInteger
Constructor Detail

NonPositiveIntegerType

public NonPositiveIntegerType()
Method Detail

parse

public TypedData parse(TextCandidate number,
                       XPathContext context)
                throws TypeFormatException
Parses a string to a non positive integer.

Specified by:
parse in interface Type
Parameters:
number - The number to parse.
context - Not used.
Returns:
The number data that wraps the non positive integer and the remainder.
Throws:
TypeFormatException - When the input string can't be a non positive integer.
See Also:
NumericData

parse

public TypedData parse(TypedData data,
                       XPathContext context)
                throws TypeFormatException
Parses the remainder of a typed data to a non positive integer.

Parameters:
data - The data that has a remainder to parse.
context - Not used.
Returns:
The number data that wraps the non positive integer and the remainder.
Throws:
TypeFormatException - When the input string can't be a non positive integer.
See Also:
NumericData

parse

public TypedData parse(String numberString,
                       XPathContext context)
                throws TypeFormatException
Parses a string to a non positive integer.

Parameters:
numberString - The number to parse.
context - Not used.
Returns:
The number data that wraps the non positive integer and the remainder.
Throws:
TypeFormatException - When the input string can't be a non positive integer.
See Also:
NumericData

cast

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

Specified by:
cast in interface Type
Parameters:
o - The object to cast.
context - Not used.
Returns:
The number data that wraps the non positive integer.
Throws:
TypeFormatException - When the input object can't be a non positive integer.
See Also:
NumericData

getTypeName

public QName getTypeName()
Return #xs:nonPositiveInteger.

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

getParentType

public QName getParentType()
Return #xs:integer.

Specified by:
getParentType in interface Type
Returns:
xs:integer.
See Also:
IntegerType

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

getComparator

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

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