Package org.jfuncmachine.compiler.model
Class ConstructorDef
java.lang.Object
org.jfuncmachine.compiler.model.SourceElement
org.jfuncmachine.compiler.model.MethodDef
org.jfuncmachine.compiler.model.ConstructorDef
A special version of MethodDef for defining constructors
-
Field Summary
Fields inherited from class org.jfuncmachine.compiler.model.MethodDef
access, body, isLambda, isTailCallable, name, numCapturedParameters, parameters, returnType, startLabelFields inherited from class org.jfuncmachine.compiler.model.SourceElement
filename, lineNumber -
Constructor Summary
ConstructorsConstructorDescriptionConstructorDef(int access, Field[] parameters, Expression body) Create a constructor definitionConstructorDef(int access, Field[] parameters, Expression body, String filename, int lineNumber) Create a constructor definition -
Method Summary
Modifier and TypeMethodDescriptionstatic ConstructorDefgenerateWith(Field[] parameters) Generate a default constructor that just passes its arguments to the superclass constructorstatic ConstructorDefgenerateWith(Field[] parameters, String filename, int lineNumber) Generate a default constructor that just passes its arguments to the superclass constructorMethods inherited from class org.jfuncmachine.compiler.model.MethodDef
getReturnType, getTailCallVersion, resetMethods inherited from class org.jfuncmachine.compiler.model.SourceElement
generateException
-
Constructor Details
-
ConstructorDef
Create a constructor definition- Parameters:
access- The access flags for the constructorparameters- The name and type for each parameterbody- The code to execute for this constructor
-
ConstructorDef
public ConstructorDef(int access, Field[] parameters, Expression body, String filename, int lineNumber) Create a constructor definition- Parameters:
access- The access flags for the constructorparameters- The name and type for each parameterbody- The code to execute for this constructorfilename- The name of the file where this constructor is definedlineNumber- The line number in the source file where this constructor is defined
-
-
Method Details
-
generateWith
Generate a default constructor that just passes its arguments to the superclass constructor- Parameters:
parameters- The name and type for each parameter- Returns:
- A default constructor that only calls the superclass constructor
-
generateWith
Generate a default constructor that just passes its arguments to the superclass constructor- Parameters:
parameters- The name and type for each parameterfilename- The name of the file where this constructor is definedlineNumber- The line number in the source file where this constructor is defined- Returns:
- A default constructor that only calls the superclass constructor
-