|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.xolite.utils.ClassObjectFactory
public class ClassObjectFactory
Simple implementation of XmlObjectFactory based on class names.
Using this factory implies that the objects constructed by the factory have public constructor with no parameters.
| Constructor Summary | |
|---|---|
ClassObjectFactory()
|
|
| Method Summary | |
|---|---|
XMLSerializable |
createObject(String namespaceUri,
String localName,
XMLEventParser parser)
Create an object corresponding to the XML element of the given name. |
void |
defineElement(String localName,
Class<?> clazz)
Add the definition of an element without namespace to this factory. |
void |
defineElement(String localName,
String className)
Add the definition of an element without namespace to this factory. |
void |
defineElement(String namespaceUri,
String localName,
Class<?> clazz)
Add the definition of an element to this factory. |
void |
defineElement(String namespaceUri,
String localName,
String className)
Add the definition of an element to this factory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassObjectFactory()
| Method Detail |
|---|
public void defineElement(String localName,
Class<?> clazz)
XMLSerializable interface.
localName - the local name of the element.clazz - the class of the object to be created.
public void defineElement(String localName,
String className)
XMLSerializable interface.
localName - the local name of the element.className - the fully qualified class name of the object to be created.
public void defineElement(String namespaceUri,
String localName,
Class<?> clazz)
XMLSerializable interface.
namespaceUri - the element namespace URIlocalName - the local name of the element.clazz - the class of the object to be created.
public void defineElement(String namespaceUri,
String localName,
String className)
XMLSerializable interface.
namespaceUri - the element namespace URIlocalName - the local name of the element.className - the fully qualified class name of the object to be created.
public XMLSerializable createObject(String namespaceUri,
String localName,
XMLEventParser parser)
throws XMLParseException
createObject in interface XMLObjectFactorynamespaceUri - the namespace URI of the XML element.localName - the local name of the XML element.parser - The current XML event parser, it is only used to have a locator of the current line in case of exception. (you
can pass null if you don't need line reporting).
XMLParseException - if the object is not defined or cannot be instantiated.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||