org.montsuqi.monsia
Class ParserState

java.lang.Object
  extended by org.montsuqi.monsia.ParserState

abstract class ParserState
extends java.lang.Object

State ofject for interface definition parser(SAX Handler)s.


Field Summary
protected static Logger logger
           
 
Constructor Summary
ParserState(java.lang.String name)
          Constructs a state with given name.
 
Method Summary
(package private) abstract  void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
          Receives notification of the end of an element.
 java.lang.String getName()
          Returns the name of this state.
(package private) abstract  void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs)
          Receives notification of the beginning of an element.
protected  void warnInvalidPropertiesDefinedHere(java.lang.String element)
          A helper method to warn that wrong type of property is being set at the current position.
protected  void warnShouldBeEmpty(java.lang.String element, java.lang.String found)
          A helper method to warn that some element found in an element which should be empty.
protected  void warnShouldFindClosing(java.lang.String element, java.lang.String found)
          A helper method to warn that the parser finds an unexpected element closing tag.
protected  void warnShouldHaveNoAttributes(java.lang.String element)
          A helper method to warn that an element which should have no attributes detects some attributes specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final Logger logger
Constructor Detail

ParserState

ParserState(java.lang.String name)

Constructs a state with given name.

Parameters:
name - name of a parser state.
Method Detail

startElement

abstract void startElement(java.lang.String uri,
                           java.lang.String localName,
                           java.lang.String qName,
                           org.xml.sax.Attributes attrs)

Receives notification of the beginning of an element.

Parameters:
uri - the namespace URI if any.
localName - the element's locale name (name without prefix).
qName - the element's qualified name (name with prefix).
attrs - attributes of the element.

endElement

abstract void endElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName)

Receives notification of the end of an element.

Parameters:
uri - the namespace URI if any.
localName - the element's locale name (name without prefix).
qName - the element's qualified name (name with prefix).

warnShouldFindClosing

protected void warnShouldFindClosing(java.lang.String element,
                                     java.lang.String found)

A helper method to warn that the parser finds an unexpected element closing tag.

Parameters:
element - expected element to close.
found - acutual element name of the closing tag encountered.

warnShouldBeEmpty

protected void warnShouldBeEmpty(java.lang.String element,
                                 java.lang.String found)

A helper method to warn that some element found in an element which should be empty.

Parameters:
element - current element, which should be empty.
found - an element found in element.

warnShouldHaveNoAttributes

protected void warnShouldHaveNoAttributes(java.lang.String element)

A helper method to warn that an element which should have no attributes detects some attributes specified.

Parameters:
element - current element.

warnInvalidPropertiesDefinedHere

protected void warnInvalidPropertiesDefinedHere(java.lang.String element)

A helper method to warn that wrong type of property is being set at the current position.

Parameters:
element - current element.

getName

public java.lang.String getName()

Returns the name of this state.

Returns:
name of this state.