Dresden OCL Toolkit

tudresden.ocl.injection
Interface InjectionConsumer

All Known Implementing Classes:
AnalysisConsumer, FileSaveConsumer, Instrumentor, SourceReflectionExtender.ReflectionConsumer, TestInjectionConsumer

public interface InjectionConsumer

Implementors of this interface get the results of the java parser.

An implementation may write to the ouput stream of the java parser. Therefore, the interface of each method specifies the position of the output stream, when the method is called. To test these positions, use TestInjectionConsumer.


Method Summary
 void onAttributeHeader(JavaAttribute ja)
          Encountered the header of a java attribute.
 void onBehaviourHeader(JavaBehaviour jb)
          Encountered the header of a java method.
 void onClass(JavaClass cc)
          Encountered a class header.
 void onClassEnd(JavaClass cc)
          Encountered the end of a class.
 void onClassFeature(JavaFeature cf, String doccomment)
          Called for attributes and methods.
 boolean onDocComment(String doccomment)
          Encountered a java documentation comment.
 void onFileDocComment(String doccomment)
          Encountered a java documentation comment.
 void onFileEnd()
          Encountered the end of the input stream.
 void onImport(String importname)
          Encountered an import statement.
 void onPackage(JavaFile javafile)
          Encountered a package statement.
 

Method Detail

onPackage

public void onPackage(JavaFile javafile)
               throws InjectorParseException
Encountered a package statement. This method is guaranteed to be called at most once.

Throws:
InjectorParseException
See Also:
JavaFile.getPackageName()

onImport

public void onImport(String importname)
Encountered an import statement. Imports are also saved in JavaFile.imports. This information may be used for mapping type names to types.

See Also:
JavaFile.findType(String)

onClass

public void onClass(JavaClass cc)
Encountered a class header. Is also called for inner classes.


onClassEnd

public void onClassEnd(JavaClass cc)
                throws IOException,
                       InjectorParseException
Encountered the end of a class.

Throws:
IOException
InjectorParseException
See Also:
onClass(JavaClass)

onBehaviourHeader

public void onBehaviourHeader(JavaBehaviour jb)
                       throws IOException
Encountered the header of a java method. Is called additionally to onClassFeature(JavaFeature, String).

Throws:
IOException

onAttributeHeader

public void onAttributeHeader(JavaAttribute ja)
                       throws IOException
Encountered the header of a java attribute. Is called additionally to onClassFeature(JavaFeature, String).

Throws:
IOException

onClassFeature

public void onClassFeature(JavaFeature cf,
                           String doccomment)
                    throws IOException,
                           InjectorParseException
Called for attributes and methods. Is called additionally to onBehaviourHeader(JavaBehaviour).

Throws:
IOException
InjectorParseException

onDocComment

public boolean onDocComment(String doccomment)
                     throws IOException
Encountered a java documentation comment. Is called for comments on class level only, i.e. inside a class, but outside of methods and attributes.

Returns:
if false is returned, the next class feature is ignored.
Throws:
IOException

onFileDocComment

public void onFileDocComment(String doccomment)
                      throws IOException
Encountered a java documentation comment. Is called for comments on file level only, i.e. outside of any classes.

Throws:
IOException

onFileEnd

public void onFileEnd()
Encountered the end of the input stream.


Dresden OCL Toolkit

Submit a bug
Developed at the Dresden University of Technology.
This software is published under the GNU Lesser General Public License.