Package com.github.tadukoo.java.method
Class EditableJavaMethod
java.lang.Object
com.github.tadukoo.java.method.JavaMethod
com.github.tadukoo.java.method.EditableJavaMethod
- All Implemented Interfaces:
JavaCodeType,JavaTokens
Represents a method in Java that can be modified
- Since:
- Alpha v.0.4
- Version:
- Beta v.0.6
- Author:
- Logan Ferree (Tadukoo)
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.github.tadukoo.java.method.JavaMethod
annotations, isAbstract, isFinal, isStatic, javadoc, lines, name, parameters, returnType, throwTypes, typeParameters, visibilityFields inherited from interface com.github.tadukoo.java.JavaCodeType
NEWLINE_WITH_2_TABS, NEWLINE_WITH_4_TABSFields inherited from interface com.github.tadukoo.java.JavaTokens
ABSTRACT_MODIFIER, ANNOTATION_START_TOKEN, ASSIGNMENT_OPERATOR_TOKEN, BLOCK_CLOSE_TOKEN, BLOCK_OPEN_TOKEN, CLASS_TOKEN, EXTENDS_TOKEN, FINAL_MODIFIER, IMPLEMENTS_TOKEN, IMPORT_TOKEN, JAVADOC_AUTHOR_TOKEN, JAVADOC_LINE_TOKEN, JAVADOC_PARAM_TOKEN, JAVADOC_RETURN_TOKEN, JAVADOC_SINCE_TOKEN, JAVADOC_START_TOKEN, JAVADOC_VERSION_TOKEN, LIST_SEPARATOR_TOKEN, MODIFIERS, MULTI_LINE_COMMENT_CLOSE_TOKEN, MULTI_LINE_COMMENT_START_TOKEN, PACKAGE_TOKEN, PARAMETER_CLOSE_TOKEN, PARAMETER_OPEN_TOKEN, PRIVATE_MODIFIER, PROTECTED_MODIFIER, PUBLIC_MODIFIER, SEMICOLON, SINGLE_LINE_COMMENT_TOKEN, STATIC_MODIFIER, THROWS_TOKEN, TYPE_PARAMETER_CLOSE_TOKEN, TYPE_PARAMETER_OPEN_TOKEN, VARARGS_TOKEN, VISIBILITY_MODIFIERS -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAnnotation(JavaAnnotation annotation) voidaddAnnotations(List<JavaAnnotation> annotations) voidvoidvoidaddParameter(JavaParameter parameter) voidaddParameter(String parameterText) voidaddParameters(List<JavaParameter> parameters) voidaddThrowType(String throwType) voidaddThrowTypes(List<String> throwTypes) voidaddTypeParameter(JavaTypeParameter typeParameter) voidaddTypeParameters(String typeParametersString) voidaddTypeParameters(List<JavaTypeParameter> typeParameters) builder()voidsetAbstract(boolean isAbstract) voidsetAnnotations(List<JavaAnnotation> annotations) voidsetFinal(boolean isFinal) voidsetJavadoc(Javadoc javadoc) voidvoidvoidsetParameters(List<JavaParameter> parameters) voidsetReturnType(JavaType returnType) voidsetReturnType(String returnTypeText) voidsetStatic(boolean isStatic) voidsetThrowTypes(List<String> throwTypes) voidsetTypeParameters(String typeParametersString) voidsetTypeParameters(List<JavaTypeParameter> typeParameters) voidsetVisibility(Visibility visibility) Methods inherited from class com.github.tadukoo.java.method.JavaMethod
equals, getAnnotations, getJavaCodeType, getJavadoc, getLines, getName, getParameters, getReturnType, getThrowTypes, getTypeParameters, getUniqueName, getVisibility, isAbstract, isEditable, isFinal, isStatic, toBuilderCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.github.tadukoo.java.JavaCodeType
escapeQuotes
-
Method Details
-
builder
- Returns:
- A new
EditableJavaMethod.EditableJavaMethodBuilderto use to build a newEditableJavaMethod
-
setJavadoc
- Parameters:
javadoc- TheJavadocon the method
-
addAnnotation
- Parameters:
annotation- Anannotationon the method to be added - must be editable
-
addAnnotations
- Parameters:
annotations-annotationson the method to be added - must be editable
-
setAnnotations
- Parameters:
annotations- Theannotationson the method - must be editable
-
setVisibility
- Parameters:
visibility- TheVisibilityof the method
-
setAbstract
public void setAbstract(boolean isAbstract) - Parameters:
isAbstract- Whether the method is abstract or not
-
setStatic
public void setStatic(boolean isStatic) - Parameters:
isStatic- Whether the method is static or not
-
setFinal
public void setFinal(boolean isFinal) - Parameters:
isFinal- Whether the method is final or not
-
setTypeParameters
- Parameters:
typeParameters- Anytype parametersfor the method
-
setTypeParameters
- Parameters:
typeParametersString- A String representing anytype parametersfor the method
-
addTypeParameters
- Parameters:
typeParameters-Type parametersto be added to the method
-
addTypeParameters
- Parameters:
typeParametersString- A String representingtype parametersto be added to the method
-
addTypeParameter
- Parameters:
typeParameter- Atype parameterto be added to the method
-
setReturnType
- Parameters:
returnType- The returntypeof the method
-
setReturnType
- Parameters:
returnTypeText- The text of the returntypeof the method to be parsed
-
setName
- Parameters:
name- The name of the method
-
addParameter
- Parameters:
parameterText- The text of theparameter, to be parsed and added
-
addParameter
- Parameters:
parameter- Aparameterused in the method to be added
-
addParameters
- Parameters:
parameters-Parametersused in the method to be added
-
setParameters
- Parameters:
parameters- Theparametersused in the method
-
addThrowType
- Parameters:
throwType- A type that can be thrown to add to the method
-
addThrowTypes
- Parameters:
throwTypes- Types that can be thrown to add to the method
-
setThrowTypes
- Parameters:
throwTypes- The types that can be thrown by the method
-
addLine
- Parameters:
line- An actual line of code to add to the method
-
addLines
- Parameters:
lines- Actual lines of code to add to the method
-
setLines
- Parameters:
lines- The actual lines of code in the method
-