| java.lang.Object org.mandarax.zkb.framework.AbstractAdapter
All known Subclasses: org.mandarax.zkb.framework.Adapter4CustomClauseSets, org.mandarax.zkb.framework.Adapter4Rules, org.mandarax.zkb.framework.Adapter4Prerequisites, org.mandarax.zkb.framework.Adapter4Facts, org.mandarax.zkb.framework.Adapter4VariableTerms, org.mandarax.zkb.framework.Adapter4SQLClauseSets, org.mandarax.zkb.framework.Adapter4DerivationEventListeners, org.mandarax.zkb.framework.Adapter4TestCases_2_0, org.mandarax.zkb.framework.Adapter4KnowledgeBases, org.mandarax.zkb.framework.Adapter4Queries_1_1, org.mandarax.zkb.framework.Adapter4ConstantTerms, org.mandarax.zkb.framework.Adapter4Queries, org.mandarax.zkb.framework.Adapter4Rules_1_1, org.mandarax.zkb.framework.Adapter4Predicates, org.mandarax.zkb.framework.Adapter4Prerequisites_1_1, org.mandarax.zkb.framework.Adapter4Functions, org.mandarax.zkb.framework.Adapter4ComplexTerms, org.mandarax.zkb.framework.Adapter4KnowledgeBases_2_0, org.mandarax.zkb.framework.Adapter4Comparators, org.mandarax.zkb.framework.Adapter4KnowledgeBases_1_1, org.mandarax.zkb.framework.Adapter4Facts_1_1,
Method Summary | |
protected void | assignURI(Element e, ObjectPersistencyService ops, Object obj) Assign an object id to an object and add the respective attribute to the element.
Use an existing id if possible. | 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 Class | class4Name(String name) Get the class for a name, throw an ZKB exception if class cannot be loaded. | protected void | exportChildren(Object[] objs, Element parent, String kindOfObject, GenericDriver driver, ObjectPersistencyService ops) 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, ObjectPersistencyService ops) Utility method to export a collection of objects and add the elements to the parent. | protected Element | exportObject(Object obj, String kindOfObject, GenericDriver driver, ObjectPersistencyService ops) Utility method that locates the appropriate driver and exports an object using this driver. | protected void | exportProperties(Element parent, PropertiesSupport ps) Export the properties of an object implementing PropertiesSupport. | protected String | getClauseSetType(ClauseSet cs) Get the type of clause set, e.g. | protected Object | getObjectByURI(Element e, ObjectPersistencyService ops) Get the object with the uri found in the tag. | protected Object | importChild(Element parent, String name, GenericDriver driver, ObjectPersistencyService ops, 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, ObjectPersistencyService ops, 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 | importProperties(Element parent, PropertiesSupport ps) Import the properties of an object implementing PropertiesSupport. | abstract public void | printDTD(StringBuffer out) Print the DTD associated with this adapter on a string buffer.
Parameters: out - the buffer to print on. | protected void | setTypeAttribute(Element e, Term t) Set the type attribute. |
assignURI | protected void assignURI(Element e, ObjectPersistencyService ops, Object obj)(Code) | | Assign an object id to an object and add the respective attribute to the element.
Use an existing id if possible.
Parameters: e - an element Parameters: ops - an object persistency service Parameters: obj - the object |
check | protected void check(Object obj, Class clazz) throws ZKBException(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 |
class4Name | protected Class class4Name(String name) throws ZKBException(Code) | | Get the class for a name, throw an ZKB exception if class cannot be loaded.
Parameters: name - the name of the class a class |
exportChildren | protected void exportChildren(Object[] objs, Element parent, String kindOfObject, GenericDriver driver, ObjectPersistencyService ops) throws ZKBException(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: ops - the object persistency service exception: a - ZKBException is thrown if export fails |
exportChildren | protected void exportChildren(Collection objs, Element parent, String kindOfObject, GenericDriver driver, ObjectPersistencyService ops) throws ZKBException(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: ops - the object persistency service exception: an - ZKBException is thrown if export fails |
exportObject | protected Element exportObject(Object obj, String kindOfObject, GenericDriver driver, ObjectPersistencyService ops) throws ZKBException(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: ops - the object persistency service an element exception: a - ZKBException is thrown if export fails |
exportProperties | protected void exportProperties(Element parent, PropertiesSupport ps)(Code) | | Export the properties of an object implementing PropertiesSupport.
Parameters: parent - the parent element Parameters: ps - the object implementing PropertiesSupport |
getClauseSetType | protected String getClauseSetType(ClauseSet cs)(Code) | | Get the type of clause set, e.g. GenericDriver.FACT or GenericDriver.RULE.
Parameters: cs - a clause set a string |
getObjectByURI | protected Object getObjectByURI(Element e, ObjectPersistencyService ops)(Code) | | Get the object with the uri found in the tag.
Parameters: e - an element Parameters: ops - the object persistency service an object |
importChild | protected Object importChild(Element parent, String name, GenericDriver driver, ObjectPersistencyService ops, LogicFactory lfactory) throws ZKBException(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: ops - the object persistency service Parameters: lfactory - the logic factory used to create objects an object exception: an - ZKBException is thrown if import fails |
importChildren | protected Object importChildren(Element parent, String name, GenericDriver driver, ObjectPersistencyService ops, LogicFactory lfactory, Class targetType) throws ZKBException(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: ops - the object persistency service 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 - ZKBException is thrown if import fails |
importProperties | protected void importProperties(Element parent, PropertiesSupport ps)(Code) | | Import the properties of an object implementing PropertiesSupport.
Parameters: parent - the parent element Parameters: ps - the object implementing PropertiesSupport |
printDTD | abstract public void printDTD(StringBuffer out)(Code) | | Print the DTD associated with this adapter on a string buffer.
Parameters: out - the buffer to print on. |
setTypeAttribute | protected void setTypeAttribute(Element e, Term t)(Code) | | Set the type attribute.
Parameters: e - an element Parameters: term - a term |
|
|