Package com.uppaal.model.io2
Class XMLWriter
java.lang.Object
com.uppaal.model.core2.AbstractVisitor
com.uppaal.model.io2.XMLWriter
- All Implemented Interfaces:
Visitor
public class XMLWriter extends AbstractVisitor
The model xml writer class
-
Field Summary
Fields Modifier and Type Field Description protected int
counter
protected String
init
protected Map<InstanceLine,String>
instances
protected Map<AbstractLocation,String>
locations
protected XMLStreamWriter
writer
-
Constructor Summary
Constructors Constructor Description XMLWriter(OutputStream stream)
ConstructorXMLWriter(Writer writer)
Constructor -
Method Summary
Modifier and Type Method Description protected boolean
hasFlag(Element element, String property)
Has the element flagprotected void
indent()
Write text to the outputvoid
visitBranchPoint(BranchPoint branchPoint)
Visitor of the branch point, tag 'branchpoint'void
visitCondition(Condition condition)
Visitor of the condition, tag 'condition'void
visitDocument(Document document)
Visitor of the documentvoid
visitEdge(Edge edge)
Visitor of the edge, tag 'transition'void
visitInstanceLine(InstanceLine instance)
Visitor of the instanceLine, tag 'instance'void
visitLocation(Location location)
Visitor of the locationvoid
visitMessage(Message message)
Visitor of the message, tag 'message'void
visitNail(Nail nail)
Visitor of the nail, tag 'nail'void
visitPrechart(Prechart prechart)
Visitor of the preChart, tag 'prechart'void
visitQueries(QueryList queries)
Visitor of the queries, tag 'queries'void
visitQuery(Query query)
Visitor of the query, tag 'query'void
visitTemplate(AbstractTemplate template)
Visitor of the templatevoid
visitUpdate(Update update)
Visitor of the update, tag 'update'protected void
writeAttributes(Element element)
Write the attributesprotected void
writeFlag(Element element, String property)
Write the flagprotected void
writePropertyAsElement(Element element, String property, boolean optional)
Write property as the xml elementprotected void
writePropertyAsLabel(Element element, String name)
Write the property label, tag 'label' and the attribute 'kind', tag 'kind'Methods inherited from class com.uppaal.model.core2.AbstractVisitor
visitCut, visitElement, visitNode, visitProperty
-
Field Details
-
Constructor Details
-
XMLWriter
Constructor- Parameters:
stream
- - The output stream- Throws:
XMLStreamException
-
XMLWriter
Constructor- Parameters:
writer
- - The java xml writer- Throws:
XMLStreamException
-
-
Method Details
-
indent
Write text to the output- Throws:
XMLStreamException
-
writePropertyAsElement
protected void writePropertyAsElement(Element element, String property, boolean optional) throws XMLStreamExceptionWrite property as the xml element- Parameters:
element
- - The elementproperty
- - The propery stringoptional
- - The optional value- Throws:
XMLStreamException
-
writePropertyAsLabel
Write the property label, tag 'label' and the attribute 'kind', tag 'kind'- Parameters:
element
- - The elementname
- - The property name- Throws:
XMLStreamException
-
writeAttributes
Write the attributes- Parameters:
element
- - The element- Throws:
XMLStreamException
-
hasFlag
Has the element flag- Parameters:
element
- - The elementproperty
- - The property- Returns:
- True -It has a flag
-
writeFlag
Write the flag- Parameters:
element
- - The element objectproperty
- - The property- Throws:
XMLStreamException
-
visitDocument
Visitor of the document- Specified by:
visitDocument
in interfaceVisitor
- Overrides:
visitDocument
in classAbstractVisitor
- Parameters:
document
- - The model document- Throws:
Exception
-
visitTemplate
Visitor of the template- Specified by:
visitTemplate
in interfaceVisitor
- Overrides:
visitTemplate
in classAbstractVisitor
- Parameters:
template
- - The abstract template- Throws:
Exception
-
visitLocation
Visitor of the location- Specified by:
visitLocation
in interfaceVisitor
- Overrides:
visitLocation
in classAbstractVisitor
- Parameters:
location
- - The location- Throws:
Exception
-
visitBranchPoint
Visitor of the branch point, tag 'branchpoint'- Specified by:
visitBranchPoint
in interfaceVisitor
- Overrides:
visitBranchPoint
in classAbstractVisitor
- Parameters:
branchPoint
- - The branchPoint- Throws:
Exception
-
visitEdge
Visitor of the edge, tag 'transition'- Specified by:
visitEdge
in interfaceVisitor
- Overrides:
visitEdge
in classAbstractVisitor
- Parameters:
edge
- - The edge- Throws:
Exception
-
visitNail
Visitor of the nail, tag 'nail'- Specified by:
visitNail
in interfaceVisitor
- Overrides:
visitNail
in classAbstractVisitor
- Parameters:
nail
- - The nail- Throws:
Exception
-
visitInstanceLine
Visitor of the instanceLine, tag 'instance'- Specified by:
visitInstanceLine
in interfaceVisitor
- Overrides:
visitInstanceLine
in classAbstractVisitor
- Parameters:
instance
- - The instanceLine- Throws:
Exception
-
visitPrechart
Visitor of the preChart, tag 'prechart'- Specified by:
visitPrechart
in interfaceVisitor
- Overrides:
visitPrechart
in classAbstractVisitor
- Parameters:
prechart
- - The prechart- Throws:
Exception
-
visitMessage
Visitor of the message, tag 'message'- Specified by:
visitMessage
in interfaceVisitor
- Overrides:
visitMessage
in classAbstractVisitor
- Parameters:
message
- - The message- Throws:
Exception
-
visitCondition
Visitor of the condition, tag 'condition'- Specified by:
visitCondition
in interfaceVisitor
- Overrides:
visitCondition
in classAbstractVisitor
- Parameters:
condition
- - The condition- Throws:
Exception
-
visitUpdate
Visitor of the update, tag 'update'- Specified by:
visitUpdate
in interfaceVisitor
- Overrides:
visitUpdate
in classAbstractVisitor
- Parameters:
update
- - The update- Throws:
Exception
-
visitQueries
Visitor of the queries, tag 'queries'- Specified by:
visitQueries
in interfaceVisitor
- Overrides:
visitQueries
in classAbstractVisitor
- Parameters:
queries
- - The QueryListModel- Throws:
Exception
-
visitQuery
Visitor of the query, tag 'query'- Specified by:
visitQuery
in interfaceVisitor
- Overrides:
visitQuery
in classAbstractVisitor
- Parameters:
query
- - The queryProperty- Throws:
Exception
-