Dresden OCL Toolkit

tudresden.ocl.injection
Class JavaConstructor

java.lang.Object
  extended bytudresden.ocl.injection.JavaFeature
      extended bytudresden.ocl.injection.JavaBehaviour
          extended bytudresden.ocl.injection.JavaConstructor

public final class JavaConstructor
extends JavaBehaviour

Represents a constructor of a class parsed by the java parser.

See Also:
Injector

Field Summary
private  boolean is_wrapped
           
private  int last_param_end
          The index of the end of the last parameter of the parameter list in JavaBehaviour.literal.
private  int last_param_start
          The index of the start of the last parameter of the parameter list in JavaBehaviour.literal.
 
Fields inherited from class tudresden.ocl.injection.JavaBehaviour
literal, parameters, unmodifiableParameters
 
Fields inherited from class tudresden.ocl.injection.JavaFeature
name, type
 
Constructor Summary
JavaConstructor(JavaClass parent, int modifiers, String name)
           
 
Method Summary
 void addParameter(String paramtype, String paramname)
           
 int getAllowedModifiers()
          See Java Language Specification 8.6.3 "Constructor Modifiers"
 String getWrappedLiteral()
           
 void printMore(PrintStream o)
           
 void setLastParameterEnd(int pos)
          Sets last_param_end to the given value.
 void setLastParameterStart(int pos)
          Sets last_param_start to the given value.
 void setLiteral(String literal)
           
 
Methods inherited from class tudresden.ocl.injection.JavaBehaviour
addThrowable, getLiteral, getParameters, getThrowables
 
Methods inherited from class tudresden.ocl.injection.JavaFeature
getFile, getModifiers, getName, getPackageName, getParent, getType, isAbstract, isStatic, print
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

last_param_start

private int last_param_start
The index of the start of the last parameter of the parameter list in JavaBehaviour.literal. Is the index of the last comma, if there is more than one parameter or otherwise the index after the opening parent. Needed for getWrappedLiteral(), if this IS a constructor. Is initialized to -1.


last_param_end

private int last_param_end
The index of the end of the last parameter of the parameter list in JavaBehaviour.literal. Is the index of the closing bracket of the parameter list. Needed for getWrappedLiteral(), if this IS a constructor. Is initialized to -1.


is_wrapped

private boolean is_wrapped
Constructor Detail

JavaConstructor

public JavaConstructor(JavaClass parent,
                       int modifiers,
                       String name)
                throws InjectorParseException
Method Detail

addParameter

public final void addParameter(String paramtype,
                               String paramname)
Overrides:
addParameter in class JavaBehaviour

getWrappedLiteral

public final String getWrappedLiteral()
Specified by:
getWrappedLiteral in class JavaBehaviour

setLiteral

public final void setLiteral(String literal)
Overrides:
setLiteral in class JavaBehaviour

setLastParameterStart

public final void setLastParameterStart(int pos)
Sets last_param_start to the given value.

Overrides:
setLastParameterStart in class JavaBehaviour
Throws:
RuntimeException - if pos is negative.
See Also:
setLastParameterStart(int)

setLastParameterEnd

public final void setLastParameterEnd(int pos)
Sets last_param_end to the given value.

Overrides:
setLastParameterEnd in class JavaBehaviour
Throws:
RuntimeException - if pos is negative.
RuntimeException - if called more than once.
See Also:
setLastParameterEnd(int)

getAllowedModifiers

public final int getAllowedModifiers()
See Java Language Specification 8.6.3 "Constructor Modifiers"

Specified by:
getAllowedModifiers in class JavaFeature

printMore

public final void printMore(PrintStream o)
Overrides:
printMore in class JavaBehaviour

Dresden OCL Toolkit

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