public class XMLWriter extends AbstractVisitor
Modifier and Type | Field and Description |
---|---|
protected int |
counter |
protected String |
init |
protected Map<InstanceLine,String> |
instances |
protected Map<AbstractLocation,String> |
locations |
protected XMLStreamWriter |
writer |
Constructor and Description |
---|
XMLWriter(OutputStream stream)
Constructor
|
XMLWriter(Writer writer)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
hasFlag(Element element,
String property)
Has the element flag
|
protected void |
indent()
Write text to the output
|
void |
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 document
|
void |
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 location
|
void |
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 template
|
void |
visitUpdate(Update update)
Visitor of the update, tag 'update'
|
protected void |
writeAttributes(Element element)
Write the attributes
|
protected void |
writeFlag(Element element,
String property)
Write the flag
|
protected void |
writePropertyAsElement(Element element,
String property,
boolean optional)
Write property as the xml element
|
protected void |
writePropertyAsLabel(Element element,
String name)
Write the property label, tag 'label' and the attribute 'kind', tag 'kind'
|
visitCut, visitElement, visitNode, visitProperty
protected int counter
protected XMLStreamWriter writer
protected Map<AbstractLocation,String> locations
protected Map<InstanceLine,String> instances
protected String init
public XMLWriter(OutputStream stream) throws XMLStreamException
stream
- - The output streamXMLStreamException
public XMLWriter(Writer writer) throws XMLStreamException
writer
- - The java xml writerXMLStreamException
protected void indent() throws XMLStreamException
XMLStreamException
protected void writePropertyAsElement(Element element, String property, boolean optional) throws XMLStreamException
element
- - The elementproperty
- - The propery stringoptional
- - The optional valueXMLStreamException
protected void writePropertyAsLabel(Element element, String name) throws XMLStreamException
element
- - The elementname
- - The property nameXMLStreamException
protected void writeAttributes(Element element) throws XMLStreamException
element
- - The elementXMLStreamException
protected boolean hasFlag(Element element, String property)
element
- - The elementproperty
- - The propertyprotected void writeFlag(Element element, String property) throws XMLStreamException
element
- - The element objectproperty
- - The propertyXMLStreamException
public void visitDocument(Document document) throws Exception
visitDocument
in interface Visitor
visitDocument
in class AbstractVisitor
document
- - The model documentException
public void visitTemplate(AbstractTemplate template) throws Exception
visitTemplate
in interface Visitor
visitTemplate
in class AbstractVisitor
template
- - The abstract templateException
public void visitLocation(Location location) throws Exception
visitLocation
in interface Visitor
visitLocation
in class AbstractVisitor
location
- - The locationException
public void visitBranchPoint(BranchPoint branchPoint) throws Exception
visitBranchPoint
in interface Visitor
visitBranchPoint
in class AbstractVisitor
branchPoint
- - The branchPointException
public void visitEdge(Edge edge) throws Exception
visitEdge
in interface Visitor
visitEdge
in class AbstractVisitor
edge
- - The edgeException
public void visitNail(Nail nail) throws Exception
visitNail
in interface Visitor
visitNail
in class AbstractVisitor
nail
- - The nailException
public void visitInstanceLine(InstanceLine instance) throws Exception
visitInstanceLine
in interface Visitor
visitInstanceLine
in class AbstractVisitor
instance
- - The instanceLineException
public void visitPrechart(Prechart prechart) throws Exception
visitPrechart
in interface Visitor
visitPrechart
in class AbstractVisitor
prechart
- - The prechartException
public void visitMessage(Message message) throws Exception
visitMessage
in interface Visitor
visitMessage
in class AbstractVisitor
message
- - The messageException
public void visitCondition(Condition condition) throws Exception
visitCondition
in interface Visitor
visitCondition
in class AbstractVisitor
condition
- - The conditionException
public void visitUpdate(Update update) throws Exception
visitUpdate
in interface Visitor
visitUpdate
in class AbstractVisitor
update
- - The updateException
public void visitQueries(QueryList queries) throws Exception
visitQueries
in interface Visitor
visitQueries
in class AbstractVisitor
queries
- - The QueryListModelException
public void visitQuery(Query query) throws Exception
visitQuery
in interface Visitor
visitQuery
in class AbstractVisitor
query
- - The queryPropertyException
Copyright © 2014 Uppsala University and Aalborg University. All Rights Reserved.