public class GenericHierarchicalReader extends Object implements HierarchicalReader
| Constructor and Description |
|---|
GenericHierarchicalReader() |
| Modifier and Type | Method and Description |
|---|---|
Integer |
get()
Get the next character from the input stream.
|
String |
getFileName()
Get the name of the file to which the object is bound to.
|
int |
getLineNumber()
Get the line number to which the object is bound to.
|
int |
getPosition()
Get the position on the line to which the object is bound to.
|
SourceProvider |
getSourceProvider()
Get the source provider that provided this reader.
|
void |
include(Reader reader)
Include a new reader into the chain and start to use that child reader so
long as long exhausts.
|
void |
pushBack(Integer ch)
Readers should support lexical analyzers offering the possibility to push
some characters back to the input stream, when a lexical analyzer can not
decide its selection only consuming extra characters.
|
void |
set(String sourceFileName) |
void |
setFactory(Factory factory)
When a factory creates an instance of a class implementing this interface
this method is called to register the factory that created the instance.
|
public void setFactory(Factory factory)
FactoryManagedsetFactory in interface FactoryManagedfactory - the factory that manages the instance.public void include(Reader reader)
include in interface HierarchicalReaderreader - public String getFileName()
SourceLocationBoundgetFileName in interface SourceLocationBoundpublic int getLineNumber()
SourceLocationBoundgetLineNumber in interface SourceLocationBoundpublic int getPosition()
SourceLocationBoundgetPosition in interface SourceLocationBoundpublic void pushBack(Integer ch)
ReaderSome of the readers may limit the operation of this push back functionality not supporting tracking line numbers, position and file name when this method is used.
Lexical analyzers should push back the characters that were read from the reader the backward order as they were read. (Read last pushed back first.)
Implementation should ignore null parameter.
public Integer get()
public SourceProvider getSourceProvider()
ReadergetSourceProvider in interface ReaderCopyright © 2013 Verhas and Verhas Software Craftsmen. All Rights Reserved.