org.merlotxml.util.xml.xerces
Class SchemaGrammarSimpleTypeImpl

java.lang.Object
  extended byorg.merlotxml.util.xml.xerces.SchemaGrammarSimpleTypeImpl
All Implemented Interfaces:
GrammarSimpleType

public class SchemaGrammarSimpleTypeImpl
extends java.lang.Object
implements GrammarSimpleType

An implementation of GrammarSimpleType for Schemas.

Author:
everth

Field Summary
protected  int _debugLevel
          Utility to minimise the output during debugging.
 
Constructor Summary
SchemaGrammarSimpleTypeImpl(SchemaGrammarComplexTypeImpl complexType, org.apache.xerces.xs.XSAttributeUse attributeUse)
          Constructor for an attribute.
SchemaGrammarSimpleTypeImpl(SchemaGrammarComplexTypeImpl complexType, org.apache.xerces.xs.XSElementDeclaration elementDeclaration)
          Constructor for the simple content of an element.
 
Method Summary
protected  void debug(int level, java.lang.String message)
           
 int getDefaultType()
          Gets the defaultType attribute of the GrammarSimpleType object
 java.lang.String getDefaultValue()
          Gets the defaultValue attribute of the GrammarSimpleType object
 java.lang.String[] getEnumeration()
          Gets the allowed values for this simple type.
 GrammarComplexType getGrammarComplexType()
          Gets the parent complex type.
 boolean getIsRequired()
          Gets whether this simple type must have a value.
 boolean getIsValid(FieldNode valueNode)
          Validates the proposed content.
 int getMaxLength()
           
 int getMinLength()
           
 java.lang.String getName()
          Gets the name attribute of the GrammarSimpleType object
 java.lang.String getPrimitiveType()
          Gets the primitiveType attribute of the GrammarSimpleType object.
 int getType()
          Gets the type attribute of the GrammarSimpleType object
 java.lang.String getValidationMessage(FieldNode valueNode)
          Validates the proposed content, and returns an error message, if any.
 org.apache.xerces.impl.dv.XSSimpleType getXSSimpleType()
           
 void setValue(FieldNode fieldNode, java.lang.String value)
          To be called so that the grammar can keep track of IDs or Keys and ensure that they remain unique.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_debugLevel

protected int _debugLevel
Utility to minimise the output during debugging.

Constructor Detail

SchemaGrammarSimpleTypeImpl

public SchemaGrammarSimpleTypeImpl(SchemaGrammarComplexTypeImpl complexType,
                                   org.apache.xerces.xs.XSAttributeUse attributeUse)
Constructor for an attribute.


SchemaGrammarSimpleTypeImpl

public SchemaGrammarSimpleTypeImpl(SchemaGrammarComplexTypeImpl complexType,
                                   org.apache.xerces.xs.XSElementDeclaration elementDeclaration)
Constructor for the simple content of an element.

Method Detail

getDefaultType

public int getDefaultType()
Description copied from interface: GrammarSimpleType
Gets the defaultType attribute of the GrammarSimpleType object

Specified by:
getDefaultType in interface GrammarSimpleType
Returns:
The defaultType value

getDefaultValue

public java.lang.String getDefaultValue()
Description copied from interface: GrammarSimpleType
Gets the defaultValue attribute of the GrammarSimpleType object

Specified by:
getDefaultValue in interface GrammarSimpleType
Returns:
The defaultValue value

getEnumeration

public java.lang.String[] getEnumeration()
Description copied from interface: GrammarSimpleType
Gets the allowed values for this simple type.

Specified by:
getEnumeration in interface GrammarSimpleType
Returns:
The enumeration value

getIsRequired

public boolean getIsRequired()
Description copied from interface: GrammarSimpleType
Gets whether this simple type must have a value.

XML Schema:

Specified by:
getIsRequired in interface GrammarSimpleType

getIsValid

public boolean getIsValid(FieldNode valueNode)
Description copied from interface: GrammarSimpleType
Validates the proposed content.

Specified by:
getIsValid in interface GrammarSimpleType
Parameters:
valueNode - The Attr or Text that contains the value.
Returns:
The isValid value

getName

public java.lang.String getName()
Description copied from interface: GrammarSimpleType
Gets the name attribute of the GrammarSimpleType object

Specified by:
getName in interface GrammarSimpleType
Returns:
The name value

getGrammarComplexType

public GrammarComplexType getGrammarComplexType()
Description copied from interface: GrammarSimpleType
Gets the parent complex type.

Specified by:
getGrammarComplexType in interface GrammarSimpleType

getPrimitiveType

public java.lang.String getPrimitiveType()
Description copied from interface: GrammarSimpleType
Gets the primitiveType attribute of the GrammarSimpleType object. This is when a simple type has been derived from another.

Specified by:
getPrimitiveType in interface GrammarSimpleType
Returns:
The primitiveType value

getType

public int getType()
Description copied from interface: GrammarSimpleType
Gets the type attribute of the GrammarSimpleType object

Specified by:
getType in interface GrammarSimpleType
Returns:
The type value

getValidationMessage

public java.lang.String getValidationMessage(FieldNode valueNode)
Description copied from interface: GrammarSimpleType
Validates the proposed content, and returns an error message, if any.

Specified by:
getValidationMessage in interface GrammarSimpleType
Returns:
The validationMessage value

getXSSimpleType

public org.apache.xerces.impl.dv.XSSimpleType getXSSimpleType()

setValue

public void setValue(FieldNode fieldNode,
                     java.lang.String value)
Description copied from interface: GrammarSimpleType
To be called so that the grammar can keep track of IDs or Keys and ensure that they remain unique.

This should later be replaced by something that listens to events for changes in the document and updates itself.

Specified by:
setValue in interface GrammarSimpleType

debug

protected void debug(int level,
                     java.lang.String message)

getMinLength

public int getMinLength()

getMaxLength

public int getMaxLength()