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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollection<? extends IJAnnotation>body()Code of the method as a string.booleanisStatic()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:IJMethodThe name of the return type of this method. Default value is VOID.- Specified by:
returnTypein interfaceIJMethod
-
name
Description copied from interface:IJMethodThe name of the method. -
parameters
Description copied from interface:IJMethodThe flattened parameter list as a string.- Specified by:
parametersin interfaceIJMethod
-
visibilityModifier
Description copied from interface:IJMethodThe visibility modifier of this method. Default value is PUBLIC.- Specified by:
visibilityModifierin interfaceIJMethod
-
throwsType
Description copied from interface:IJMethodThe throw statement.- Specified by:
throwsTypein interfaceIJMethod
-
staticModifier
Description copied from interface:IJMethodThe static modifier. TODO: Move up.- Specified by:
staticModifierin interfaceIJMethod
-
isStatic
public boolean isStatic() -
annotations
- Specified by:
annotationsin interfaceIJMethod
-
body
Description copied from interface:IJMethodCode of the method as a string. If not set, the method will be treated as abstract. -
methodAnnotation
- Specified by:
methodAnnotationin interfaceIJMethod
-
withReturnType
-
withName
-
withParameters
-
withImplementation
-
withVisibilityModifier
-
withStaticModifier
-
withThrows
-
withMethodAnnotation
-
withAnnotations
-