| java.lang.Object org.mandarax.xkb.framework.AbstractXMLAdapter
All known Subclasses: org.mandarax.xkb.framework.XMLAdapter4Facts, org.mandarax.xkb.framework.CachedXMLAdapter, org.mandarax.xkb.framework.XMLAdapter4MandaraxLibPredicates, org.mandarax.xkb.framework.XMLAdapter4Rules2, org.mandarax.xkb.framework.XMLAdapter4Queries2, org.mandarax.xkb.framework.XMLAdapter4Facts2, org.mandarax.xkb.framework.XMLAdapter4Types, org.mandarax.xkb.framework.XMLAdapter4Rules, org.mandarax.xkb.framework.XMLAdapter4KnowledgeBases, org.mandarax.xkb.framework.XMLAdapter4ComplexTerms, org.mandarax.xkb.framework.XMLAdapter4JPredicates, org.mandarax.xkb.framework.XMLAdapter4Comparators, org.mandarax.xkb.framework.XMLAdapter4SQLFunctions2, org.mandarax.xkb.framework.XMLAdapter4Methods, org.mandarax.xkb.framework.XMLAdapter4KnowledgeBases2, org.mandarax.xkb.framework.XMLAdapter4SQLFunctions, org.mandarax.xkb.framework.XMLAdapter4ConstantTerms, org.mandarax.xkb.framework.XMLAdapter4MandaraxLibFunctions, org.mandarax.xkb.framework.XMLAdapter4Queries, org.mandarax.xkb.framework.XMLAdapter4SQLClauseSets, org.mandarax.xkb.framework.XMLAdapter4SQLClauseSets2, org.mandarax.xkb.framework.XMLAdapter4JFunctions, org.mandarax.xkb.framework.XMLAdapter4DynaBeanFunctions, org.mandarax.xkb.framework.XMLAdapter4VariableTerms, org.mandarax.xkb.framework.XMLAdapter4Prerequisites, org.mandarax.xkb.framework.XMLAdapter4SimplePredicates,
AbstractXMLAdapter | abstract public class AbstractXMLAdapter implements XMLAdapter,LogCategories(Code) | | An abstract class implementing XMLAdapter. Some utility methods are implemented here.
author: Jens Dietrich version: 3.4 <7 March 05> since: 1.6 |
Method Summary | |
protected void | addProperties(Element e, ClauseSet cs) Add additional properties to an element representing a clause set. | protected void | addProperties(Element e, Query q) Add additional properties to an element representing a query. | protected void | check(Object obj, Class clazz) Utility method that checks the type of an object and throws an exception
if the object is not an instance of the respective class. | protected void | exportChildren(Object[] objs, Element parent, String kindOfObject, GenericDriver driver, Map cache) Utility method to export an array of objects and add the elements to the parent. | protected void | exportChildren(Collection objs, Element parent, String kindOfObject, GenericDriver driver, Map cache) Utility method to export a collection of objects and add the elements to the parent. | protected Element | exportObject(Object obj, String kindOfObject, GenericDriver driver, Map cache) Utility method that locates the appropriate driver and exports an object using this driver. | protected String | getFunctionType(Function f) Get the type of the function, e.g. | protected String | getPredicateType(Predicate p) Get the type of the predicate, e.g. | protected String | getTermType(Term t) Get the type of the term, e.g. | protected Object | importChild(Element parent, String name, GenericDriver driver, Map cache, LogicFactory lfactory) Utility method to import a child (the first child) with a certain name (not the tag name but the symbolic name
as defined in GenericDriver) of the given parent element. | protected Object | importChildren(Element parent, String name, GenericDriver driver, Map cache, LogicFactory lfactory, Class targetType) Utility method to import the children with a certain name (not the tag name but the symbolic name
as defined in GenericDriver) of the given parent element. | protected void | loadProperties(Element e, ClauseSet cs) Load the properties into the clause set. | protected void | loadProperties(Element e, Query q) Load the properties into the query. |
addProperties | protected void addProperties(Element e, ClauseSet cs)(Code) | | Add additional properties to an element representing a clause set.
Parameters: e - an element Parameters: cs - a clause set |
addProperties | protected void addProperties(Element e, Query q)(Code) | | Add additional properties to an element representing a query.
Parameters: e - an element Parameters: q - a query |
check | protected void check(Object obj, Class clazz) throws XKBException(Code) | | Utility method that checks the type of an object and throws an exception
if the object is not an instance of the respective class.
Parameters: obj - an object Parameters: clazz - a class |
exportChildren | protected void exportChildren(Object[] objs, Element parent, String kindOfObject, GenericDriver driver, Map cache) throws XKBException(Code) | | Utility method to export an array of objects and add the elements to the parent.
Parameters: objs - the objects Parameters: parent - the parent element Parameters: kindOfObject - the kind of object, usually a constant defined in GenericDriver 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 |
exportChildren | protected void exportChildren(Collection objs, Element parent, String kindOfObject, GenericDriver driver, Map cache) throws XKBException(Code) | | Utility method to export a collection of objects and add the elements to the parent.
Parameters: objs - the objects Parameters: parent - the parent element Parameters: kindOfObject - the kind of object, usually a constant defined in GenericDriver 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 |
exportObject | protected Element exportObject(Object obj, String kindOfObject, GenericDriver driver, Map cache) throws XKBException(Code) | | Utility method that locates the appropriate driver and exports an object using this driver.
Parameters: obj - an object Parameters: kindOfObject - the kind of object, usually a constant defined in GenericDriver Parameters: driver - the generic driver Parameters: cache - a cache used in order to associate the sameid with various occurences of the same object an element exception: an - XKBException is thrown if export fails |
getFunctionType | protected String getFunctionType(Function f)(Code) | | Get the type of the function, e.g. GenericDriver.JFunction or GenericDriver.SQL_FUNCTION.
Parameters: f - a function a string |
getPredicateType | protected String getPredicateType(Predicate p)(Code) | | Get the type of the predicate, e.g. GenericDriver.JPREDICATE or GenericDriver.SQL_PREDICATE.
Parameters: p - a predicate a string |
getTermType | protected String getTermType(Term t)(Code) | | Get the type of the term, e.g. GenericDriver.COMPLEX_TERM or GenericDriver.VARIABLE_TERM.
Parameters: t - a term a string |
importChild | protected Object importChild(Element parent, String name, GenericDriver driver, Map cache, LogicFactory lfactory) throws XKBException(Code) | | Utility method to import a child (the first child) with a certain name (not the tag name but the symbolic name
as defined in GenericDriver) of the given parent element.
Parameters: e - the parent element Parameters: name - the name of the child tag Parameters: driver - the generic driver Parameters: cache - a cache used to identify objects that have an id Parameters: lfactory - the logic factory used to create objects an object exception: an - XKBException is thrown if import fails |
importChildren | protected Object importChildren(Element parent, String name, GenericDriver driver, Map cache, LogicFactory lfactory, Class targetType) throws XKBException(Code) | | Utility method to import the children with a certain name (not the tag name but the symbolic name
as defined in GenericDriver) of the given parent element. The name can be null, in this case all
child elements will be imported. The target type argument specifies the type of the objects
in the array. Note that we return an object , not an array. But this object can be casted to
an array of the target type, e.g. like in
Term[] terms = importChildren(e,null,driver,cache,lfactory,Term.class)
Parameters: e - the parent element Parameters: name - the name of the child tag Parameters: driver - the generic driver Parameters: cache - a cache used to identify objects that have an id Parameters: lfactory - the logic factory used to create objects Parameters: targetType - the expected type of elements in the array an object that can be casted to an array of elements of the target type exception: an - XKBException is thrown if import fails |
loadProperties | protected void loadProperties(Element e, ClauseSet cs)(Code) | | Load the properties into the clause set.
Parameters: e - an element (the super element of the properties element) Parameters: cs - a clause set |
loadProperties | protected void loadProperties(Element e, Query q)(Code) | | Load the properties into the query.
Parameters: e - an element (the super element of the properties element) Parameters: q - a query |
|
|