Class JMethod
java.lang.Object
org.palladiosimulator.protocom.lang.java.impl.JMethod
- All Implemented Interfaces:
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
-
Method Summary
Modifier and TypeMethodDescriptionCollection<? extends IJAnnotation>
body()
Code of the method as a string.boolean
isStatic()
name()
The name of the method.The flattened parameter list as a string.The name of the return type of this method.The static modifier.The throw statement.The visibility modifier of this method.withAnnotations
(Collection<? extends IJAnnotation> annotations) withImplementation
(String implementation) withMethodAnnotation
(String annotation) withParameters
(String parameters) withReturnType
(String returnType) withThrows
(String throwsType) withVisibilityModifier
(String visibility)
-
Constructor Details
-
JMethod
public JMethod()
-
-
Method Details
-
returnType
Description copied from interface:IJMethod
The name of the return type of this method. Default value is VOID.- Specified by:
returnType
in interfaceIJMethod
-
name
Description copied from interface:IJMethod
The name of the method. -
parameters
Description copied from interface:IJMethod
The flattened parameter list as a string.- Specified by:
parameters
in interfaceIJMethod
-
visibilityModifier
Description copied from interface:IJMethod
The visibility modifier of this method. Default value is PUBLIC.- Specified by:
visibilityModifier
in interfaceIJMethod
-
throwsType
Description copied from interface:IJMethod
The throw statement.- Specified by:
throwsType
in interfaceIJMethod
-
staticModifier
Description copied from interface:IJMethod
The static modifier. TODO: Move up.- Specified by:
staticModifier
in interfaceIJMethod
-
isStatic
public boolean isStatic() -
annotations
- Specified by:
annotations
in interfaceIJMethod
-
body
Description copied from interface:IJMethod
Code of the method as a string. If not set, the method will be treated as abstract. -
methodAnnotation
- Specified by:
methodAnnotation
in interfaceIJMethod
-
withReturnType
-
withName
-
withParameters
-
withImplementation
-
withVisibilityModifier
-
withStaticModifier
-
withThrows
-
withMethodAnnotation
-
withAnnotations
-