|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Object | +--org.sapia.util.xml.confix.ReflectionFactory
This class instantiates objects based on the name of XML elements, using these names to dynamically find the class of the objects to instantiate.
| Constructor Summary | |
|---|---|
ReflectionFactory(String[] somePackages)
Creates a new ReflectionFactory instance with the arguments passed in. |
|
| Method Summary | |
|---|---|
void |
addPackage(String aPackage)
Adds the package passed in to this factory. |
static String |
firstToUpper(String aString)
Utility to change the first letter of the string passed in to uppercase. |
protected static Object |
invokeMethod(String aMethodPrefix,
String anElementName,
Object aTarget)
Invokes a method on the target object using the method prefix and the element name passed in. |
CreationStatus |
newObjectFor(String aPrefix,
String aNamespaceURI,
String anElementName,
Object aParent)
Creates an object for the element passed in. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ReflectionFactory(String[] somePackages)
somePackages - The package from which to use reflection.| Method Detail |
public static String firstToUpper(String aString)
protected static Object invokeMethod(String aMethodPrefix,
String anElementName,
Object aTarget)
aMethodPrefix - The prefix of the method to call (create, add, ...).anElementName - The element name for which we have to invoke a method.aTarget - The target object on which the method invocation is done.
public void addPackage(String aPackage)
aPackage - The package to add.
public CreationStatus newObjectFor(String aPrefix,
String aNamespaceURI,
String anElementName,
Object aParent)
throws ObjectCreationException
newObjectFor in interface ObjectFactoryIFaPrefix - The namespace prefix of the element.aNamespaceURI - The namespace URI of the element.anElementName - The element name for wich to create an object.aParent - The parent object of the object to create.
ObjectCreationException - If an error occurs creating the object.
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||