Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.java.beans.decoder
Interface ElementHandler  view ElementHandler download ElementHandler.java

All Known Implementing Classes:
AbstractElementHandler, DummyHandler

interface ElementHandler

ElementHandler manages a Context instance and interacts with its parent and child handlers.


Method Summary
 void characters(char[] ch, int start, int length)
          Adds characters from the body of the XML tag to the buffer.
 void end(java.beans.ExceptionListener exceptionListener)
          Post-processes the Context.
 Context getContext()
          Returns the Context instance this handler is working on.
 java.lang.Object getObject(java.lang.String objectId)
           
 ElementHandler getParent()
           
 boolean hasFailed()
          Returns whether this handler has failed.
 java.lang.Class instantiateClass(java.lang.String className)
          Provides the same functionality as Class.forName() but allows the decoder to use a different class loader.
 boolean isSubelementAllowed(java.lang.String subElementName)
          Returns whether a subelement of the given name is allowed.
 void notifyContextFailed()
          Notifies the handler that its Context failed and starts a recursive invocation of the parent handler if it is affected by that failure.
 void notifyStatement(java.beans.ExceptionListener exceptionListener)
          Notifies the handler's Context that its child Context will not return a value back.
 void putObject(java.lang.String objectId, java.lang.Object o)
          Stores the object under the given id.
 void start(org.xml.sax.Attributes attributes, java.beans.ExceptionListener exceptionListener)
          Evaluates the attributes and creates a Context instance.
 

Method Detail

start

public void start(org.xml.sax.Attributes attributes,
                  java.beans.ExceptionListener exceptionListener)
Evaluates the attributes and creates a Context instance. If the creation of the Context instance fails the ElementHandler is marked as failed which may affect the parent handler other.


end

public void end(java.beans.ExceptionListener exceptionListener)
Post-processes the Context.


characters

public void characters(char[] ch,
                       int start,
                       int length)
Adds characters from the body of the XML tag to the buffer.


isSubelementAllowed

public boolean isSubelementAllowed(java.lang.String subElementName)
Returns whether a subelement of the given name is allowed. The rules for evaluating this are derived from the javabeans.dtd which can be found here: Java Persistence Article.


instantiateClass

public java.lang.Class instantiateClass(java.lang.String className)
                                 throws java.lang.ClassNotFoundException
Provides the same functionality as Class.forName() but allows the decoder to use a different class loader.


notifyStatement

public void notifyStatement(java.beans.ExceptionListener exceptionListener)
Notifies the handler's Context that its child Context will not return a value back. Some Context variants need this information to know when a method or a constructor call can be made. This method is called by a child handler.


hasFailed

public boolean hasFailed()
Returns whether this handler has failed. This is used to skip child elements.


getContext

public Context getContext()
Returns the Context instance this handler is working on.


notifyContextFailed

public void notifyContextFailed()
Notifies the handler that its Context failed and starts a recursive invocation of the parent handler if it is affected by that failure. Although the method is a public API member it is only used internally.


putObject

public void putObject(java.lang.String objectId,
                      java.lang.Object o)
Stores the object under the given id. The object is not stored if the id is null.


getObject

public java.lang.Object getObject(java.lang.String objectId)
                           throws AssemblyException

getParent

public ElementHandler getParent()