org.oddjob.arooa.handlers
Class MappedPropertyHandler

java.lang.Object
  extended byorg.oddjob.arooa.ArooaHandler
      extended byorg.oddjob.arooa.handlers.MappedPropertyHandler

public class MappedPropertyHandler
extends ArooaHandler

The handler for an setXyz(String name, SomeType value) methods.

If MyJob has a setXyz(String name, String value) method then for this xml:

 <myjob>
   <xyz>
     <string name="fred" value="stuff"/>
   </xyz>
 </myjob>
 
This handler is called on the string tag and is responsible for creating the string value and processing it's attributes. It relies on an ELEMENT_NAME of xyz in the context to set the correct method on the parent myjob wrapper.

See Also:
ArooaHandler
Author:
Rob Gordon

Constructor Summary
MappedPropertyHandler()
           
 
Method Summary
 ArooaHandler onStartChild(java.lang.String uri, java.lang.String tag, java.lang.String qname, org.xml.sax.Attributes attrs, ArooaContext context)
          Handle a child tag.
 void onStartElement(java.lang.String uri, java.lang.String tag, java.lang.String qname, org.xml.sax.Attributes attrs, ArooaContext context)
          Handles the start of an element.
 
Methods inherited from class org.oddjob.arooa.ArooaHandler
characters, checkNamespace, onEndChild, onEndElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappedPropertyHandler

public MappedPropertyHandler()
Method Detail

onStartElement

public void onStartElement(java.lang.String uri,
                           java.lang.String tag,
                           java.lang.String qname,
                           org.xml.sax.Attributes attrs,
                           ArooaContext context)
                    throws org.xml.sax.SAXParseException
Handles the start of an element.

Overrides:
onStartElement in class ArooaHandler
Parameters:
uri - the namespace URI for the tag
tag - The name of the element being started. Will not be null.
qname - The qualified name of the element.
attrs - Attributes of the element being started. Will not be null.
context - The context that this element is in.
Throws:
org.xml.sax.SAXParseException - if this method is not overridden, or in case of error in an overridden version

onStartChild

public ArooaHandler onStartChild(java.lang.String uri,
                                 java.lang.String tag,
                                 java.lang.String qname,
                                 org.xml.sax.Attributes attrs,
                                 ArooaContext context)
                          throws org.xml.sax.SAXParseException
Handle a child tag.

Overrides:
onStartChild in class ArooaHandler
Parameters:
uri - The namespace uri.
qname - The element qualified name.
attrs - The attributes of the element.
context - The current context.
tag - The name of the element being started. Will not be null.
Returns:
The handler that handles this subelement.
Throws:
org.xml.sax.SAXParseException - if the qualified name is not "project".