Dresden OCL Toolkit

tudresden.ocl.injection
Class JavaFeature

java.lang.Object
  extended bytudresden.ocl.injection.JavaFeature
Direct Known Subclasses:
JavaAttribute, JavaBehaviour, JavaClass

public abstract class JavaFeature
extends Object

Represents a java feature. May be a class (even an inner class), an attribute or a method.


Field Summary
private  JavaFile file
          The java file, which contains this feature.
private  int modifiers
          The modifiers of this feature.
protected  String name
           
private  JavaClass parent
          The class, which contains this feature.
protected  String type
          The return type of the method.
 
Constructor Summary
JavaFeature(JavaFile file, JavaClass parent, int modifiers, String type, String name)
           
 
Method Summary
abstract  int getAllowedModifiers()
          Subclasses use this method to specify, which modifiers are allowed for the specific kind of feature.
 JavaFile getFile()
          Returns the java file, which contains this feature.
 int getModifiers()
          Returns the modifiers of this feature.
 String getName()
           
 String getPackageName()
          Returns the package of the file containing this feature.
 JavaClass getParent()
          Returns the class, which contains this feature.
 String getType()
          The return type of the method.
 boolean isAbstract()
           
 boolean isStatic()
           
 void print(PrintStream o)
           
 void printMore(PrintStream o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

private JavaFile file
The java file, which contains this feature. Must not be null.


parent

private JavaClass parent
The class, which contains this feature. Is null for top-level (not inner) classes.


modifiers

private int modifiers
The modifiers of this feature.

See Also:
Modifier

type

protected String type
The return type of the method. Is null, if it is a constructor, or a class.


name

protected String name
Constructor Detail

JavaFeature

public JavaFeature(JavaFile file,
                   JavaClass parent,
                   int modifiers,
                   String type,
                   String name)
            throws InjectorParseException
Method Detail

getFile

public final JavaFile getFile()
Returns the java file, which contains this feature. Is never null.


getPackageName

public final String getPackageName()
Returns the package of the file containing this feature.


getParent

public final JavaClass getParent()
Returns the class, which contains this feature. Is null for top-level (not inner) classes.


getModifiers

public final int getModifiers()
Returns the modifiers of this feature.

See Also:
Modifier

getAllowedModifiers

public abstract int getAllowedModifiers()
Subclasses use this method to specify, which modifiers are allowed for the specific kind of feature.


isStatic

public final boolean isStatic()

isAbstract

public final boolean isAbstract()

getType

public final String getType()
The return type of the method. Is null, if it is a constructor, or a class.


getName

public final String getName()

print

public final void print(PrintStream o)

printMore

public void printMore(PrintStream o)

Dresden OCL Toolkit

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