Package jadex.bpmn.model.io
Class SBpmnModelReader
- java.lang.Object
-
- jadex.bpmn.model.io.SBpmnModelReader
-
public class SBpmnModelReader extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Map<java.lang.String,java.lang.String>
ACT_TYPE_MAPPING
Activity type mapping.static java.lang.String
ALT_BOUNDS_KEY
Key for alternative visual object bounds.static java.lang.String
BOUNDS_KEY
Key for visual object bounds.static java.lang.String
INTERNAL_PARAMETERS_KEY
Key for visual internalized parameters.static java.util.Map<java.lang.String,java.lang.String>
TAG_ALIASES
Tag aliases.static java.lang.String
WAYPOINTS_KEY
Key for alternative visual object bounds.
-
Constructor Summary
Constructors Constructor Description SBpmnModelReader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static void
connectActivityEdges(MActivity act, java.util.Map<java.lang.String,java.lang.Object> buffer, java.util.Map<java.lang.String,MIdElement> emap)
Connects activity edges.protected static void
handleElement(MBpmnModel model, java.util.Map<java.lang.String,MIdElement> emap, java.util.Map<java.lang.String,MLane> lanemap, java.util.Map<java.lang.String,java.lang.String> laneparents, XmlTag tag, java.util.LinkedList<XmlTag> tagstack, java.util.Map<java.lang.String,java.lang.String> attrs, java.lang.String content, java.util.Map<java.lang.String,java.lang.Object> buffer, java.util.List<java.lang.Runnable> sempostprocesstasks, IBpmnVisualModelReader vreader)
Handles XML elements.protected static void
handleJadexElement(MBpmnModel model, XmlTag tag, java.util.LinkedList<XmlTag> tagstack, java.util.Map<java.lang.String,java.lang.String> attrs, java.lang.String content, java.util.Map<java.lang.String,java.lang.Object> buffer, java.util.Map<java.lang.String,MIdElement> emap)
Handles a Jadex model extension.protected static void
handlePool(MBpmnModel model, java.util.Map<java.lang.String,java.lang.String> attrs, java.util.Map<java.lang.String,MIdElement> emap, java.util.Map<java.lang.String,java.lang.Object> buffer)
Handles a pool.protected static void
handleSemanticElement(MBpmnModel model, java.util.Map<java.lang.String,MIdElement> emap, java.util.Map<java.lang.String,MLane> lanemap, java.util.Map<java.lang.String,java.lang.String> laneparents, XmlTag tag, java.util.LinkedList<XmlTag> tagstack, java.util.Map<java.lang.String,java.lang.String> attrs, java.lang.String content, java.util.Map<java.lang.String,java.lang.Object> buffer, java.util.List<java.lang.Runnable> postprocesstasks)
Handles a semantic section.protected static void
handleVisualElement(IBpmnVisualModelReader vreader, XmlTag tag, java.util.Map<java.lang.String,java.lang.String> attrs, java.lang.String content, java.util.Map<java.lang.String,java.lang.String> laneparents, java.util.Map<java.lang.String,MIdElement> emap, java.util.Map<java.lang.String,java.lang.Object> buffer)
Handles a visual element.protected static void
insertActivity(MActivity act, java.util.Map<java.lang.String,java.lang.Object> buffer, java.util.Map<java.lang.String,MLane> lanemap, java.util.Map<java.lang.String,MIdElement> emap)
Inserts an activity into the model and maps.protected static boolean
matchLTag(java.lang.String tagname, XmlTag tag)
Matches local part of the tag.protected static UnparsedExpression
parseExp(UnparsedExpression exp, java.lang.String[] imports, java.lang.ClassLoader cl)
Parses the expression if possible.static MBpmnModel
readModel(java.io.File file, IBpmnVisualModelReader vreader)
Loads the model from a file without parsing expressions.static MBpmnModel
readModel(java.io.InputStream in, java.lang.String filename, IBpmnVisualModelReader vreader)
Loads the model from a file without parsing expressions.static MBpmnModel
readModel(java.io.InputStream in, java.lang.String filename, IBpmnVisualModelReader vreader, java.lang.ClassLoader cl)
Loads the model from a file.
-
-
-
Field Detail
-
BOUNDS_KEY
public static final java.lang.String BOUNDS_KEY
Key for visual object bounds.- See Also:
- Constant Field Values
-
ALT_BOUNDS_KEY
public static final java.lang.String ALT_BOUNDS_KEY
Key for alternative visual object bounds.- See Also:
- Constant Field Values
-
WAYPOINTS_KEY
public static final java.lang.String WAYPOINTS_KEY
Key for alternative visual object bounds.- See Also:
- Constant Field Values
-
INTERNAL_PARAMETERS_KEY
public static final java.lang.String INTERNAL_PARAMETERS_KEY
Key for visual internalized parameters.- See Also:
- Constant Field Values
-
TAG_ALIASES
public static final java.util.Map<java.lang.String,java.lang.String> TAG_ALIASES
Tag aliases.
-
ACT_TYPE_MAPPING
public static final java.util.Map<java.lang.String,java.lang.String> ACT_TYPE_MAPPING
Activity type mapping.
-
-
Method Detail
-
readModel
public static final MBpmnModel readModel(java.io.File file, IBpmnVisualModelReader vreader) throws java.lang.Exception
Loads the model from a file without parsing expressions.- Parameters:
file
- The model file.vreader
- The visual model reader, may be null.- Throws:
java.lang.Exception
-
readModel
public static final MBpmnModel readModel(java.io.InputStream in, java.lang.String filename, IBpmnVisualModelReader vreader) throws java.lang.Exception
Loads the model from a file without parsing expressions.- Parameters:
file
- The model file.vreader
- The visual model reader, may be null.- Throws:
java.lang.Exception
-
readModel
public static final MBpmnModel readModel(java.io.InputStream in, java.lang.String filename, IBpmnVisualModelReader vreader, java.lang.ClassLoader cl) throws java.lang.Exception
Loads the model from a file.- Parameters:
file
- The model file.vreader
- The visual model reader, may be null.cl
- The class loader for parsing expressions, may be null.- Throws:
java.lang.Exception
-
handlePool
protected static final void handlePool(MBpmnModel model, java.util.Map<java.lang.String,java.lang.String> attrs, java.util.Map<java.lang.String,MIdElement> emap, java.util.Map<java.lang.String,java.lang.Object> buffer)
Handles a pool.- Parameters:
model
- The model.lastobject
- The last object.tag
- The current tag.tagstack
- The tag stack.attrs
- Current attributes.content
- The tag content.buffer
- Buffered information.
-
handleElement
protected static final void handleElement(MBpmnModel model, java.util.Map<java.lang.String,MIdElement> emap, java.util.Map<java.lang.String,MLane> lanemap, java.util.Map<java.lang.String,java.lang.String> laneparents, XmlTag tag, java.util.LinkedList<XmlTag> tagstack, java.util.Map<java.lang.String,java.lang.String> attrs, java.lang.String content, java.util.Map<java.lang.String,java.lang.Object> buffer, java.util.List<java.lang.Runnable> sempostprocesstasks, IBpmnVisualModelReader vreader)
Handles XML elements.
-
handleSemanticElement
protected static final void handleSemanticElement(MBpmnModel model, java.util.Map<java.lang.String,MIdElement> emap, java.util.Map<java.lang.String,MLane> lanemap, java.util.Map<java.lang.String,java.lang.String> laneparents, XmlTag tag, java.util.LinkedList<XmlTag> tagstack, java.util.Map<java.lang.String,java.lang.String> attrs, java.lang.String content, java.util.Map<java.lang.String,java.lang.Object> buffer, java.util.List<java.lang.Runnable> postprocesstasks)
Handles a semantic section.- Parameters:
model
- The model.lastobject
- The last object.tag
- The current tag.tagstack
- The tag stack.attrs
- Current attributes.content
- The tag content.buffer
- Buffered information.
-
handleJadexElement
protected static final void handleJadexElement(MBpmnModel model, XmlTag tag, java.util.LinkedList<XmlTag> tagstack, java.util.Map<java.lang.String,java.lang.String> attrs, java.lang.String content, java.util.Map<java.lang.String,java.lang.Object> buffer, java.util.Map<java.lang.String,MIdElement> emap)
Handles a Jadex model extension.- Parameters:
model
- The model.lastobject
- The last object.tag
- The current tag.tagstack
- The tag stack.attrs
- Current attributes.content
- The tag content.buffer
- Buffered information.
-
handleVisualElement
protected static final void handleVisualElement(IBpmnVisualModelReader vreader, XmlTag tag, java.util.Map<java.lang.String,java.lang.String> attrs, java.lang.String content, java.util.Map<java.lang.String,java.lang.String> laneparents, java.util.Map<java.lang.String,MIdElement> emap, java.util.Map<java.lang.String,java.lang.Object> buffer)
Handles a visual element.- Parameters:
vreader
- The visual reader.tag
- The XML tag.attrs
- The XML attributes.emap
- The element map.buffer
- The buffer.
-
insertActivity
protected static final void insertActivity(MActivity act, java.util.Map<java.lang.String,java.lang.Object> buffer, java.util.Map<java.lang.String,MLane> lanemap, java.util.Map<java.lang.String,MIdElement> emap)
Inserts an activity into the model and maps.- Parameters:
act
- The activity.buffer
- The buffer.lanemap
- The lane map.emap
- The element map.
-
connectActivityEdges
protected static final void connectActivityEdges(MActivity act, java.util.Map<java.lang.String,java.lang.Object> buffer, java.util.Map<java.lang.String,MIdElement> emap)
Connects activity edges.
-
parseExp
protected static final UnparsedExpression parseExp(UnparsedExpression exp, java.lang.String[] imports, java.lang.ClassLoader cl)
Parses the expression if possible.- Parameters:
exp
- The expression.imports
- The imports.cl
- The class loader.- Returns:
- Parsed expression or unparsed if class loader is unavailable.
-
matchLTag
protected static final boolean matchLTag(java.lang.String tagname, XmlTag tag)
Matches local part of the tag. TODO: Do this for all tags.
-
-