Class JMethod
- java.lang.Object
-
- org.palladiosimulator.protocom.lang.java.impl.JMethod
-
- All Implemented Interfaces:
IJMethod
public class JMethod extends Object implements IJMethod
Class representing a Java method. This is a data class. Since methods are not a compilation unit, they do not inherit GeneratedFile. A JMethod without name should be handled as a constructor. TODO: Change class to @Data ?
-
-
Constructor Summary
Constructors Constructor Description JMethod()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<? extends IJAnnotation>
annotations()
String
body()
Code of the method as a string.boolean
isStatic()
String
methodAnnotation()
String
name()
The name of the method.String
parameters()
The flattened parameter list as a string.String
returnType()
The name of the return type of this method.String
staticModifier()
The static modifier.String
throwsType()
The throw statement.String
visibilityModifier()
The visibility modifier of this method.JMethod
withAnnotations(Collection<? extends IJAnnotation> annotations)
JMethod
withImplementation(String implementation)
JMethod
withMethodAnnotation(String annotation)
JMethod
withName(String name)
JMethod
withParameters(String parameters)
JMethod
withReturnType(String returnType)
JMethod
withStaticModifier()
JMethod
withThrows(String throwsType)
JMethod
withVisibilityModifier(String visibility)
-
-
-
Method Detail
-
returnType
public String returnType()
Description copied from interface:IJMethod
The name of the return type of this method. Default value is VOID.- Specified by:
returnType
in interfaceIJMethod
-
parameters
public String parameters()
Description copied from interface:IJMethod
The flattened parameter list as a string.- Specified by:
parameters
in interfaceIJMethod
-
visibilityModifier
public String visibilityModifier()
Description copied from interface:IJMethod
The visibility modifier of this method. Default value is PUBLIC.- Specified by:
visibilityModifier
in interfaceIJMethod
-
throwsType
public String throwsType()
Description copied from interface:IJMethod
The throw statement.- Specified by:
throwsType
in interfaceIJMethod
-
staticModifier
public String staticModifier()
Description copied from interface:IJMethod
The static modifier. TODO: Move up.- Specified by:
staticModifier
in interfaceIJMethod
-
annotations
public Collection<? extends IJAnnotation> annotations()
- Specified by:
annotations
in interfaceIJMethod
-
body
public String body()
Description copied from interface:IJMethod
Code of the method as a string. If not set, the method will be treated as abstract.
-
methodAnnotation
public String methodAnnotation()
- Specified by:
methodAnnotation
in interfaceIJMethod
-
withStaticModifier
public JMethod withStaticModifier()
-
withAnnotations
public JMethod withAnnotations(Collection<? extends IJAnnotation> annotations)
-
-