@ParametersAreNonnullByDefault public abstract class AbstractStreamReader extends AbstractReader<InputStream>
Reader
that reads data from an InputStream
.Constructor and Description |
---|
AbstractStreamReader() |
Modifier and Type | Method and Description |
---|---|
protected void |
flushCurrentElement()
Finalizes the current element and sends all delayed notifications to handlers.
|
ProxyElement |
getCurrentElement()
Returns the current element.
|
Id |
getPreviousId()
Returns the identifier of the previous element.
|
void |
ignoreCurrentElement()
Asks to ignore the current element.
|
protected abstract boolean |
isSpecialAttribute(String prefix,
String name,
String value)
Defines if the attribute represented with the parameters is a special attribute as 'xsi:type', 'xmi:id' or
'xmi:idref'.
|
abstract void |
parse(InputStream stream)
Parses the content of the
stream . |
void |
read(InputStream source)
Reads an
Object . |
protected void |
readAttribute(String prefix,
String name,
String value)
Reads a new attribute of the current element.
|
protected void |
readEndDocument()
Reads the end of the current document.
|
protected void |
readEndElement()
Reads the end of an element.
|
protected void |
readMetaClass(String prefixedValue)
Reads a meta-class attribute from the
prefixedValue , and defines is as the meta-class of the given element . |
protected void |
readNamespace(String prefix,
String uri)
Reads a
ProxyPackage declaration. |
protected void |
readSimpleElement(String uri,
String name,
String value)
Reads a new simple element, as
<name>value</name> . |
protected void |
readStartDocument()
Reads the start of the document.
|
protected void |
readStartElement(String uri,
String name)
Reads the start of a new element.
|
addNext, createProcessors
addNext, notifyAttribute, notifyComplete, notifyEndElement, notifyInitialize, notifyReference, notifyStartElement, supportsMultiTargets
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
notifyAttribute, notifyComplete, notifyEndElement, notifyInitialize, notifyReference, notifyStartElement
public final void read(InputStream source) throws IOException
Reader
Object
.source
- the object to readIOException
- if an error occurred during the I/O processpublic abstract void parse(InputStream stream) throws IOException
stream
.stream
- the stream to readIOException
- if an error occurred during the I/O process@Nonnull public Id getPreviousId()
@Nonnull public ProxyElement getCurrentElement()
public void ignoreCurrentElement()
protected final void readStartDocument() throws IOException
IOException
protected final void readStartElement(@Nullable String uri, String name)
Note: An element must be flushed with the flushCurrentElement()
method after analysing all its
attributes.
uri
- the namespace's URI of the elementname
- the name of the elementprotected final void readSimpleElement(@Nullable String uri, String name, String value) throws IOException
<name>value</name>
.uri
- the namespace's URI of the elementname
- the name of the elementvalue
- the literal value of the elementIOException
protected final void readNamespace(String prefix, String uri)
ProxyPackage
declaration.prefix
- the prefix of the namespaceuri
- the URI of the namespaceProxyPackage.Registry#register(String, String)
protected final void flushCurrentElement() throws IOException
IOException
protected final void readAttribute(@Nullable String prefix, String name, String value) throws IOException
prefix
- the namespace's prefix of the attributename
- the name of the attributevalue
- the value of the attributeIOException
protected final void readMetaClass(String prefixedValue)
prefixedValue
, and defines is as the meta-class of the given element
.prefixedValue
- the value representing the meta-classPATTERN_PREFIXED_VALUE
protected final void readEndElement() throws IOException
IOException
protected final void readEndDocument() throws IOException
IOException
protected abstract boolean isSpecialAttribute(@Nullable String prefix, String name, String value) throws IOException
prefix
- the namespace's prefix of the attributename
- the name of the attributevalue
- the value of the attributetrue
if the given feature is a special featureIOException
Copyright © 2013–2019 Atlanmod. All rights reserved.