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.


Constructor Summary
NamedCodePiece()
           
 
Method Summary
 void ffCodePiece(java.io.BufferedReader reader, java.io.BufferedWriter writer)
          Read until the end of the code piece.
abstract  void write(java.io.BufferedReader reader, java.io.BufferedWriter writer, java.util.Stack parseStateStack)
          Write the code this piece represents to file.
 
Methods inherited from class org.argouml.language.java.generator.CodePiece
getEndLine, getEndPosition, getStartLine, getStartPosition, getText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamedCodePiece

public NamedCodePiece()
Method Detail

write

public abstract void write(java.io.BufferedReader reader,
                           java.io.BufferedWriter writer,
                           java.util.Stack parseStateStack)
                    throws java.lang.Exception
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.

ffCodePiece

public final void ffCodePiece(java.io.BufferedReader reader,
                              java.io.BufferedWriter writer)
                       throws java.lang.Exception
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.


ArgoUML (c) 1996-2002
ArgoUML Project Home
ArgoUML Cookbook