Dresden OCL Toolkit

tudresden.ocl.injection.ocl
Class SourceReflectionExtender.ReflectionConsumer

java.lang.Object
  extended bytudresden.ocl.injection.ocl.SourceReflectionExtender.ReflectionConsumer
All Implemented Interfaces:
InjectionConsumer
Enclosing class:
SourceReflectionExtender

final class SourceReflectionExtender.ReflectionConsumer
extends Object
implements InjectionConsumer


Field Summary
private  ClassLoader classLoader
           
private  JavaClass current_class
           
private  Class current_classobject
           
private  String packagename
          The package the source file is expected to be contained in.
 
Constructor Summary
(package private) SourceReflectionExtender.ReflectionConsumer(String packagename)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

packagename

private String packagename
The package the source file is expected to be contained in. Is null for the root package.


current_class

private JavaClass current_class

current_classobject

private Class current_classobject

classLoader

private final ClassLoader classLoader
Constructor Detail

SourceReflectionExtender.ReflectionConsumer

SourceReflectionExtender.ReflectionConsumer(String packagename)
Method Detail

onPackage

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

Specified by:
onPackage in interface InjectionConsumer
Throws:
InjectorParseException
See Also:
JavaFile.getPackageName()

onImport

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

Specified by:
onImport in interface InjectionConsumer
See Also:
JavaFile.findType(String)

onClass

public void onClass(JavaClass cc)
Description copied from interface: InjectionConsumer
Encountered a class header. Is also called for inner classes.

Specified by:
onClass in interface InjectionConsumer

onClassEnd

public void onClassEnd(JavaClass cc)
                throws IOException
Description copied from interface: InjectionConsumer
Encountered the end of a class.

Specified by:
onClassEnd in interface InjectionConsumer
Throws:
IOException
See Also:
InjectionConsumer.onClass(JavaClass)

onFileEnd

public void onFileEnd()
Description copied from interface: InjectionConsumer
Encountered the end of the input stream.

Specified by:
onFileEnd in interface InjectionConsumer

onBehaviourHeader

public void onBehaviourHeader(JavaBehaviour jb)
Description copied from interface: InjectionConsumer
Encountered the header of a java method. Is called additionally to InjectionConsumer.onClassFeature(JavaFeature, String).

Specified by:
onBehaviourHeader in interface InjectionConsumer

onAttributeHeader

public void onAttributeHeader(JavaAttribute ja)
Description copied from interface: InjectionConsumer
Encountered the header of a java attribute. Is called additionally to InjectionConsumer.onClassFeature(JavaFeature, String).

Specified by:
onAttributeHeader in interface InjectionConsumer

onClassFeature

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

Specified by:
onClassFeature in interface InjectionConsumer
Throws:
IOException
InjectorParseException

onDocComment

public boolean onDocComment(String doccomment)
Description copied from interface: InjectionConsumer
Encountered a java documentation comment. Is called for comments on class level only, i.e. inside a class, but outside of methods and attributes.

Specified by:
onDocComment in interface InjectionConsumer
Returns:
if false is returned, the next class feature is ignored.

onFileDocComment

public void onFileDocComment(String doccomment)
Description copied from interface: InjectionConsumer
Encountered a java documentation comment. Is called for comments on file level only, i.e. outside of any classes.

Specified by:
onFileDocComment in interface InjectionConsumer

Dresden OCL Toolkit

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