|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xml.sax.helpers.DefaultHandler | +--com.objectwave.configuration.xml.ObjectBuilder
Look for a method of the set'VariableName' style. If the parameter type of the source object does not match the parameter type in the method, an attempt is made to convert tye type to the proper type. This class does not use ANY features from the inherited class (other than the constructor).
Constructor Summary | |
ObjectBuilder()
Constructor for the ObjectBuilder object |
Method Summary | |
void |
associate(java.lang.String key,
java.lang.String fullyQualifiedClassName)
|
void |
connect(java.lang.Object parentObject,
java.lang.String childName,
java.lang.Object childObject)
Connects the child to the parent object |
protected java.lang.Object |
createObject(java.lang.String className,
org.xml.sax.Attributes atts)
|
protected java.lang.reflect.Method |
findMutatorMethod(java.lang.Object source,
java.lang.String methodName)
Find a method called methodName. |
protected java.lang.Object[] |
getParameterValues(java.lang.reflect.Method method,
java.lang.Object parameter)
Assumes that the method takes 1 and only 1 parameter on the provided method. |
java.lang.Object |
getResult()
|
void |
setObjectFormatter(ObjectFormatter value)
Sets the ObjectFormatter attribute of the ObjectBuilder object |
void |
setTagToClassMap(java.util.Map map)
|
protected void |
setValueWithMethod(java.lang.Object source,
java.lang.Object parameter,
java.lang.String methodName)
Set the parameter value on the source object using the method methodName. |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
|
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ObjectBuilder()
Method Detail |
public void setTagToClassMap(java.util.Map map)
public java.lang.Object getResult()
public void associate(java.lang.String key, java.lang.String fullyQualifiedClassName)
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
protected java.lang.Object createObject(java.lang.String className, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException, java.lang.InstantiationException
org.xml.sax.SAXException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.lang.InstantiationException
public void setObjectFormatter(ObjectFormatter value)
value
- The new ObjectFormatter valueprotected void setValueWithMethod(java.lang.Object source, java.lang.Object parameter, java.lang.String methodName) throws NotFoundException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
source
- The object being changed.parameter
- A value to set on source.methodName
- A name of the method that should exist on source.
NotFoundException
- The method specified could not be found.
java.lang.reflect.InvocationTargetException
- Trouble setting the value
java.lang.IllegalAccessException
- No access rights to the method.protected java.lang.Object[] getParameterValues(java.lang.reflect.Method method, java.lang.Object parameter)
method
- A single argument methodparameter
- The original parameter that is to be provided to the
method.
public void connect(java.lang.Object parentObject, java.lang.String childName, java.lang.Object childObject)
parentObject
- - The root object (ex. FruitBasket)childObject
- - The sub object of the root object (ex. Apple)childName
- - The logical name of the childObjectprotected java.lang.reflect.Method findMutatorMethod(java.lang.Object source, java.lang.String methodName) throws NotFoundException
source
- methodName
-
NotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |