com.aptana.sax
Class Schema

java.lang.Object
  extended by com.aptana.sax.Schema

public class Schema
extends java.lang.Object

Author:
Kevin Lindsey

Constructor Summary
Schema(java.lang.Object handler)
          Create a new instance of SchemaGraph
 
Method Summary
 void buildErrorMessage(SourceWriter writer, java.lang.String localName, org.xml.sax.Attributes attributes)
          buildErrorMessage
 SchemaElement createElement(java.lang.String name)
          Create a new SchemaElement for the given name.
 SchemaElement createElement(java.lang.String name, boolean unique)
          createElement
 void exitElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qualifiedName)
          Exit the current element
 java.lang.Class getHandlerClass()
          Get the Class of the handler object used for element transition event handling
 SchemaElement getRootElement()
          Get the SchemaElement that serves as the root of this schema state machine
 boolean hasElement(java.lang.String name)
          Determine if the given element name exists in this schema
 void moveTo(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qualifiedName, org.xml.sax.Attributes attributes)
          Try to move to a new element along a valid transition
 void reset()
          Prepare this schema for a new parse
 void setRootElement(java.lang.String name)
          Set the root element of this schema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Schema

public Schema(java.lang.Object handler)
Create a new instance of SchemaGraph

Parameters:
handler - The handler to be used for event callbacks
Method Detail

getHandlerClass

public java.lang.Class getHandlerClass()
Get the Class of the handler object used for element transition event handling

Returns:
The handler object's class

getRootElement

public SchemaElement getRootElement()
Get the SchemaElement that serves as the root of this schema state machine

Returns:
This schema's root element (like #document)

hasElement

public boolean hasElement(java.lang.String name)
Determine if the given element name exists in this schema

Parameters:
name - The name of the element to test
Returns:
Returns true if the given element name exists in this schema

setRootElement

public void setRootElement(java.lang.String name)
Set the root element of this schema. If the element does not exist, it will be added automatically to this schema

Parameters:
name - The name of the element to set as the root element

createElement

public SchemaElement createElement(java.lang.String name)
Create a new SchemaElement for the given name. If the element name has already been created, then return that previous instance

Parameters:
name - The name of the element to create
Returns:
Returns the SchemaElement for the given name

createElement

public SchemaElement createElement(java.lang.String name,
                                   boolean unique)
createElement

Parameters:
name - The name of the element to create
unique - If true then only one element will ever be created created for a given name
Returns:
Returns the SchemaElement for the given name

moveTo

public void moveTo(java.lang.String namespaceURI,
                   java.lang.String localName,
                   java.lang.String qualifiedName,
                   org.xml.sax.Attributes attributes)
            throws InvalidTransitionException,
                   java.lang.IllegalArgumentException,
                   java.lang.IllegalAccessException,
                   java.lang.reflect.InvocationTargetException,
                   org.xml.sax.SAXException
Try to move to a new element along a valid transition

Parameters:
namespaceURI -
localName -
qualifiedName -
attributes -
Throws:
InvalidTransitionException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
org.xml.sax.SAXException

buildErrorMessage

public void buildErrorMessage(SourceWriter writer,
                              java.lang.String localName,
                              org.xml.sax.Attributes attributes)
buildErrorMessage

Parameters:
writer -
localName -
attributes -

exitElement

public void exitElement(java.lang.String namespaceURI,
                        java.lang.String localName,
                        java.lang.String qualifiedName)
                 throws java.lang.IllegalArgumentException,
                        java.lang.IllegalAccessException,
                        java.lang.reflect.InvocationTargetException
Exit the current element

Parameters:
namespaceURI -
localName -
qualifiedName -
Throws:
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
java.lang.IllegalArgumentException

reset

public void reset()
Prepare this schema for a new parse