org.sadun.util.xml.configuration
Class AutoConfigurator

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.sadun.util.xml.configuration.BaseConfigurator
          extended byorg.sadun.util.xml.configuration.AutoConfigurator
All Implemented Interfaces:
Configurator, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public abstract class AutoConfigurator
extends BaseConfigurator

This configurator automatically binds fields to tags in the HTML.

Author:
Cristiano Sadun

Field Summary
 
Fields inherited from class org.sadun.util.xml.configuration.BaseConfigurator
buffer, completed
 
Constructor Summary
AutoConfigurator()
           
 
Method Summary
protected abstract  java.lang.Object doGetConfiguredObject()
           
 void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
          Set completed to true.
 boolean hasFieldBeenSet(java.lang.String fieldName)
           
 boolean hasTagBeenEncountered(java.lang.String tag)
           
 boolean isIgnorableTag(java.lang.String tag)
           
 boolean isMandatory(java.lang.String fieldName)
           
protected  java.lang.reflect.Field set(java.lang.Object obj, java.lang.String tagName)
           
protected  java.lang.reflect.Field set(java.lang.String tagName)
           
 void setIgnore(java.lang.String tag)
           
 void setMandatory(java.lang.String fieldName)
           
 void startDocument()
           
 
Methods inherited from class org.sadun.util.xml.configuration.BaseConfigurator
characters, checkCompleted, getBooleanText, getByteText, getConfiguredObject, getDoubleText, getFloatText, getIntText, getLongText, getShortText, getText, getTextAndResetBuffer, getTextAndResetBuffer, isCompleted, toString
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startElement, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.sadun.util.xml.configuration.Configurator
startElement
 
Methods inherited from interface org.xml.sax.ContentHandler
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping
 

Constructor Detail

AutoConfigurator

public AutoConfigurator()
Method Detail

set

protected java.lang.reflect.Field set(java.lang.Object obj,
                                      java.lang.String tagName)
                               throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

hasFieldBeenSet

public boolean hasFieldBeenSet(java.lang.String fieldName)

hasTagBeenEncountered

public boolean hasTagBeenEncountered(java.lang.String tag)

setMandatory

public void setMandatory(java.lang.String fieldName)

isMandatory

public boolean isMandatory(java.lang.String fieldName)

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Description copied from class: BaseConfigurator
Set completed to true.

Specified by:
endElement in interface Configurator
Overrides:
endElement in class BaseConfigurator
Throws:
org.xml.sax.SAXException

setIgnore

public void setIgnore(java.lang.String tag)

isIgnorableTag

public boolean isIgnorableTag(java.lang.String tag)
Returns:

set

protected java.lang.reflect.Field set(java.lang.String tagName)
                               throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

doGetConfiguredObject

protected abstract java.lang.Object doGetConfiguredObject()
                                                   throws org.xml.sax.SAXException
Specified by:
doGetConfiguredObject in class BaseConfigurator
Throws:
org.xml.sax.SAXException