org.argouml.language.java.generator
Class NamedCodePiece
java.lang.Object
org.argouml.language.java.generator.CodePiece
org.argouml.language.java.generator.NamedCodePiece
- Direct Known Subclasses:
- AnonymousClassCodePiece, AttributeCodePiece, ClassCodePiece, ClassifierEndCodePiece, InterfaceCodePiece, OperationCodePiece, PackageCodePiece
- public abstract class NamedCodePiece
- extends CodePiece
This is a code piece that has been identified by the parser to be
of a specific kind. See the subclasses for further details.
taken from:
JavaRE - Code generation and reverse engineering for UML and Java
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NamedCodePiece
public NamedCodePiece()
write
public abstract void write(BufferedReader reader,
BufferedWriter writer,
Stack parseStateStack)
throws IOException
- Write the code this piece represents to file. The stack in the
parameter list contains the parser state when traversing up and
down in nested classes and interfaces. The code that is written
is generated from the model, but if no appropriate model element
exists, then the original code is written in order to maintain
additionally source code.
- Parameters:
reader
- Read original code from this.writer
- Write code to this.parseStateStack
- Information with one stack frame for each
classifier that the parser has descended into.
- Throws:
IOException
- if we cannot write to the writer or
read from the reader.
ffCodePiece
public final void ffCodePiece(BufferedReader reader,
BufferedWriter writer)
throws IOException
- Read until the end of the code piece. As a precondition, the reader
must be positioned at the beginning of the code piece. If a writer
is given (not null), then everything that's read is written
to the writer. (Ususally, both reader and writer point to the same
file).
- Parameters:
reader
- Read original code from this.writer
- Write code to this.
- Throws:
IOException
- if we cannot write to the writer or
read from the reader.