com.jaxfront.core.schema.impl
Class SchemaSimpleTypeImpl

java.lang.Object
  extended by com.jaxfront.core.schema.impl.SchemaComplexTypeImpl
      extended by com.jaxfront.core.schema.impl.SchemaSimpleTypeImpl
All Implemented Interfaces:
QName, SchemaComplexType, SchemaSimpleType, SchemaType, java.io.Serializable

public class SchemaSimpleTypeImpl
extends SchemaComplexTypeImpl
implements SchemaSimpleType

Represent a simple XML schema type. The XSD constants from the W3C XML Schema specification are defined in the XSD Oracle Parser (oracle.xml.parser.schema.XSDTypeConstants)

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.jaxfront.core.schema.SchemaSimpleType
WHITESPACE_COLLAPSE, WHITESPACE_PRESERVE, WHITESPACE_REPLACE
 
Fields inherited from interface com.jaxfront.core.schema.SchemaType
NO_NAME
 
Constructor Summary
SchemaSimpleTypeImpl(java.lang.String nameSpace, java.lang.String name, org.apache.xerces.xs.XSTypeDefinition node, XMLSchema schema, SchemaNode element)
          Creates a SchemaSimpleType based on a oracle XSDSimpleType, a XMLSchema and a SchemaNode.
SchemaSimpleTypeImpl(org.apache.xerces.xs.XSTypeDefinition node, XMLSchema schema, SchemaNode element)
          Creates a SchemaSimpleType based on a oracle XSDSimpleType, a XMLSchema and a SchemaNode.
 
Method Summary
 java.lang.String getBaseName()
          Returns the base name (if type is an extension or restriction) of the inherited type.
 java.lang.String[] getChoices()
          Returns the possible choice values (from the facet 'enumeration') defined in a XML Schema.
 java.util.Hashtable getEnumerationAnnotation(java.lang.String enumeration)
          Return an annotation for an enumeration entry for the passed value or null if none has been defined in the XSD.
 int getFractionDigits()
           
 double getMaxExclValue()
           
 double getMaxInclValue()
           
 long getMaxLength()
          Returns the required maximum length.
 double getMinExclValue()
           
 double getMinInclValue()
           
 long getMinLength()
          Returns the required minimum length.
 int getPrimitiveDataType()
          Returns the index of the primitive data type. e.q.
 java.lang.String getRegularExpression()
          Returns the regular expression if any.
 int getTotalDigits()
           
 short getWhitespace()
           
 boolean hasRegularExpression()
          Returns true if a regular expression is defined for this type.
 boolean isAnyType()
          Returns true if the content of this type can be of any type
 boolean isAttribute()
          Returns true if this type is an attribute.
 boolean isBoolean()
          Returns if the primitive data type of this type is Boolean.
 boolean isChoice()
          Returns true if this schema type is a choice.
 boolean isDate()
          Returns if the primitive data type of this type is Date.
 boolean isDateTime()
          Returns if the primitive data type of this type is DateTime.
 boolean isDouble()
          Returns tru if the primitive data type of this type is a float
 boolean isDuration()
          Returns if the primitive data type of this type is Duration.
 boolean isFloat()
          Returns tru if the primitive data type of this type is a float
 boolean isFloatingNumber()
           
 boolean isGroup()
          Returns true if this schema type is a group.
 boolean isID()
          Returns true if the primitive data type is an ID.
 boolean isNumber()
          Returns if the primitive data type of this type is a number like Float, Double or Decimal.
 boolean isSimple()
          Returns true if this schema type is simple.
 boolean isString()
          Returns if the primitive data type of this type is String.
 boolean isTime()
          Returns if the primitive data type of this type is Date.
 void setFractionDigits(int fractionDigits)
           
 void setMaxExclValue(double maxExclValue)
           
 void setMaxInclValue(double maxInclValue)
           
 void setMaxLength(long maxLength)
           
 void setMinExclValue(double minExclValue)
           
 void setMinInclValue(double minInclValue)
           
 void setMinLength(long minLength)
           
 void setRegularExpression(java.lang.String regularExpression)
           
 void setTotalDigits(int totalDigits)
           
 void setWhitespace(short whitespace)
           
 void validate(SimpleType source, java.lang.String value)
          Validates a string against the defined facets in the XML Schema.
 
Methods inherited from class com.jaxfront.core.schema.impl.SchemaComplexTypeImpl
addRecursiveElement, countSubNodes, createQName, getAttributeSet, getChild, getChoiceMaxOccurs, getChoiceMinOccurs, getElementSet, getName, getNamespace, getNamespacePrefix, getParserXSDNode, getQName, getRecursiveElementNames, getRecursiveElements, getRefName, getSchemaElement, getSimpleContent, getType, hasBeenAnalysed, isAbstract, isAnonymous, isEmptyComplexType, isGlobal, isMixedContent, isRecursive, release, setIsSimpleContent, setRecursive, setType, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.jaxfront.core.schema.SchemaType
addRecursiveElement, countSubNodes, getChoiceMaxOccurs, getChoiceMinOccurs, getName, getNamespacePrefix, getParserXSDNode, getQName, getRecursiveElementNames, getRecursiveElements, getSchemaElement, getType, hasBeenAnalysed, isAbstract, isEmptyComplexType, isGlobal, isMixedContent, isRecursive, release, setIsSimpleContent, setRecursive, setType
 
Methods inherited from interface com.jaxfront.core.schema.QName
getNamespace, getRefName
 

Constructor Detail

SchemaSimpleTypeImpl

public SchemaSimpleTypeImpl(java.lang.String nameSpace,
                            java.lang.String name,
                            org.apache.xerces.xs.XSTypeDefinition node,
                            XMLSchema schema,
                            SchemaNode element)
Creates a SchemaSimpleType based on a oracle XSDSimpleType, a XMLSchema and a SchemaNode.

Parameters:
node - an oracle XSD Node (from oracle schema parser)
schema - an XML Schema
element - an XML Schema Element

SchemaSimpleTypeImpl

public SchemaSimpleTypeImpl(org.apache.xerces.xs.XSTypeDefinition node,
                            XMLSchema schema,
                            SchemaNode element)
Creates a SchemaSimpleType based on a oracle XSDSimpleType, a XMLSchema and a SchemaNode.

Parameters:
node - an oracle XSD Node (from oracle schema parser)
schema - an XML Schema
element - an XML Schema Element
Method Detail

getBaseName

public java.lang.String getBaseName()
Returns the base name (if type is an extension or restriction) of the inherited type.

Specified by:
getBaseName in interface SchemaType
Overrides:
getBaseName in class SchemaComplexTypeImpl

getChoices

public java.lang.String[] getChoices()
Returns the possible choice values (from the facet 'enumeration') defined in a XML Schema. Returns an empty string array if no enumeration defined.

Specified by:
getChoices in interface SchemaSimpleType

getEnumerationAnnotation

public java.util.Hashtable getEnumerationAnnotation(java.lang.String enumeration)
Description copied from interface: SchemaSimpleType
Return an annotation for an enumeration entry for the passed value or null if none has been defined in the XSD.

Specified by:
getEnumerationAnnotation in interface SchemaSimpleType

getFractionDigits

public int getFractionDigits()
Specified by:
getFractionDigits in interface SchemaSimpleType

getMaxExclValue

public double getMaxExclValue()
Specified by:
getMaxExclValue in interface SchemaSimpleType

getMaxInclValue

public double getMaxInclValue()
Specified by:
getMaxInclValue in interface SchemaSimpleType

getMaxLength

public long getMaxLength()
Description copied from interface: SchemaSimpleType
Returns the required maximum length.

Specified by:
getMaxLength in interface SchemaSimpleType
See Also:
SchemaSimpleType.getMinLength()

getMinExclValue

public double getMinExclValue()
Specified by:
getMinExclValue in interface SchemaSimpleType

getMinInclValue

public double getMinInclValue()
Specified by:
getMinInclValue in interface SchemaSimpleType

getMinLength

public long getMinLength()
Description copied from interface: SchemaSimpleType
Returns the required minimum length.

Specified by:
getMinLength in interface SchemaSimpleType
See Also:
SchemaSimpleType.getMinLength()

getPrimitiveDataType

public int getPrimitiveDataType()
Returns the index of the primitive data type. e.q. SimpleType.LONG defined in the oracle.xml.parser.schema.XSDTypeConstants.

Specified by:
getPrimitiveDataType in interface SchemaSimpleType

getRegularExpression

public java.lang.String getRegularExpression()
Description copied from interface: SchemaSimpleType
Returns the regular expression if any.

Specified by:
getRegularExpression in interface SchemaSimpleType
See Also:
SchemaSimpleType.getRegularExpression()

getTotalDigits

public int getTotalDigits()
Specified by:
getTotalDigits in interface SchemaSimpleType

getWhitespace

public short getWhitespace()
Specified by:
getWhitespace in interface SchemaSimpleType

hasRegularExpression

public boolean hasRegularExpression()
Description copied from interface: SchemaSimpleType
Returns true if a regular expression is defined for this type.

Specified by:
hasRegularExpression in interface SchemaSimpleType

isAnyType

public boolean isAnyType()
Description copied from interface: SchemaSimpleType
Returns true if the content of this type can be of any type

Specified by:
isAnyType in interface SchemaSimpleType
Returns:
See Also:
SchemaSimpleType.isAnyType()

isAttribute

public boolean isAttribute()
Returns true if this type is an attribute.

Specified by:
isAttribute in interface SchemaSimpleType

isBoolean

public boolean isBoolean()
Returns if the primitive data type of this type is Boolean.

Specified by:
isBoolean in interface SchemaSimpleType
Returns:
true, if the primitive data type of this type is Boolean, false otherwise

isChoice

public boolean isChoice()
Returns true if this schema type is a choice.

Specified by:
isChoice in interface SchemaType
Overrides:
isChoice in class SchemaComplexTypeImpl

isDate

public boolean isDate()
Description copied from interface: SchemaSimpleType
Returns if the primitive data type of this type is Date.

Specified by:
isDate in interface SchemaSimpleType
Returns:
true, if the primitive data type of this type is Date, false otherwise
See Also:
SchemaSimpleType.isDate()

isDateTime

public boolean isDateTime()
Description copied from interface: SchemaSimpleType
Returns if the primitive data type of this type is DateTime.

Specified by:
isDateTime in interface SchemaSimpleType
Returns:
true, if the primitive data type of this type is DateTime, false otherwise
See Also:
SchemaSimpleType.isDateTime()

isDouble

public boolean isDouble()
Returns tru if the primitive data type of this type is a float

Specified by:
isDouble in interface SchemaSimpleType

isDuration

public boolean isDuration()
Returns if the primitive data type of this type is Duration.

Specified by:
isDuration in interface SchemaSimpleType
Returns:
true, if the primitive data type of this type is Duration, false otherwise

isFloat

public boolean isFloat()
Returns tru if the primitive data type of this type is a float

Specified by:
isFloat in interface SchemaSimpleType

isFloatingNumber

public boolean isFloatingNumber()
Specified by:
isFloatingNumber in interface SchemaSimpleType

isGroup

public boolean isGroup()
Returns true if this schema type is a group.

Specified by:
isGroup in interface SchemaType
Overrides:
isGroup in class SchemaComplexTypeImpl

isID

public boolean isID()
Returns true if the primitive data type is an ID.

Specified by:
isID in interface SchemaSimpleType

isNumber

public boolean isNumber()
Returns if the primitive data type of this type is a number like Float, Double or Decimal.

Specified by:
isNumber in interface SchemaSimpleType
Returns:
true, if the primitive data type of this type is a number, false otherwise

isSimple

public boolean isSimple()
Returns true if this schema type is simple.

Specified by:
isSimple in interface SchemaType
Overrides:
isSimple in class SchemaComplexTypeImpl

isString

public boolean isString()
Returns if the primitive data type of this type is String.

Specified by:
isString in interface SchemaSimpleType
Returns:
true, if the primitive data type of this type is String, false otherwise

isTime

public boolean isTime()
Returns if the primitive data type of this type is Date.

Specified by:
isTime in interface SchemaSimpleType
Returns:
true, if the primitive data type of this type is Date, false otherwise

setFractionDigits

public void setFractionDigits(int fractionDigits)

setMaxExclValue

public void setMaxExclValue(double maxExclValue)

setMaxInclValue

public void setMaxInclValue(double maxInclValue)

setMaxLength

public void setMaxLength(long maxLength)

setMinExclValue

public void setMinExclValue(double minExclValue)

setMinInclValue

public void setMinInclValue(double minInclValue)

setMinLength

public void setMinLength(long minLength)

setRegularExpression

public void setRegularExpression(java.lang.String regularExpression)

setTotalDigits

public void setTotalDigits(int totalDigits)

setWhitespace

public void setWhitespace(short whitespace)

validate

public void validate(SimpleType source,
                     java.lang.String value)
              throws ValidationException
Validates a string against the defined facets in the XML Schema.

Specified by:
validate in interface SchemaSimpleType
Throws:
ValidationException - thrown if the submitted string is not valid