public abstract class FileSourceXML extends SourceBase implements FileSource, XMLStreamConstants
streams). One who want to define a new xml-based fiel
source has to define actions after the document start and before the document
end. The nextEvents(), called between start and end, has to be
defined too.SourceBase.ElementTypeATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT| Modifier and Type | Method and Description |
|---|---|
void |
begin(InputStream stream)
Begin reading the file stopping as soon as possible.
|
void |
begin(Reader reader)
Begin reading the file stopping as soon as possible.
|
void |
begin(String fileName)
Begin reading the file stopping as soon as possible.
|
void |
begin(URL url)
Begin reading the file stopping as soon as possible.
|
void |
end()
Finish the reading process (even if
FileSource.nextEvents() or
FileSource.nextStep() did not returned false). |
abstract boolean |
nextEvents()
Try to process one graph event, or as few as possible, if more must be
read at once.
|
boolean |
nextStep()
Try to process all the events occurring during one time step.
|
void |
readAll(InputStream stream)
Read the whole file in one big non-interruptible operation.
|
void |
readAll(Reader reader)
Read the whole file in one big non-interruptible operation.
|
void |
readAll(String fileName)
Read the whole file in one big non-interruptible operation.
|
void |
readAll(URL url)
Read the whole file in one big non-interruptible operation.
|
addAttributeSink, addElementSink, addSink, attributeSinks, clearAttributeSinks, clearElementSinks, clearSinks, elementSinks, removeAttributeSink, removeElementSink, removeSink, sendAttributeChangedEvent, sendAttributeChangedEvent, sendEdgeAdded, sendEdgeAdded, sendEdgeAttributeAdded, sendEdgeAttributeAdded, sendEdgeAttributeChanged, sendEdgeAttributeChanged, sendEdgeAttributeRemoved, sendEdgeAttributeRemoved, sendEdgeRemoved, sendEdgeRemoved, sendGraphAttributeAdded, sendGraphAttributeAdded, sendGraphAttributeChanged, sendGraphAttributeChanged, sendGraphAttributeRemoved, sendGraphAttributeRemoved, sendGraphCleared, sendGraphCleared, sendNodeAdded, sendNodeAdded, sendNodeAttributeAdded, sendNodeAttributeAdded, sendNodeAttributeChanged, sendNodeAttributeChanged, sendNodeAttributeRemoved, sendNodeAttributeRemoved, sendNodeRemoved, sendNodeRemoved, sendStepBegins, sendStepBeginsequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddAttributeSink, addElementSink, addSink, clearAttributeSinks, clearElementSinks, clearSinks, removeAttributeSink, removeElementSink, removeSinkpublic void readAll(String fileName) throws IOException
FileSourcereadAll in interface FileSourcefileName - Name of the file to read.IOException - If an I/O error occurs while reading.public void readAll(URL url) throws IOException
FileSourcereadAll in interface FileSourceurl - The URL of the file to read.IOException - If an I/O error occurs while reading.public void readAll(InputStream stream) throws IOException
FileSourcereadAll in interface FileSourcestream - The input stream to use for reading.IOException - If an I/O error occurs while reading.public void readAll(Reader reader) throws IOException
FileSourcereadAll in interface FileSourcereader - The reader to use.IOException - If an I/O error occurs while reading.public void begin(String fileName) throws IOException
FileSourceFileSource.nextEvents() or
FileSource.nextStep(). Once begin() has been called, you must finish the
reading process using FileSource.end(). You cannot call begin() twice
without having called FileSource.end() in between.begin in interface FileSourcefileName - Name of the file to read.IOException - If an I/O error occurs while reading.public void begin(URL url) throws IOException
FileSourceFileSource.nextEvents() or
FileSource.nextStep(). Once begin() has been called, you must finish the
reading process using FileSource.end(). You cannot call begin() twice
without having called FileSource.end() in between.begin in interface FileSourceurl - The URL of the file to read.IOException - If an I/O error occurs while reading.public void begin(InputStream stream) throws IOException
FileSourceFileSource.nextEvents() or
FileSource.nextStep(). Once begin() has been called, you must finish the
reading process using FileSource.end(). You cannot call begin() twice
without having called FileSource.end() in between.begin in interface FileSourcestream - The input stream to use for reading.IOException - If an I/O error occurs while reading.public void begin(Reader reader) throws IOException
FileSourceFileSource.nextEvents() or
FileSource.nextStep(). Once begin() has been called, you must finish the
reading process using FileSource.end(). You cannot call begin() twice
without having called FileSource.end() in between.begin in interface FileSourcereader - The file reader to use.IOException - If an I/O error occurs while reading.public abstract boolean nextEvents()
throws IOException
FileSourceFileSource.begin(InputStream) or FileSource.begin(String) before. This method
return true while there are still events to read.nextEvents in interface FileSourceIOException - If an I/O error occurs while reading.public boolean nextStep()
throws IOException
FileSourcenextStep in interface FileSourceIOException - If an I/O error occurs while reading.public void end()
throws IOException
FileSourceFileSource.nextEvents() or
FileSource.nextStep() did not returned false). You must call this method
after reading.end in interface FileSourceIOException - If an I/O error occurs while closing the file.Copyright © 2015. All rights reserved.