com.uppaal.model.io2
Class XMLReader

java.lang.Object
  extended by com.uppaal.model.io2.XMLReader

public class XMLReader
extends Object


Field Summary
protected  XMLEvent event
           
protected  Map<String,InstanceLine> instances
           
protected  Map<String,AbstractLocation> locations
           
protected  XMLEventReader reader
           
 
Constructor Summary
XMLReader(InputStream s)
           
 
Method Summary
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 start element.
protected  void branchpoints(Template template)
           
protected  void committed(Location location)
          Parse optional committed tag.
protected  void conditions(LscTemplate template)
           
protected  void declaration(Node node)
           
protected  void edges(Template template)
           
protected  void fixedname(Node node)
           
protected  String getAttribute(String name)
           
protected  Color getColor(String attribute)
           
protected  Integer getCoordinate(String attribute)
           
protected  Integer getYLocation()
           
protected  void init(Template template)
          Parse optional init tag.
protected  void instances(LscTemplate template)
           
protected  void instantiation(Document document)
          Parse optional instantiation tag.
protected  void label(LscElement element)
           
protected  void labels(Node node)
           
protected  void locations(Template template)
          Parse optional location.
protected  void lscTemplates(Document document)
          Parse the lsc tags
protected  void messages(LscTemplate template)
           
protected  InstanceLine messageSource()
           
protected  InstanceLine messageTarget()
           
protected  void mode(AbstractTemplate node)
           
protected  void nails(Edge edge)
           
protected  void name(Node node)
           
protected  void next()
           
protected  void parameter(AbstractTemplate node)
          Parses an optional parameter tag.
 Document parse(Element prototype)
           
protected  void prechart(LscTemplate template)
           
protected  void project(Document document)
           
protected  String readText()
           
protected  void role(AbstractTemplate node)
           
static void setXMLResolver(XMLResolver value)
          Set a custom XMLResolver to be used with XMLEventReader.
protected  AbstractLocation source()
           
protected  void system(Document document)
          Parse optional system tag.
protected  AbstractLocation target()
           
protected  void temperature(Node node)
          Parse the temperature tag for a condition
protected  void templates(Document document)
           
protected  void type(AbstractTemplate node)
           
protected  void updates(LscTemplate template)
           
protected  void urgent(Location location)
          Parse optional urgent tag.
protected  void yLocation(LscElement element, String property)
           
protected  void yloccoord(LscTemplate template)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reader

protected XMLEventReader reader

event

protected XMLEvent event

locations

protected Map<String,AbstractLocation> locations

instances

protected Map<String,InstanceLine> instances
Constructor Detail

XMLReader

public XMLReader(InputStream s)
          throws XMLStreamException
Throws:
XMLStreamException
Method Detail

setXMLResolver

public static void setXMLResolver(XMLResolver value)
Set a custom XMLResolver to be used with XMLEventReader.


parse

public Document parse(Element prototype)
               throws XMLStreamException
Throws:
XMLStreamException

next

protected void next()
             throws XMLStreamException
Throws:
XMLStreamException

begin

protected boolean begin(String tag)
                 throws XMLStreamException
Read until start element. Returns true if that element has the given tag.

Throws:
XMLStreamException

readText

protected String readText()
                   throws XMLStreamException
Throws:
XMLStreamException

getAttribute

protected String getAttribute(String name)

getCoordinate

protected Integer getCoordinate(String attribute)

getColor

protected Color getColor(String attribute)

project

protected void project(Document document)
                throws XMLStreamException
Throws:
XMLStreamException

declaration

protected void declaration(Node node)
                    throws XMLStreamException
Throws:
XMLStreamException

name

protected void name(Node node)
             throws XMLStreamException
Throws:
XMLStreamException

fixedname

protected void fixedname(Node node)
                  throws XMLStreamException
Throws:
XMLStreamException

parameter

protected void parameter(AbstractTemplate node)
                  throws XMLStreamException
Parses an optional parameter tag.

Throws:
XMLStreamException

type

protected void type(AbstractTemplate node)
             throws XMLStreamException
Throws:
XMLStreamException

mode

protected void mode(AbstractTemplate node)
             throws XMLStreamException
Throws:
XMLStreamException

role

protected void role(AbstractTemplate node)
             throws XMLStreamException
Throws:
XMLStreamException

labels

protected void labels(Node node)
               throws XMLStreamException
Throws:
XMLStreamException

label

protected void label(LscElement element)
              throws XMLStreamException
Parameters:
node -
Throws:
XMLStreamException

temperature

protected void temperature(Node node)
                    throws XMLStreamException
Parse the temperature tag for a condition

Parameters:
node -
Throws:
XMLStreamException

committed

protected void committed(Location location)
                  throws XMLStreamException
Parse optional committed tag.

Throws:
XMLStreamException

urgent

protected void urgent(Location location)
               throws XMLStreamException
Parse optional urgent tag.

Throws:
XMLStreamException

init

protected void init(Template template)
             throws XMLStreamException
Parse optional init tag.

Throws:
XMLStreamException

locations

protected void locations(Template template)
                  throws XMLStreamException
Parse optional location.

Throws:
XMLStreamException

branchpoints

protected void branchpoints(Template template)
                     throws XMLStreamException
Throws:
XMLStreamException

source

protected AbstractLocation source()
                           throws XMLStreamException
Throws:
XMLStreamException

target

protected AbstractLocation target()
                           throws XMLStreamException
Throws:
XMLStreamException

nails

protected void nails(Edge edge)
              throws XMLStreamException
Throws:
XMLStreamException

edges

protected void edges(Template template)
              throws XMLStreamException
Throws:
XMLStreamException

templates

protected void templates(Document document)
                  throws XMLStreamException
Throws:
XMLStreamException

lscTemplates

protected void lscTemplates(Document document)
                     throws XMLStreamException
Parse the lsc tags

Parameters:
document -
Throws:
XMLStreamException

prechart

protected void prechart(LscTemplate template)
                 throws XMLStreamException
Throws:
XMLStreamException

yLocation

protected void yLocation(LscElement element,
                         String property)
                  throws XMLStreamException
Throws:
XMLStreamException

getYLocation

protected Integer getYLocation()
                        throws XMLStreamException
Throws:
XMLStreamException

yloccoord

protected void yloccoord(LscTemplate template)
                  throws XMLStreamException
Throws:
XMLStreamException

instances

protected void instances(LscTemplate template)
                  throws XMLStreamException
Throws:
XMLStreamException

messages

protected void messages(LscTemplate template)
                 throws XMLStreamException
Throws:
XMLStreamException

conditions

protected void conditions(LscTemplate template)
                   throws XMLStreamException
Throws:
XMLStreamException

updates

protected void updates(LscTemplate template)
                throws XMLStreamException
Throws:
XMLStreamException

anchors

protected ArrayList<InstanceLine> anchors(Condition element)
                                   throws XMLStreamException
Get the anchor instances for a condition

Parameters:
element -
Returns:
Throws:
XMLStreamException

anchor

protected InstanceLine anchor(Update element)
                       throws XMLStreamException
Get the update anchor instance

Parameters:
element -
Returns:
Throws:
XMLStreamException

messageSource

protected InstanceLine messageSource()
                              throws XMLStreamException
Throws:
XMLStreamException

messageTarget

protected InstanceLine messageTarget()
                              throws XMLStreamException
Throws:
XMLStreamException

instantiation

protected void instantiation(Document document)
                      throws XMLStreamException
Parse optional instantiation tag.

Throws:
XMLStreamException

system

protected void system(Document document)
               throws XMLStreamException
Parse optional system tag.

Throws:
XMLStreamException


Copyright © 2012 Uppsala University and Aalborg University. All Rights Reserved.