org.merlotxml.util.xml
Interface GrammarSimpleType

All Known Implementing Classes:
DTDGrammarSimpleTypeImpl, SchemaGrammarSimpleTypeImpl

public interface GrammarSimpleType

Represents either an attribute or the simple content of an element.

Author:
Evert Hoff

Method Summary
 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.
 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.
 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.
 

Method Detail

getName

public java.lang.String getName()
Gets the name attribute of the GrammarSimpleType object

Returns:
The name value

getGrammarComplexType

public GrammarComplexType getGrammarComplexType()
Gets the parent complex type.


getType

public int getType()
Gets the type attribute of the GrammarSimpleType object

Returns:
The type value

getDefaultType

public int getDefaultType()
Gets the defaultType attribute of the GrammarSimpleType object

Returns:
The defaultType value

getEnumeration

public java.lang.String[] getEnumeration()
Gets the allowed values for this simple type.

Returns:
The enumeration value

getDefaultValue

public java.lang.String getDefaultValue()
Gets the defaultValue attribute of the GrammarSimpleType object

Returns:
The defaultValue value

getIsRequired

public boolean getIsRequired()
Gets whether this simple type must have a value.

XML Schema:


getPrimitiveType

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

Returns:
The primitiveType value

getIsValid

public boolean getIsValid(FieldNode valueNode)
Validates the proposed content.

Parameters:
valueNode - The Attr or Text that contains the value.
Returns:
The isValid value

getValidationMessage

public java.lang.String getValidationMessage(FieldNode valueNode)
Validates the proposed content, and returns an error message, if any.

Returns:
The validationMessage value

setValue

public 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.

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