|
Dresden OCL Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttudresden.ocl.injection.Injector
Implements a modifying java parser. This means, the input stream is continuesly written into an output stream, and may be modified before writing. The parser recognizes java meta information only, which is anything outside method bodies and attribute inizializers. To use the parser, provide an implemention of the InjectionConsumer interface to the constructor.
InjectionConsumer
Nested Class Summary | |
private class |
Injector.EndException
|
private class |
Injector.ParseException
|
Field Summary | |
private StringBuffer |
buf
|
private boolean |
collect_when_blocking
|
private StringBuffer |
collector
|
private String |
comment
|
private String |
commentBuf
|
private InjectionConsumer |
consumer
|
private boolean |
do_block
|
private String |
doccomment
|
private Reader |
input
|
private JavaFile |
javafile
|
private int |
linenumber
The line number in the current file. |
private int |
lineposition
The character in the current line. |
private char |
outbuf
|
private boolean |
outbufvalid
|
private Writer |
output
|
private boolean |
start_block
|
private char |
tokenBuf
|
Constructor Summary | |
Injector(Reader input,
Writer output,
InjectionConsumer consumer)
Constructs a new java parser. |
Method Summary | |
static Map |
extractDocParagraphs(String doccomment)
|
static String |
findDocTag(String doccomment,
String tagname)
|
private void |
flushOutbuf()
|
private String |
getCollector()
|
private static Map |
makeResult(Map result,
String tagname,
StringBuffer buf)
|
private JavaAttribute[] |
parseAttribute(JavaAttribute ja,
char c)
|
private void |
parseBehaviour(JavaBehaviour jb)
|
private char |
parseBody(boolean attribute)
Parses a method body or an attribute initializer, depending on the parameter. |
private JavaClass |
parseClass(JavaClass parent,
int modifiers)
|
private JavaFeature[] |
parseFeature(JavaClass parent)
Parses a class feature. |
private JavaFeature[] |
parseFeature(JavaClass parent,
String bufs)
The same as parseFeature(JavaClass) but the first token has already been fetched from the input stream. |
void |
parseFile()
|
char |
read()
|
private int |
readComment()
Reads a comment. |
private char |
readToken()
Splits the character stream into tokens. |
private void |
scheduleBlock(boolean collect_when_blocking)
|
private void |
write(String s)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Reader input
private Writer output
private InjectionConsumer consumer
private StringBuffer buf
private boolean do_block
private boolean start_block
private boolean collect_when_blocking
private StringBuffer collector
private String doccomment
private JavaFile javafile
private char outbuf
private boolean outbufvalid
private int linenumber
private int lineposition
private char tokenBuf
private String commentBuf
private String comment
Constructor Detail |
public Injector(Reader input, Writer output, InjectionConsumer consumer)
InjectionConsumer
Method Detail |
public final char read() throws IOException, Injector.EndException
IOException
Injector.EndException
private void scheduleBlock(boolean collect_when_blocking)
private String getCollector()
private void flushOutbuf() throws IOException
IOException
private void write(String s) throws IOException
IOException
private int readComment() throws IOException, Injector.EndException
IOException
Injector.EndException
private char readToken() throws IOException, Injector.EndException
IOException
Injector.EndException
private char parseBody(boolean attribute) throws IOException, Injector.EndException, Injector.ParseException
IOException
Injector.EndException
Injector.ParseException
private JavaFeature[] parseFeature(JavaClass parent) throws IOException, Injector.EndException, InjectorParseException
IOException
Injector.EndException
InjectorParseException
private JavaFeature[] parseFeature(JavaClass parent, String bufs) throws IOException, Injector.EndException, InjectorParseException
IOException
Injector.EndException
InjectorParseException
parseFeature(JavaClass)
private void parseBehaviour(JavaBehaviour jb) throws IOException, Injector.EndException, Injector.ParseException
IOException
Injector.EndException
Injector.ParseException
private JavaAttribute[] parseAttribute(JavaAttribute ja, char c) throws IOException, Injector.EndException, InjectorParseException
IOException
Injector.EndException
InjectorParseException
private JavaClass parseClass(JavaClass parent, int modifiers) throws IOException, Injector.EndException, InjectorParseException
IOException
Injector.EndException
InjectorParseException
public void parseFile() throws IOException, InjectorParseException
IOException
InjectorParseException
public static final String findDocTag(String doccomment, String tagname)
private static final Map makeResult(Map result, String tagname, StringBuffer buf)
public static final Map extractDocParagraphs(String doccomment)
|
Dresden OCL Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |