| java.lang.Object org.mandarax.xkb.framework.AbstractXMLAdapter org.mandarax.xkb.framework.CachedXMLAdapter org.mandarax.xkb.framework.XMLAdapter4Objects
XMLAdapter4Objects | public class XMLAdapter4Objects extends CachedXMLAdapter (Code) | | An adapter class for objects. Strings and primitives are just stringified,
dates represented by the time as long, classes by the name, and
beans are handeled via introspection.
Warning: We cannot and do not solve the more general problem of XML object serialization here.
Instead, this is a 80-20 solution that might work fine for simple object models. For more sophisticated
object models, you will need to implement your own object adapter. In particular, we do not handle circular
references.
In the future (once JDK 1.4 is the common platform) we will integrate the new XML serialization mechanism!
author: Jens Dietrich version: 3.4 <7 March 05> since: 1.6 |
_exportObject | protected Element _exportObject(Object obj, GenericDriver driver, Map cache) throws XKBException(Code) | | Export an object, i.e., convert it to an element in the DOM.
Parameters: obj - an object Parameters: driver - the generic driver Parameters: cache - a cache used in order to associate the sameid with various occurences of the same object exception: an - XKBException is thrown if export fails |
_importObject | protected Object _importObject(Element e, GenericDriver driver, Map cache, LogicFactory lfactory) throws XKBException(Code) | | Build an object from an XML element.
Parameters: e - an element Parameters: driver - the generic driver Parameters: cache - a cache used to identify objects that have the same id Parameters: lfactory - the logic factory used to create objects exception: an - XKBException is thrown if export fails |
getKindOfObject | public String getKindOfObject()(Code) | | Get the kind of object the adapter can export/import.
a string |
getTagName | public String getTagName()(Code) | | Get the name of the associated tag (element).
a string |
Fields inherited from org.mandarax.xkb.framework.CachedXMLAdapter | final public static String ID(Code)(Java Doc)
|
Methods inherited from org.mandarax.xkb.framework.CachedXMLAdapter | abstract protected Element _exportObject(Object obj, GenericDriver driver, Map cache) throws XKBException(Code)(Java Doc) abstract protected Object _importObject(Element e, GenericDriver driver, Map cache, LogicFactory lfactory) throws XKBException(Code)(Java Doc) public Element exportObject(Object obj, GenericDriver driver, Map cache) throws XKBException(Code)(Java Doc) public Object importObject(Element e, GenericDriver driver, Map cache, LogicFactory lfactory) throws XKBException(Code)(Java Doc) protected String nextId()(Code)(Java Doc)
|
Methods inherited from org.mandarax.xkb.framework.AbstractXMLAdapter | protected void addProperties(Element e, ClauseSet cs)(Code)(Java Doc) protected void addProperties(Element e, Query q)(Code)(Java Doc) protected void check(Object obj, Class clazz) throws XKBException(Code)(Java Doc) protected void exportChildren(Object[] objs, Element parent, String kindOfObject, GenericDriver driver, Map cache) throws XKBException(Code)(Java Doc) protected void exportChildren(Collection objs, Element parent, String kindOfObject, GenericDriver driver, Map cache) throws XKBException(Code)(Java Doc) protected Element exportObject(Object obj, String kindOfObject, GenericDriver driver, Map cache) throws XKBException(Code)(Java Doc) protected String getFunctionType(Function f)(Code)(Java Doc) protected String getPredicateType(Predicate p)(Code)(Java Doc) protected String getTermType(Term t)(Code)(Java Doc) protected Object importChild(Element parent, String name, GenericDriver driver, Map cache, LogicFactory lfactory) throws XKBException(Code)(Java Doc) protected Object importChildren(Element parent, String name, GenericDriver driver, Map cache, LogicFactory lfactory, Class targetType) throws XKBException(Code)(Java Doc) protected void loadProperties(Element e, ClauseSet cs)(Code)(Java Doc) protected void loadProperties(Element e, Query q)(Code)(Java Doc)
|
|
|