|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.dna.sequencer.text.AbstractTextSequencer
@ThreadSafe public abstract class AbstractTextSequencer
The base class for the text sequencers. This class treats the text to be sequenced as a series of rows, with each row delimited by a line terminator. Concrete subclasses provide their own mechanisms for splitting a row of data into a series of columns.
This class provides some fundamental capabilities, including the ability to set a comment
marker
, limit the number of lines
to be read from a file, and
provide custom transformations
from the sets of columns to the graph structure.
Constructor Summary | |
---|---|
AbstractTextSequencer()
|
Method Summary | |
---|---|
String |
getCommentMarker()
|
int |
getMaximumLinesToRead()
|
String |
getRowFactoryClassName()
|
void |
sequence(InputStream stream,
SequencerOutput output,
StreamSequencerContext context)
Sequence the data found in the supplied stream, placing the output information into the supplied map. |
void |
setCommentMarker(String commentMarker)
Sets the comment marker to use. |
void |
setMaximumLinesToRead(int maximumLinesToRead)
Sets the maximum number of lines to read. |
void |
setRowFactoryClassName(String rowFactoryClassName)
Sets the custom row factory class name. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractTextSequencer()
Method Detail |
---|
public void sequence(InputStream stream, SequencerOutput output, StreamSequencerContext context)
JBoss DNA's SequencingService determines the sequencers that should be executed by monitoring the changes to one or more workspaces that it is monitoring. Changes in those workspaces are aggregated and used to determine which sequencers should be called. If the sequencer implements this interface, then this method is called with the property that is to be sequenced along with the interface used to register the output. The framework takes care of all the rest.
sequence
in interface StreamSequencer
stream
- the stream with the data to be sequenced; never null
output
- the output from the sequencing operation; never null
context
- the context for the sequencing operation; never null
public void setCommentMarker(String commentMarker)
maximum line limitation
.
commentMarker
- the string that indicates that the line is a comment and should be ignored; null indicates that there
is no comment markerpublic String getCommentMarker()
public int getMaximumLinesToRead()
public void setMaximumLinesToRead(int maximumLinesToRead)
Comment lines
do not
count towards the number of lines read.
maximumLinesToRead
- the maximum number of lines to read; a non-positive number indicates that all lines should be
read and sequenced.public String getRowFactoryClassName()
public void setRowFactoryClassName(String rowFactoryClassName) throws ClassNotFoundException, IllegalAccessException, InstantiationException
RowFactory
class prior to modifying the row factory class name to ensure that the new value represents a valid implementation.
rowFactoryClassName
- the fully-qualified class name of the new custom row factory implementation; null indicates that
the default row factory
should be used.
ClassNotFoundException
- if the the named row factory class cannot be located
IllegalAccessException
- if the row factory class or its nullary constructor is not accessible.
InstantiationException
- if the row factory represents an abstract class, an interface, an array class, a primitive
type, or void; or if the class has no nullary constructor; or if the instantiation fails for some other reason.
ClassCastException
- if the instantiated row factory does not implement the RowFactory
interface
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |