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()Stringbody()Code of the method as a string.booleanisStatic()StringmethodAnnotation()Stringname()The name of the method.Stringparameters()The flattened parameter list as a string.StringreturnType()The name of the return type of this method.StringstaticModifier()The static modifier.StringthrowsType()The throw statement.StringvisibilityModifier()The visibility modifier of this method.JMethodwithAnnotations(Collection<? extends IJAnnotation> annotations)JMethodwithImplementation(String implementation)JMethodwithMethodAnnotation(String annotation)JMethodwithName(String name)JMethodwithParameters(String parameters)JMethodwithReturnType(String returnType)JMethodwithStaticModifier()JMethodwithThrows(String throwsType)JMethodwithVisibilityModifier(String visibility)
-
-
-
Method Detail
-
returnType
public String returnType()
Description copied from interface:IJMethodThe name of the return type of this method. Default value is VOID.- Specified by:
returnTypein interfaceIJMethod
-
parameters
public String parameters()
Description copied from interface:IJMethodThe flattened parameter list as a string.- Specified by:
parametersin interfaceIJMethod
-
visibilityModifier
public String visibilityModifier()
Description copied from interface:IJMethodThe visibility modifier of this method. Default value is PUBLIC.- Specified by:
visibilityModifierin interfaceIJMethod
-
throwsType
public String throwsType()
Description copied from interface:IJMethodThe throw statement.- Specified by:
throwsTypein interfaceIJMethod
-
staticModifier
public String staticModifier()
Description copied from interface:IJMethodThe static modifier. TODO: Move up.- Specified by:
staticModifierin interfaceIJMethod
-
annotations
public Collection<? extends IJAnnotation> annotations()
- Specified by:
annotationsin interfaceIJMethod
-
body
public String body()
Description copied from interface:IJMethodCode of the method as a string. If not set, the method will be treated as abstract.
-
methodAnnotation
public String methodAnnotation()
- Specified by:
methodAnnotationin interfaceIJMethod
-
withStaticModifier
public JMethod withStaticModifier()
-
withAnnotations
public JMethod withAnnotations(Collection<? extends IJAnnotation> annotations)
-
-