Data Request Broker
2-3-release

fr.gael.drb.xsd
Class XsdAtomicType

java.lang.Object
  extended by fr.gael.drb.xsd.XsdType
      extended by fr.gael.drb.xsd.XsdSimpleType
          extended by fr.gael.drb.xsd.XsdAtomicType
All Implemented Interfaces:
ValueValidator, XsdValueSpace

public class XsdAtomicType
extends XsdSimpleType

Declaration of an XML-Schema atomic type.


Field Summary
protected  int primitive
          Primitive of this atomic type.
protected  String targetNamespace
          The target namespace of this type.
 
Fields inherited from class fr.gael.drb.xsd.XsdSimpleType
ALL_FINAL, ATOMIC_VARIETY, EMPTY_FINAL, facets, finals, LIST_FINAL, LIST_VARIETY, RESTRICTION_FINAL, UNION_FINAL, UNION_VARIETY
 
Fields inherited from class fr.gael.drb.xsd.XsdType
base, derivationMethod, EXTENSION_METHOD, name, RESTRICTION_METHOD, schema
 
Fields inherited from interface fr.gael.drb.xsd.XsdValueSpace
COUNTABLY_INFINITE, FINITE, PARTIAL, TOTAL, UNCOUNTABLY_INFINITE, UNDEFINED
 
Constructor Summary
XsdAtomicType(int primitive)
          Build an XsdAtomicType from a primitive.
 
Method Summary
 XsdAnnotation getAnnotation()
          Returns annotation of this component.
 int getCardinality()
          Returns the cardinality of this value space.
 Value getExclusiveLowerBound()
          Returns the exclusive lower bound.
 Value getExclusiveUpperBound()
          Returns the exclusive upper bound.
 DrbAttributeList getExternalAttributes()
          Returns the external attributes of this component.
 DrbNodeList getExternalNodes()
          Returns the external nodes of this component.
 Value getInclusiveLowerBound()
          Returns the inclusive lower bound.
 Value getInclusiveUpperBound()
          Returns the inclusive upper bound.
 int getOrderRelation()
          Returns the order-relation of this value space.
 String getTargetNamespace()
          Returns the target namespace of this type.
 int getTypeId()
          Returns the identifier of this simple type.
 Value getValue(String text)
          Create a value from a string.
 int getVariety()
          Returns the variety of this simple type.
protected  void init(int primitive)
          Initialize an XsdAtomicType from a primitive.
 boolean isBounded()
          A datatype is bounded if its value space has either an inclusive upper bound or an exclusive upper bound and either an inclusive lower bound and an exclusive lower bound.
 boolean isNumeric()
          A datatype is said to be numeric if its values are conceptually quantities (in some mathematical number system).
 boolean isOrdered()
          A value space, is said to be ordered if there exists an order-relation defined for that value space.
 boolean isValid(Value value)
          Check if this value satifies the type definition.
protected  boolean isValidType(Value value)
          Validates the present value.
static void main(String[] args)
          Makes this class runnable for testing.
 void setAnnotation(XsdAnnotation annotation)
          Set annotation of this component.
 void setExternalAttributes(DrbAttributeList external_attributes)
          Set the external attributes of this component.
 void setExternalNodes(DrbNodeList external_nodes)
          Set the external nodes of this component.
 void setTargetNamespace(String target_namespace)
          Set the target namespace of this type.
 
Methods inherited from class fr.gael.drb.xsd.XsdSimpleType
getDatatype, getFacets, getFinals, getStructure, isComplex, isValid, validate
 
Methods inherited from class fr.gael.drb.xsd.XsdType
getBase, getDerivation, getName, getSchema, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

primitive

protected int primitive
Primitive of this atomic type.


targetNamespace

protected String targetNamespace
The target namespace of this type.

Constructor Detail

XsdAtomicType

public XsdAtomicType(int primitive)
Build an XsdAtomicType from a primitive.

Parameters:
primitive - The primitif type
Method Detail

init

protected void init(int primitive)
Initialize an XsdAtomicType from a primitive.

Parameters:
primitive - The primitif type

getVariety

public final int getVariety()
Returns the variety of this simple type.

Specified by:
getVariety in class XsdSimpleType
Returns:
int The variety atomic type

getTypeId

public int getTypeId()
Returns the identifier of this simple type.

Overrides:
getTypeId in class XsdSimpleType
Returns:
int The type
See Also:
Value

getValue

public Value getValue(String text)
Create a value from a string.

Specified by:
getValue in class XsdSimpleType
Parameters:
text - the string representation of the value.
Returns:
the text converted to this value type.

isOrdered

public boolean isOrdered()
A value space, is said to be ordered if there exists an order-relation defined for that value space.

Returns:
true if this value space is ordered and false otherwise.

getOrderRelation

public int getOrderRelation()
Returns the order-relation of this value space. An order relation on a value space is a mathematical relation that imposes a total order or a partial order on the members of the value space

Returns:
the order-relation defined on that value space
See Also:
XsdValueSpace.PARTIAL, XsdValueSpace.TOTAL

isBounded

public boolean isBounded()
A datatype is bounded if its value space has either an inclusive upper bound or an exclusive upper bound and either an inclusive lower bound and an exclusive lower bound.

Returns:
true if this value space is bounded and false otherwise.

getInclusiveLowerBound

public Value getInclusiveLowerBound()
Returns the inclusive lower bound.

Returns:
The inclusive lower bound or null if not defined.

getInclusiveUpperBound

public Value getInclusiveUpperBound()
Returns the inclusive upper bound.

Returns:
The inclusive upper bound or null if not defined.

getExclusiveLowerBound

public Value getExclusiveLowerBound()
Returns the exclusive lower bound.

Returns:
The exclusive lower bound or null if not defined.

getExclusiveUpperBound

public Value getExclusiveUpperBound()
Returns the exclusive upper bound.

Returns:
The exclusive upper bound or null if not defined.

getCardinality

public int getCardinality()
Returns the cardinality of this value space. Every value space has associated with it the concept of cardinality. Some value spaces are finite, some are countably infinite while still others could conceivably be uncountably infinite (although no value space defined by the XML-Schema specification is uncountable infinite). A datatype is said to have the cardinality of its value space.

Returns:
The cardinality of this value space.
See Also:
XsdValueSpace.FINITE, XsdValueSpace.COUNTABLY_INFINITE, XsdValueSpace.UNCOUNTABLY_INFINITE

isNumeric

public boolean isNumeric()
A datatype is said to be numeric if its values are conceptually quantities (in some mathematical number system).

Returns:
true if the datatype is numeric and false otherwise

isValidType

protected boolean isValidType(Value value)
Validates the present value.

Overrides:
isValidType in class XsdSimpleType
Parameters:
value - the value
Returns:
an error report or null.

isValid

public boolean isValid(Value value)
Check if this value satifies the type definition.

Specified by:
isValid in interface ValueValidator
Overrides:
isValid in class XsdSimpleType
Parameters:
value - The value
Returns:
true if it is valid , else false

main

public static void main(String[] args)
Makes this class runnable for testing.

Parameters:
args - String[]

getAnnotation

public final XsdAnnotation getAnnotation()
Returns annotation of this component.

Returns:
The annotation of this component

setAnnotation

public final void setAnnotation(XsdAnnotation annotation)
Set annotation of this component.

Parameters:
annotation - The annotation of this component

getExternalNodes

public final DrbNodeList getExternalNodes()
Returns the external nodes of this component.

Returns:
The list of the node

setExternalNodes

public final void setExternalNodes(DrbNodeList external_nodes)
Set the external nodes of this component.

Parameters:
external_nodes - The list of the node

getExternalAttributes

public final DrbAttributeList getExternalAttributes()
Returns the external attributes of this component.

Returns:
The list of attributes

setExternalAttributes

public final void setExternalAttributes(DrbAttributeList external_attributes)
Set the external attributes of this component.

Parameters:
external_attributes - The list of the attributes

getTargetNamespace

public final String getTargetNamespace()
Returns the target namespace of this type.

Returns:
the target namespace of this type.

setTargetNamespace

public final void setTargetNamespace(String target_namespace)
Set the target namespace of this type.

Parameters:
target_namespace - the target namespace of this type.

Data Request Broker - DRB API®
2-3-release

Copyright© 2001-2009 GAEL Consultant. All rights reserved. Use is subject to license terms .