|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.util.xml.AbstractObjectHandler
org.progeeks.util.xml.BeanObjectHandler
public class BeanObjectHandler
Object handler implementation to deal with converting XML to standard Java Beans.
Field Summary | |
---|---|
static java.lang.String |
CONFIG_IMPORT_PACKAGE
|
Constructor Summary | |
---|---|
BeanObjectHandler()
|
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. |
protected java.lang.Class |
getClass(java.lang.String fullName)
Returns the class for the specified fully qualified class name or null if the class does not exist. |
protected java.lang.Class |
getClass(java.lang.String pkg,
java.lang.String name)
Attempts to lookup a class with the given package and name. |
protected java.lang.Object |
getConstant(java.lang.String name,
java.lang.Class type)
Searches the specified type for a constant denoted by name. |
protected java.lang.Class |
getInnerClass(java.lang.String fullName)
Returns the inner class for the specified fully qualified class name or null if the class does not exist. |
java.util.List |
getPackages()
Returns the current list of packages. |
java.lang.Object |
getProperty(java.lang.Object obj,
java.lang.String field,
ObjectXmlReader reader)
Returns the current value of the specified property in the specified object. |
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 java.lang.Class |
getTagClass(java.lang.String tag)
Searches for a class that matches the specified tag name. |
protected boolean |
ignoreAttribute(java.lang.String name,
ObjectXmlReader reader)
A convenient place for subclasses to override attribute ignore behavior. |
void |
importPackage(java.lang.String packageName)
Adds the specified package name to the list of imports that will be checked when a fully-qualified class name is not found. |
void |
setConfigurationProperty(java.lang.String property,
java.lang.String value)
Sends a configuration property to the handler implementation. |
protected void |
setObjectProperties(java.lang.Object obj,
org.xml.sax.Attributes atts,
ObjectXmlReader reader)
|
void |
setPackages(java.util.List packages)
Sets the list of packages to which this handler will refer when resolving class names. |
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.AbstractObjectHandler |
---|
resolveObject, setContainedText |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CONFIG_IMPORT_PACKAGE
Constructor Detail |
---|
public BeanObjectHandler()
Method Detail |
---|
public void importPackage(java.lang.String packageName)
public void setPackages(java.util.List packages)
public java.util.List getPackages()
protected java.lang.Class getClass(java.lang.String fullName) throws XmlException
XmlException
protected java.lang.Class getInnerClass(java.lang.String fullName)
protected java.lang.Class getClass(java.lang.String pkg, java.lang.String name) throws XmlException
XmlException
protected java.lang.Class getTagClass(java.lang.String tag) throws XmlException
XmlException
protected java.lang.Object getConstant(java.lang.String name, java.lang.Class type)
public boolean canHandle(java.lang.String tag)
canHandle
in interface ObjectHandler
canHandle
in class AbstractObjectHandler
public void setConfigurationProperty(java.lang.String property, java.lang.String value)
setConfigurationProperty
in interface ObjectHandler
setConfigurationProperty
in class AbstractObjectHandler
public void setProperty(java.lang.Object obj, java.lang.String field, java.lang.Object value, ObjectXmlReader reader)
setProperty
in interface ObjectHandler
setProperty
in class AbstractObjectHandler
public void setTextProperty(java.lang.Object obj, java.lang.String field, java.lang.String value, ObjectXmlReader reader)
setTextProperty
in interface ObjectHandler
setTextProperty
in class AbstractObjectHandler
public java.lang.Class getPropertyClass(java.lang.Object obj, java.lang.String field, ObjectXmlReader reader)
getPropertyClass
in interface ObjectHandler
getPropertyClass
in class AbstractObjectHandler
public java.util.Collection getPropertyCollection(java.lang.Object obj, java.lang.String field, ObjectXmlReader reader)
getPropertyCollection
in interface ObjectHandler
getPropertyCollection
in class AbstractObjectHandler
public java.lang.Object getProperty(java.lang.Object obj, java.lang.String field, ObjectXmlReader reader)
getProperty
in interface ObjectHandler
getProperty
in class AbstractObjectHandler
protected boolean ignoreAttribute(java.lang.String name, ObjectXmlReader reader)
protected void setObjectProperties(java.lang.Object obj, org.xml.sax.Attributes atts, ObjectXmlReader reader)
public java.lang.Object createObject(java.lang.String tag, org.xml.sax.Attributes atts, ObjectXmlReader reader)
createObject
in interface ObjectHandler
createObject
in class AbstractObjectHandler
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |