@ParametersAreNonnullByDefault public abstract class AbstractXmiStreamWriter extends AbstractStreamWriter
AbstractStreamWriter
that writes data into an XMI file.target
Modifier | Constructor and Description |
---|---|
protected |
AbstractXmiStreamWriter(OutputStream stream)
Constructs a new
AbstractXmiStreamWriter with the given stream . |
Modifier and Type | Method and Description |
---|---|
void |
onAttribute(ProxyAttribute attribute,
List<Object> values)
Handles an attribute in the current element.
|
void |
onComplete()
Handles the end of the current task.
|
void |
onEndElement()
Handles the end of the current element.
|
void |
onInitialize()
Handles the start of a task.
|
void |
onReference(ProxyReference reference,
List<Id> values)
Handles a reference in the current element.
|
void |
onStartElement(ProxyElement element)
Handles the start of an element.
|
protected abstract void |
writeAttribute(String name,
String value)
Writes an attribute of the current element.
|
protected abstract void |
writeCharacters(String characters)
Writes characters.
|
protected abstract void |
writeEndDocument()
Writes the end of the document and finalizes the migration.
|
protected abstract void |
writeEndElement()
Writes the end of the current element.
|
protected abstract void |
writeNamespace(String prefix,
String uri)
Writes a namespace.
|
protected abstract void |
writeStartDocument()
Writes the start of a document, including the general header.
|
protected abstract void |
writeStartElement(String name)
Writes the start of an element
name |
requireEndBeforeFlush
onAttribute, onReference
protected AbstractXmiStreamWriter(OutputStream stream)
AbstractXmiStreamWriter
with the given stream
.stream
- the stream where to write datapublic final void onInitialize() throws IOException
Handler
IOException
Handler.onComplete()
,
Notifier.notifyInitialize()
public final void onComplete() throws IOException
Handler
IOException
Handler.onInitialize()
,
Notifier.notifyComplete()
public final void onStartElement(ProxyElement element) throws IOException
Handler
onStartElement
in interface Handler
onStartElement
in class AbstractWriter<OutputStream>
element
- the element of the new elementIOException
Handler.onEndElement()
,
Notifier.notifyStartElement(ProxyElement)
public final void onEndElement() throws IOException
Handler
onEndElement
in interface Handler
onEndElement
in class AbstractWriter<OutputStream>
IOException
Handler.onStartElement(ProxyElement)
,
Notifier.notifyEndElement()
public final void onAttribute(ProxyAttribute attribute, List<Object> values) throws IOException
AbstractWriter
onAttribute
in class AbstractWriter<OutputStream>
attribute
- the new attribute, without its valuevalues
- the ordered values of the attribute; when the attribute
is single-valued, this parameter
is a Collections.singletonList(Object)
IOException
public final void onReference(ProxyReference reference, List<Id> values) throws IOException
AbstractWriter
onReference
in class AbstractWriter<OutputStream>
reference
- the new reference, without its valuevalues
- the ordered values of the reference; when the reference
is single-valued, this parameter
is a Collections.singletonList(Object)
IOException
protected abstract void writeStartDocument() throws IOException
IOException
- if an I/O error occurs when writingprotected abstract void writeStartElement(String name) throws IOException
name
name
- the name of the elementIOException
- if an I/O error occurs when writingprotected abstract void writeNamespace(String prefix, String uri) throws IOException
prefix
- the prefix of the namespaceuri
- the URI of the namespaceIOException
- if an I/O error occurs when writingprotected abstract void writeAttribute(String name, String value) throws IOException
name
- the name of the attributevalue
- the value of the attributeIOException
- if an I/O error occurs when writingprotected abstract void writeCharacters(String characters) throws IOException
characters
- the charactersIOException
- if an I/O error occurs when writingprotected abstract void writeEndElement() throws IOException
IOException
- if an I/O error occurs when writingprotected abstract void writeEndDocument() throws IOException
IOException
- if an I/O error occurs when writingCopyright © 2013–2019 Atlanmod. All rights reserved.