public class SaltXML10Writer extends Object implements SaltXML10Dictionary
ATT_EDGES, ATT_HREF, ATT_LAYERS, ATT_NAME, ATT_NAMESPACE, ATT_NODES, ATT_SNAME, ATT_SOURCE, ATT_TARGET, ATT_TYPE, ATT_VALUE, ATT_VALUE_STRING, ATT_XMI_VERSION, ATT_XSI_TYPE, NS_SALTCOMMON, NS_SALTCORE, NS_SCORPUSSTRUCTURE, NS_SDOCUMENTSTRUCTURE, NS_VALUE_SALTCOMMON, NS_VALUE_SALTCORE, NS_VALUE_SCORPUSSTRUCTURE, NS_VALUE_SDOCUMENTSTRUCTURE, NS_VALUE_XMI, NS_VALUE_XSI, NS_XMI, NS_XSI, TAG_EDGES, TAG_LABELS, TAG_LAYERS, TAG_NODES, TAG_SALT_PROJECT, TAG_SALT_PROJECT_FULL, TAG_SCORPUS_GRAPH, TAG_SDOCUMENT, TAG_SDOCUMENT_GRAPH, TAG_SDOCUMENTSTRUCTURE_SDOCUMENTGRAPH, TYPE_SANNOTATION, TYPE_SAUDIO_RELATION, TYPE_SAUDIODS, TYPE_SCAT, TYPE_SCORPUS, TYPE_SCORPUS_DOCUMENT_RELATION, TYPE_SCORPUS_RELATION, TYPE_SDOCUMENT, TYPE_SDOMINANCE_RELATION, TYPE_SELEMENTID, TYPE_SFEATURE, TYPE_SLEMMA, TYPE_SMETAANNOTATION, TYPE_SORDER_RELATION, TYPE_SPOINTING_RELATION, TYPE_SPOS, TYPE_SPROCESSINGANNOTATION, TYPE_SSENTENCE, TYPE_SSPAN, TYPE_SSPANNING_RELATION, TYPE_SSTRUCTURE, TYPE_STEXTUAL_RELATION, TYPE_STEXTUALDS, TYPE_STIMELINE, TYPE_STIMELINE_RELATION, TYPE_STOKEN, TYPE_STYPE, TYPE_SWORD| Constructor and Description |
|---|
SaltXML10Writer() |
SaltXML10Writer(File path) |
SaltXML10Writer(org.eclipse.emf.common.util.URI path) |
| Modifier and Type | Method and Description |
|---|---|
File |
getPath() |
String |
marshallValue(Object value)
Serializes an object as String.
|
void |
setPrettyPrint(boolean isPrettyPrint)
Determines whether the outputted SaltXML should be pretty printed.
|
void |
writeCorpusGraph(XMLStreamWriter xml,
SCorpusGraph graph,
boolean embedded)
Writes a corpus graph to the xml stream
|
void |
writeDocumentGraph(SDocumentGraph graph)
Writes a document graph to the file given by
getPath(). |
void |
writeDocumentGraph(XMLStreamWriter xml,
SDocumentGraph graph)
Writes a document graph to the xml stream.
|
void |
writeLabel(XMLStreamWriter xml,
Label label)
Writes the passed label object to the passed
XMLStreamWriter. |
void |
writeLayer(XMLStreamWriter xml,
Layer layer,
Map<SNode,Integer> nodePositions,
Map<SRelation<SNode,SNode>,Integer> relPositions)
Writes the passed relation object to the passed
XMLStreamWriter. |
void |
writeNode(XMLStreamWriter xml,
Node node,
Map<? extends Layer,Integer> layerPositions)
Writes the passed node object to the passed
XMLStreamWriter. |
void |
writeObjects(XMLStreamWriter xml,
Object... objects)
Write a number of root objects (objects without a container) to XML.
|
void |
writeRelation(XMLStreamWriter xml,
Relation relation,
Map<? extends Node,Integer> nodePositions,
Map<? extends Layer,Integer> layerPositions)
Writes the passed relation object to the passed
XMLStreamWriter. |
void |
writeSaltProject(SaltProject project)
Writes a Salt project to the file given by
getPath(). |
void |
writeSaltProject(XMLStreamWriter xml,
SaltProject project)
Writes a salt project to the xml stream.
|
void |
writeXMIRootElement(XMLStreamWriter xml)
Writes an Salt XMI header to the
XMLStreamWriter. |
public SaltXML10Writer()
public SaltXML10Writer(File path)
public SaltXML10Writer(org.eclipse.emf.common.util.URI path)
public void setPrettyPrint(boolean isPrettyPrint)
isPrettyPrint - true when output needs to be pretty printedpublic File getPath()
public void writeObjects(XMLStreamWriter xml, Object... objects)
xml - objects - List of objects of type SaltProject,
SDocumentGraph or SCorpusGraphpublic void writeSaltProject(SaltProject project)
getPath().project - the Salt project to be writtenpublic void writeSaltProject(XMLStreamWriter xml, SaltProject project)
xml - A pre-configured XMLStreamWriterproject - public void writeCorpusGraph(XMLStreamWriter xml, SCorpusGraph graph, boolean embedded)
graph - the corpus graph to be writtenembedded - determines whether this corpus graph is part of a saltProjectxml - xml stream to write corpus graph to, if the passed one is
null, a new one will be createdpublic void writeDocumentGraph(SDocumentGraph graph)
getPath().graph - public void writeDocumentGraph(XMLStreamWriter xml, SDocumentGraph graph)
xml - A pre-configured XMLStreamWritergraph - public void writeLabel(XMLStreamWriter xml, Label label) throws XMLStreamException
XMLStreamWriter.label - to be persistxml - stream to write data toXMLStreamExceptionpublic String marshallValue(Object value)
value - public void writeNode(XMLStreamWriter xml, Node node, Map<? extends Layer,Integer> layerPositions) throws XMLStreamException
XMLStreamWriter.node - to be persistxml - stream to write data tolayerPositions - XMLStreamExceptionpublic void writeRelation(XMLStreamWriter xml, Relation relation, Map<? extends Node,Integer> nodePositions, Map<? extends Layer,Integer> layerPositions) throws XMLStreamException
XMLStreamWriter.relation - to be persistxml - stream to write data tonodePositions - a map containing all positions of nodes in the list of nodeslayerPositions - XMLStreamExceptionpublic void writeLayer(XMLStreamWriter xml, Layer layer, Map<SNode,Integer> nodePositions, Map<SRelation<SNode,SNode>,Integer> relPositions) throws XMLStreamException
XMLStreamWriter.layer - xml - stream to write data tonodePositions - a map containing all positions of a single node in the list of
nodesrelPositions - a map containing all positions of a single relation in the
list of relationsXMLStreamExceptionpublic void writeXMIRootElement(XMLStreamWriter xml) throws XMLStreamException
XMLStreamWriter. Salt XMI has a
certain header structure (including the namespaces). This helper function
writes this header to an existing XMLStreamWriter.xml - XMLStreamExceptionCopyright © 2009–2019 Humboldt-Universität zu Berlin, INRIA. All rights reserved.