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.String
CONTEXT_STATE
Key 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 void
bulkLinkObjects(java.lang.Object parent, java.util.List children, AReadContext context)
Bulk link an object to its parent.java.lang.Object
convertContentObject(java.lang.String object, QName tag, AReadContext context)
Convert an object to another type of object.java.lang.Object
createObject(java.lang.Object type, boolean root, AReadContext context, java.util.Map rawattributes)
Create an object for the current tag.java.lang.Object
getObjectType(java.lang.Object object, AReadContext context)
Get the object typeIPostProcessor[]
getPostProcessors(java.lang.Object object, java.lang.Object typeinfo)
Get the post-processor.TypeInfo
getTypeInfo(java.lang.Object object, QName[] fullpath, AReadContext context)
Get the most specific mapping info.void
handleAttributeValue(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 boolean
internalLinkObjects(java.lang.String attrname, java.lang.Object elem, java.lang.Object parent, IOAVState state)
Internal method for linking objects.void
linkObject(java.lang.Object elem, java.lang.Object parent, java.lang.Object linkinfo, QName[] pathname, AReadContext context)
Link an object to its parent.protected void
setAttributeValue(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:
getTypeInfo
in 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.Exception
Create an object for the current tag.- Specified by:
createObject
in 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.Exception
Convert an object to another type of object.- Specified by:
convertContentObject
in 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.Exception
Handle the attribute of an object.- Specified by:
handleAttributeValue
in 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.Exception
Link an object to its parent.- Specified by:
linkObject
in 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.Exception
Bulk link an object to its parent.- Specified by:
bulkLinkObjects
in 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:
getPostProcessors
in interfaceIObjectReaderHandler
- Returns:
- The post-processor
-
-