org.progeeks.util.xml
Class ActionObjectHandler

java.lang.Object
  extended by org.progeeks.util.xml.AbstractObjectHandler
      extended by org.progeeks.util.xml.BeanObjectHandler
          extended by org.progeeks.util.xml.ActionObjectHandler
All Implemented Interfaces:
ObjectHandler

public class ActionObjectHandler
extends BeanObjectHandler

ObjectHandler implementation that can set values on Action objects. This handler will only attempt to handle objects that implement the Action interface.

Version:
$Revision: 1.5 $
Author:
Paul Speed

Field Summary
 
Fields inherited from class org.progeeks.util.xml.BeanObjectHandler
CONFIG_IMPORT_PACKAGE
 
Constructor Summary
ActionObjectHandler()
           
 
Method Summary
 boolean canHandle(java.lang.String tag)
          Returns true if this handler applies to the specified object tag.
 java.lang.Object createObject(java.lang.String tag, org.xml.sax.Attributes atts, ObjectXmlReader reader)
          Creates and returns an object based on the specified parameters.
 java.lang.Class getPropertyClass(java.lang.Object obj, java.lang.String field, ObjectXmlReader reader)
          Returns the base type for the specified field.
 java.util.Collection getPropertyCollection(java.lang.Object obj, java.lang.String field, ObjectXmlReader reader)
          Returns the a collection for the specified field that can be used to accumulate multiple object values.
protected  void setActionProperty(javax.swing.Action a, java.lang.String field, java.lang.Object value)
           
 void setProperty(java.lang.Object obj, java.lang.String field, java.lang.Object value, ObjectXmlReader reader)
          Sets a property on the specified object.
 void setTextProperty(java.lang.Object obj, java.lang.String field, java.lang.String value, ObjectXmlReader reader)
          Sets a text-value property on the specified object.
 
Methods inherited from class org.progeeks.util.xml.BeanObjectHandler
getClass, getClass, getConstant, getInnerClass, getPackages, getProperty, getTagClass, ignoreAttribute, importPackage, setConfigurationProperty, setObjectProperties, setPackages
 
Methods inherited from class org.progeeks.util.xml.AbstractObjectHandler
resolveObject, setContainedText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionObjectHandler

public ActionObjectHandler()
Method Detail

canHandle

public boolean canHandle(java.lang.String tag)
Returns true if this handler applies to the specified object tag.

Specified by:
canHandle in interface ObjectHandler
Overrides:
canHandle in class BeanObjectHandler

setActionProperty

protected void setActionProperty(javax.swing.Action a,
                                 java.lang.String field,
                                 java.lang.Object value)

setProperty

public void setProperty(java.lang.Object obj,
                        java.lang.String field,
                        java.lang.Object value,
                        ObjectXmlReader reader)
Sets a property on the specified object.

Specified by:
setProperty in interface ObjectHandler
Overrides:
setProperty in class BeanObjectHandler

setTextProperty

public void setTextProperty(java.lang.Object obj,
                            java.lang.String field,
                            java.lang.String value,
                            ObjectXmlReader reader)
Sets a text-value property on the specified object. The handler may do some internal conversions to translate into an appropriate type.

Specified by:
setTextProperty in interface ObjectHandler
Overrides:
setTextProperty in class BeanObjectHandler

getPropertyClass

public java.lang.Class getPropertyClass(java.lang.Object obj,
                                        java.lang.String field,
                                        ObjectXmlReader reader)
Returns the base type for the specified field. This is used to determine whether or not to accumulate field values in a collection.

Specified by:
getPropertyClass in interface ObjectHandler
Overrides:
getPropertyClass in class BeanObjectHandler

getPropertyCollection

public java.util.Collection getPropertyCollection(java.lang.Object obj,
                                                  java.lang.String field,
                                                  ObjectXmlReader reader)
Returns the a collection for the specified field that can be used to accumulate multiple object values. This is used when the XML field declaration specifies the progressive attribute.

Specified by:
getPropertyCollection in interface ObjectHandler
Overrides:
getPropertyCollection in class BeanObjectHandler

createObject

public java.lang.Object createObject(java.lang.String tag,
                                     org.xml.sax.Attributes atts,
                                     ObjectXmlReader reader)
Creates and returns an object based on the specified parameters.

Specified by:
createObject in interface ObjectHandler
Overrides:
createObject in class BeanObjectHandler


Copyright © 2002-2003 Paul Speed. All Rights Reserved.