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 intcounterprotected Stringinitprotected Map<InstanceLine,String>instancesprotected Map<AbstractLocation,String>locationsprotected XMLStreamWriterwriter -
Constructor Summary
Constructors Constructor Description XMLWriter(OutputStream stream)ConstructorXMLWriter(Writer writer)Constructor -
Method Summary
Modifier and Type Method Description protected booleanhasFlag(Element element, String property)Has the element flagprotected voidindent()Write text to the outputvoidvisitBranchPoint(BranchPoint branchPoint)Visitor of the branch point, tag 'branchpoint'voidvisitCondition(Condition condition)Visitor of the condition, tag 'condition'voidvisitDocument(Document document)Visitor of the documentvoidvisitEdge(Edge edge)Visitor of the edge, tag 'transition'voidvisitInstanceLine(InstanceLine instance)Visitor of the instanceLine, tag 'instance'voidvisitLocation(Location location)Visitor of the locationvoidvisitMessage(Message message)Visitor of the message, tag 'message'voidvisitNail(Nail nail)Visitor of the nail, tag 'nail'voidvisitPrechart(Prechart prechart)Visitor of the preChart, tag 'prechart'voidvisitQueries(QueryList queries)Visitor of the queries, tag 'queries'voidvisitQuery(Query query)Visitor of the query, tag 'query'voidvisitTemplate(AbstractTemplate template)Visitor of the templatevoidvisitUpdate(Update update)Visitor of the update, tag 'update'protected voidwriteAttributes(Element element)Write the attributesprotected voidwriteFlag(Element element, String property)Write the flagprotected voidwritePropertyAsElement(Element element, String property, boolean optional)Write property as the xml elementprotected voidwritePropertyAsLabel(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:
visitDocumentin interfaceVisitor- Overrides:
visitDocumentin classAbstractVisitor- Parameters:
document- - The model document- Throws:
Exception
-
visitTemplate
Visitor of the template- Specified by:
visitTemplatein interfaceVisitor- Overrides:
visitTemplatein classAbstractVisitor- Parameters:
template- - The abstract template- Throws:
Exception
-
visitLocation
Visitor of the location- Specified by:
visitLocationin interfaceVisitor- Overrides:
visitLocationin classAbstractVisitor- Parameters:
location- - The location- Throws:
Exception
-
visitBranchPoint
Visitor of the branch point, tag 'branchpoint'- Specified by:
visitBranchPointin interfaceVisitor- Overrides:
visitBranchPointin classAbstractVisitor- Parameters:
branchPoint- - The branchPoint- Throws:
Exception
-
visitEdge
Visitor of the edge, tag 'transition'- Specified by:
visitEdgein interfaceVisitor- Overrides:
visitEdgein classAbstractVisitor- Parameters:
edge- - The edge- Throws:
Exception
-
visitNail
Visitor of the nail, tag 'nail'- Specified by:
visitNailin interfaceVisitor- Overrides:
visitNailin classAbstractVisitor- Parameters:
nail- - The nail- Throws:
Exception
-
visitInstanceLine
Visitor of the instanceLine, tag 'instance'- Specified by:
visitInstanceLinein interfaceVisitor- Overrides:
visitInstanceLinein classAbstractVisitor- Parameters:
instance- - The instanceLine- Throws:
Exception
-
visitPrechart
Visitor of the preChart, tag 'prechart'- Specified by:
visitPrechartin interfaceVisitor- Overrides:
visitPrechartin classAbstractVisitor- Parameters:
prechart- - The prechart- Throws:
Exception
-
visitMessage
Visitor of the message, tag 'message'- Specified by:
visitMessagein interfaceVisitor- Overrides:
visitMessagein classAbstractVisitor- Parameters:
message- - The message- Throws:
Exception
-
visitCondition
Visitor of the condition, tag 'condition'- Specified by:
visitConditionin interfaceVisitor- Overrides:
visitConditionin classAbstractVisitor- Parameters:
condition- - The condition- Throws:
Exception
-
visitUpdate
Visitor of the update, tag 'update'- Specified by:
visitUpdatein interfaceVisitor- Overrides:
visitUpdatein classAbstractVisitor- Parameters:
update- - The update- Throws:
Exception
-
visitQueries
Visitor of the queries, tag 'queries'- Specified by:
visitQueriesin interfaceVisitor- Overrides:
visitQueriesin classAbstractVisitor- Parameters:
queries- - The QueryListModel- Throws:
Exception
-
visitQuery
Visitor of the query, tag 'query'- Specified by:
visitQueryin interfaceVisitor- Overrides:
visitQueryin classAbstractVisitor- Parameters:
query- - The queryProperty- Throws:
Exception
-