public class XMLReader extends Object
Modifier and Type | Field and Description |
---|---|
protected XMLEvent |
event |
protected Map<String,InstanceLine> |
instances |
protected Map<String,AbstractLocation> |
locations |
protected XMLEventReader |
reader |
Constructor and Description |
---|
XMLReader(InputStream s)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected InstanceLine |
anchor(Update element)
Get the update anchor instance
|
protected ArrayList<InstanceLine> |
anchors(Condition element)
Get the anchor instances for a condition
|
protected boolean |
begin(String tag)
Read until the beginning of a given tag.
|
protected void |
branchpoints(Template template)
Parse the branchpoint tag: x, y, color and id attributes.
|
protected void |
committed(Location location)
Parse optional committed tag.
|
protected void |
conditions(LscTemplate template)
Parse the conditions data, tag 'condition'
|
protected void |
declaration(Node node)
Parse the 'declaration' text.
|
protected void |
edges(Template template)
Parse the edge tag(s) if any: controllable, color, label(s) and nail(s).
|
protected void |
fixedname(Node node)
Parse the plain name label without attributes.
|
protected String |
getAttribute(String name)
Get the attribute string
|
protected Color |
getColor(String attribute)
Get the color value
|
protected Integer |
getCoordinate(String attribute)
get coordinate value
|
protected Integer |
getYLocation()
Get the y coordinate data of the location, tag 'lsclocation'
|
protected void |
init(Template template)
Parse optional init tag.
|
protected void |
instances(LscTemplate template)
Parse the instance data, tag 'instance'.
|
protected void |
instantiation(Document document)
Parse optional instantiation tag.
|
protected void |
label(LscElement element)
Parse the LSC label tag.
|
protected void |
labels(Node node)
Parse the label tag: kind, x, y, color and inner text.
|
protected void |
locations(Template template)
Parse all subsequent location tag(s) if any.
|
protected void |
lscTemplates(Document document)
Parse the LSC tag(s) if any: name, parameter, type, mode, role,
declaration, locations, instances, prechart, messages, conditions,
updates.
|
protected void |
messages(LscTemplate template)
Parse the messages data, tag 'message'
|
protected InstanceLine |
messageSource()
Parse the message source data, tag 'source'
|
protected InstanceLine |
messageTarget()
Parse the message target data, tag 'target'
|
protected void |
mode(AbstractTemplate node)
Parse the mode tag.
|
protected void |
nails(Edge edge)
Parse the nail tag(s) if any: x, y attributes.
|
protected void |
name(Node node)
Parse the name label data: name, x, y and color.
|
protected void |
next()
The next read event
|
protected void |
parameter(AbstractTemplate node)
Parse an optional parameter tag text.
|
Document |
parse(Element prototype)
Parse the document.
|
protected void |
prechart(LscTemplate template)
Parse the prechart data, tag 'prechart'
|
protected void |
project(Document document)
Parse the document starting with 'project' or 'nta', through templates,
instantiation, system declaration and queries.
|
protected void |
queries(Document document)
Parse 'queries' tag with inner 'query' tags containing 'formula'
and 'comment' tags.
|
protected String |
readText()
Read the text inside a tag.
|
protected void |
role(AbstractTemplate node)
Parse the role tag.
|
static void |
setXMLResolver(XMLResolver value)
Set a custom XMLResolver to be used with XMLEventReader.
|
protected AbstractLocation |
source()
Parse the source (location/branchpoint) tag: ref attribute.
|
protected void |
system(Document document)
Parse optional system tag.
|
protected AbstractLocation |
target()
Parse the target (location/branchpoint) tag: ref attribute.
|
protected void |
temperature(Node node)
Parse the temperature tag of a condition
|
protected void |
templates(Document document)
Parse the template tag(s) if any: name, parameter, declaration,
locations, branchpoints, initial location and edges.
|
protected void |
type(AbstractTemplate node)
Parse the type tag of TA or LSC template.
|
protected void |
updates(LscTemplate template)
Parse the updates data, tag 'update'
|
protected void |
urgent(Location location)
Parse optional urgent tag.
|
protected void |
yLocation(LscElement element,
String property)
Set the y coordinate of the location in lscElement.
|
protected void |
yloccoord(LscTemplate template)
Parse the y coordinate data of the location, tag 'yloccoord'
|
protected XMLEventReader reader
protected XMLEvent event
protected Map<String,AbstractLocation> locations
protected Map<String,InstanceLine> instances
public XMLReader(InputStream s) throws XMLStreamException
s
- - The input streamXMLStreamException
public static void setXMLResolver(XMLResolver value)
value
- resolver.public Document parse(Element prototype) throws XMLStreamException
prototype
- default properties for the model document.XMLStreamException
- parsing error.protected void next() throws XMLStreamException
XMLStreamException
- parse exception.protected boolean begin(String tag) throws XMLStreamException
tag
- the name of the tagXMLStreamException
- parsing errorprotected String readText() throws XMLStreamException
XMLStreamException
- parsing errorprotected String getAttribute(String name)
name
- - The attribute nameprotected Integer getCoordinate(String attribute)
attribute
- - The attribute nameprotected Color getColor(String attribute)
attribute
- - The attribute nameprotected void project(Document document) throws XMLStreamException
document
- - AST for the model documentXMLStreamException
- parsing errorprotected void declaration(Node node) throws XMLStreamException
node
- parent TA or LSC template.XMLStreamException
- parsing errorprotected void name(Node node) throws XMLStreamException
node
- the owner of this property.XMLStreamException
- parsing error.protected void fixedname(Node node) throws XMLStreamException
node
- the owner of this name property.XMLStreamException
- parsing error.protected void parameter(AbstractTemplate node) throws XMLStreamException
node
- the owner of this parameter.XMLStreamException
- parsing error.protected void type(AbstractTemplate node) throws XMLStreamException
node
- the owner of this tag.XMLStreamException
- parsing error.protected void mode(AbstractTemplate node) throws XMLStreamException
node
- the owner of this tag.XMLStreamException
- parsing error.protected void role(AbstractTemplate node) throws XMLStreamException
node
- the owner of this tag.XMLStreamException
- parsing error.protected void labels(Node node) throws XMLStreamException
node
- the owner of this tag.XMLStreamException
protected void label(LscElement element) throws XMLStreamException
element
- the owner of this tag.XMLStreamException
- parsing error.protected void temperature(Node node) throws XMLStreamException
node
- the owner of this tag.XMLStreamException
- parsing error.protected void committed(Location location) throws XMLStreamException
location
- the owner of this tag.XMLStreamException
- parsing error.protected void urgent(Location location) throws XMLStreamException
location
- the owner of this tag.XMLStreamException
- parsing error.protected void init(Template template) throws XMLStreamException
template
- the owner of this tag.XMLStreamException
- parsing error.protected void locations(Template template) throws XMLStreamException
template
- the owner of those tags.XMLStreamException
- parsing error.protected void branchpoints(Template template) throws XMLStreamException
template
- the owner of this tag.XMLStreamException
- parsing error.protected AbstractLocation source() throws XMLStreamException
XMLStreamException
- parsing error.protected AbstractLocation target() throws XMLStreamException
XMLStreamException
- parsing error.protected void nails(Edge edge) throws XMLStreamException
edge
- the owner of those tags.XMLStreamException
- parsing error.protected void edges(Template template) throws XMLStreamException
template
- the owner of these tags.XMLStreamException
protected void templates(Document document) throws XMLStreamException
document
- the owner of these tags.XMLStreamException
protected void lscTemplates(Document document) throws XMLStreamException
document
- - The model documentXMLStreamException
- parsing error.protected void prechart(LscTemplate template) throws XMLStreamException
template
- - The template objectXMLStreamException
- parsing error.protected void yLocation(LscElement element, String property) throws XMLStreamException
element
- - The lscElementproperty
- - The property stringXMLStreamException
- parsing error.protected Integer getYLocation() throws XMLStreamException
XMLStreamException
protected void yloccoord(LscTemplate template) throws XMLStreamException
template
- - The lsc templateXMLStreamException
protected void instances(LscTemplate template) throws XMLStreamException
template
- - The LSC templateXMLStreamException
- parsing error.protected void messages(LscTemplate template) throws XMLStreamException
template
- - The LSC templateXMLStreamException
- parsing error.protected void conditions(LscTemplate template) throws XMLStreamException
template
- - The LSC templateXMLStreamException
- parsing error.protected void updates(LscTemplate template) throws XMLStreamException
template
- - The LSC templateXMLStreamException
- parsing error.protected ArrayList<InstanceLine> anchors(Condition element) throws XMLStreamException
element
- - the condition objectXMLStreamException
- parsing error.protected InstanceLine anchor(Update element) throws XMLStreamException
element
- - The updata objectXMLStreamException
- parsing error.protected InstanceLine messageSource() throws XMLStreamException
XMLStreamException
- parsing error.protected InstanceLine messageTarget() throws XMLStreamException
XMLStreamException
- parsing error.protected void instantiation(Document document) throws XMLStreamException
document
- - The model documentXMLStreamException
- parsing error.protected void system(Document document) throws XMLStreamException
document
- - The model documentXMLStreamException
- parsing error.protected void queries(Document document) throws XMLStreamException
document
- the owner of this tag.XMLStreamException
- parsing error.Copyright © 2014 Uppsala University and Aalborg University. All Rights Reserved.