Package jadex.rules.state.io.xml
Class OAVObjectReaderHandler
- java.lang.Object
-
- jadex.rules.state.io.xml.OAVObjectReaderHandler
-
- All Implemented Interfaces:
IBulkObjectLinker,IObjectLinker,IObjectReaderHandler
public class OAVObjectReaderHandler extends java.lang.Object implements IObjectReaderHandler
Handler for reading XML into OAV objects.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONTEXT_STATEKey of the state in the user context map.
-
Constructor Summary
Constructors Constructor Description OAVObjectReaderHandler()Create a new handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbulkLinkObjects(java.lang.Object parent, java.util.List children, AReadContext context)Bulk link an object to its parent.java.lang.ObjectconvertContentObject(java.lang.String object, QName tag, AReadContext context)Convert an object to another type of object.java.lang.ObjectcreateObject(java.lang.Object type, boolean root, AReadContext context, java.util.Map rawattributes)Create an object for the current tag.java.lang.ObjectgetObjectType(java.lang.Object object, AReadContext context)Get the object typeIPostProcessor[]getPostProcessors(java.lang.Object object, java.lang.Object typeinfo)Get the post-processor.TypeInfogetTypeInfo(java.lang.Object object, QName[] fullpath, AReadContext context)Get the most specific mapping info.voidhandleAttributeValue(java.lang.Object object, QName xmlattrname, java.util.List attrpath, java.lang.String attrval, java.lang.Object attrinfo, AReadContext context)Handle the attribute of an object.protected booleaninternalLinkObjects(java.lang.String attrname, java.lang.Object elem, java.lang.Object parent, IOAVState state)Internal method for linking objects.voidlinkObject(java.lang.Object elem, java.lang.Object parent, java.lang.Object linkinfo, QName[] pathname, AReadContext context)Link an object to its parent.protected voidsetAttributeValue(IOAVState state, java.lang.Object object, OAVAttributeType attrtype, java.lang.Object elem)Set/add an attribute value.
-
-
-
Field Detail
-
CONTEXT_STATE
public static final java.lang.String CONTEXT_STATE
Key of the state in the user context map.- See Also:
- Constant Field Values
-
-
Method Detail
-
getTypeInfo
public TypeInfo getTypeInfo(java.lang.Object object, QName[] fullpath, AReadContext context)
Get the most specific mapping info.- Specified by:
getTypeInfoin interfaceIObjectReaderHandler- Parameters:
tag- The tag.fullpath- The full path.- Returns:
- The most specific mapping info.
-
createObject
public java.lang.Object createObject(java.lang.Object type, boolean root, AReadContext context, java.util.Map rawattributes) throws java.lang.ExceptionCreate an object for the current tag.- Specified by:
createObjectin interfaceIObjectReaderHandler- Parameters:
type- The object type to create.root- Flag, if object should be root object.context- The context.- Returns:
- The created object (or null for none).
- Throws:
java.lang.Exception
-
getObjectType
public java.lang.Object getObjectType(java.lang.Object object, AReadContext context)Get the object type- Parameters:
object- The object.- Returns:
- The object type.
-
convertContentObject
public java.lang.Object convertContentObject(java.lang.String object, QName tag, AReadContext context) throws java.lang.ExceptionConvert an object to another type of object.- Specified by:
convertContentObjectin interfaceIObjectReaderHandler- Throws:
java.lang.Exception
-
handleAttributeValue
public void handleAttributeValue(java.lang.Object object, QName xmlattrname, java.util.List attrpath, java.lang.String attrval, java.lang.Object attrinfo, AReadContext context) throws java.lang.ExceptionHandle the attribute of an object.- Specified by:
handleAttributeValuein interfaceIObjectReaderHandler- Parameters:
object- The object.attrname- The attribute name.attrval- The attribute value.attrinfo- The attribute info.context- The context.- Throws:
java.lang.Exception
-
linkObject
public void linkObject(java.lang.Object elem, java.lang.Object parent, java.lang.Object linkinfo, QName[] pathname, AReadContext context) throws java.lang.ExceptionLink an object to its parent.- Specified by:
linkObjectin interfaceIObjectLinker- Parameters:
object- The object.parent- The parent object.linkinfo- The link info.tagname- The current tagname (for name guessing).context- The context.- Throws:
java.lang.Exception
-
bulkLinkObjects
public void bulkLinkObjects(java.lang.Object parent, java.util.List children, AReadContext context) throws java.lang.ExceptionBulk link an object to its parent.- Specified by:
bulkLinkObjectsin interfaceIBulkObjectLinker- Parameters:
parent- The parent object.children- The children objects (link datas).context- The context.classloader- The classloader.rootobject- The root object.- Throws:
java.lang.Exception
-
internalLinkObjects
protected boolean internalLinkObjects(java.lang.String attrname, java.lang.Object elem, java.lang.Object parent, IOAVState state)Internal method for linking objects.
-
setAttributeValue
protected void setAttributeValue(IOAVState state, java.lang.Object object, OAVAttributeType attrtype, java.lang.Object elem)
Set/add an attribute value.
-
getPostProcessors
public IPostProcessor[] getPostProcessors(java.lang.Object object, java.lang.Object typeinfo)
Get the post-processor.- Specified by:
getPostProcessorsin interfaceIObjectReaderHandler- Returns:
- The post-processor
-
-