Class EditableJavaClass
java.lang.Object
com.github.tadukoo.java.javaclass.JavaClass
com.github.tadukoo.java.javaclass.EditableJavaClass
- All Implemented Interfaces:
JavaClassType,JavaCodeType,JavaTokens
Represents a class 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.javaclass.JavaClass
annotations, className, fields, implementsInterfaceNames, importStatements, innerClasses, innerElementsOrder, isAbstract, isFinal, isInnerClass, isStatic, javadoc, methods, multiLineComments, packageDeclaration, singleLineComments, staticCodeBlocks, superClassName, 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) voidvoidvoidaddImplementsInterfaceName(JavaType implementsInterfaceName) voidaddImplementsInterfaceName(String implementsInterfaceNameText) voidaddImplementsInterfaceNames(List<JavaType> implementsInterfaceNames) voidaddImplementsInterfaceNameTexts(List<String> implementsInterfaceNameTexts) voidaddImportName(String importName, boolean isStatic) voidaddImportNames(List<String> importNames, boolean isStatic) voidaddImportStatement(JavaImportStatement importStatement) voidaddImportStatements(List<JavaImportStatement> importStatements) voidaddInnerClass(JavaClass innerClass) voidaddInnerClasses(List<JavaClass> innerClasses) voidaddMethod(JavaMethod method) voidaddMethods(List<JavaMethod> methods) voidaddMultiLineComment(JavaMultiLineComment multiLineComment) voidaddMultiLineComments(List<JavaMultiLineComment> multiLineComments) voidaddSingleLineComment(JavaSingleLineComment singleLineComment) voidaddSingleLineComments(List<JavaSingleLineComment> singleLineComments) voidaddStaticCodeBlock(JavaStaticCodeBlock staticCodeBlock) voidaddStaticCodeBlocks(List<JavaStaticCodeBlock> staticCodeBlocks) builder()voidsetAbstract(boolean isAbstract) voidsetAnnotations(List<JavaAnnotation> annotations) voidsetClassName(JavaType className) voidsetClassName(String classNameText) voidvoidsetFinal(boolean isFinal) voidsetImplementsInterfaceNames(List<JavaType> implementsInterfaceNames) voidsetImplementsInterfaceNameTexts(List<String> implementsInterfaceNameTexts) voidsetImportNames(List<String> importNames, boolean isStatic) voidsetImportStatements(List<JavaImportStatement> importStatements) voidsetInnerClass(boolean isInnerClass) voidsetInnerClasses(List<JavaClass> innerClasses) voidsetInnerElementsOrder(List<com.github.tadukoo.util.tuple.Pair<JavaCodeTypes, String>> innerElementsOrder) voidsetJavadoc(Javadoc javadoc) voidsetMethods(List<JavaMethod> methods) voidsetMultiLineComments(List<JavaMultiLineComment> multiLineComments) voidsetPackageDeclaration(JavaPackageDeclaration packageDeclaration) voidsetPackageName(String packageName) voidsetSingleLineComments(List<JavaSingleLineComment> singleLineComments) voidsetStatic(boolean isStatic) voidsetStaticCodeBlocks(List<JavaStaticCodeBlock> staticCodeBlocks) voidsetSuperClassName(JavaType superClassName) voidsetSuperClassName(String superClassNameText) voidsetVisibility(Visibility visibility) Methods inherited from class com.github.tadukoo.java.javaclass.JavaClass
equals, getAnnotations, getClassName, getFields, getFieldsMap, getImplementsInterfaceNames, getImportStatements, getInnerClasses, getInnerClassesMap, getInnerElementsOrder, getJavaCodeType, getJavadoc, getMethods, getMethodsMap, getMultiLineComments, getPackageDeclaration, getSimpleClassName, getSingleLineComments, getStaticCodeBlocks, getSuperClassName, getVisibility, isAbstract, isEditable, isFinal, isInnerClass, 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
EditableJavaClass.EditableJavaClassBuilderto use to build a newEditableJavaClass
-
setInnerClass
public void setInnerClass(boolean isInnerClass) - Parameters:
isInnerClass- Whether this is an inner class or not
-
setPackageDeclaration
- Parameters:
packageDeclaration- Thepackage declarationof the class
-
setPackageName
- Parameters:
packageName- The package name of the class, which gets put in aJavaPackageDeclaration
-
addImportStatement
- Parameters:
importStatement- Animport statementof this class to be added
-
addImportStatements
- Parameters:
importStatements-import statementsof this class to be added
-
setImportStatements
- Parameters:
importStatements- Theimport statementsof this class
-
addImportName
- Parameters:
importName- The name of an import to add to the class (becomes aJavaImportStatement)isStatic- Whether the import is static or not
-
addImportNames
- Parameters:
importNames- The names of imports to add to the class (becomeimport statements)isStatic- Whether the imports are static or not
-
setImportNames
- Parameters:
importNames- The import names to set as the only imports on the class (they becomeimport statements)isStatic- Whether the imports are static or not
-
setJavadoc
- Parameters:
javadoc- TheJavadocfor the class
-
addAnnotation
- Parameters:
annotation- Anannotationto be added to the class - must be editable
-
addAnnotations
- Parameters:
annotations-annotationsto be added to the class - must be editable
-
setAnnotations
- Parameters:
annotations- Theannotationson the class - must be editable
-
setVisibility
- Parameters:
visibility- TheVisibilityof the class
-
setAbstract
public void setAbstract(boolean isAbstract) - Parameters:
isAbstract- Whether this is an abstract class or not
-
setStatic
public void setStatic(boolean isStatic) - Parameters:
isStatic- Whether this is a static class or not
-
setFinal
public void setFinal(boolean isFinal) - Parameters:
isFinal- Whether this is a final class or not
-
setClassName
- Parameters:
className- The name of the class, along with type parameters to form aJavaType
-
setClassName
- Parameters:
classNameText- The text to parse of the name of the class, along with type parameters to form aJavaType
-
setSuperClassName
- Parameters:
superClassName- The name of the class this one extends (can be null), along with type parameters to form aJavaType
-
setSuperClassName
- Parameters:
superClassNameText- The text to parse of the name of the class this one extends (can be null), along with type parameters to form aJavaType
-
addImplementsInterfaceName
- Parameters:
implementsInterfaceName- The name of an interfaces this class implements, along with type parameters to form aJavaType
-
addImplementsInterfaceName
- Parameters:
implementsInterfaceNameText- The text for the name of an interfaces this class implements, along with type parameters to form aJavaType
-
addImplementsInterfaceNames
- Parameters:
implementsInterfaceNames- The names of interfaces this class implements, along with type parameters to form aJavaType
-
addImplementsInterfaceNameTexts
- Parameters:
implementsInterfaceNameTexts- The text of the names of interfaces this class implements, along with type parameters to form aJavaType
-
setImplementsInterfaceNames
- Parameters:
implementsInterfaceNames- The names of interfaces this class implements, along with type parameters to form aJavaType
-
setImplementsInterfaceNameTexts
- Parameters:
implementsInterfaceNameTexts- The text for the names of interfaces this class implements, along with type parameters to form aJavaType
-
addStaticCodeBlock
- Parameters:
staticCodeBlock- Astatic code blockto be added inside the class - must be editable
-
addStaticCodeBlocks
- Parameters:
staticCodeBlocks-static code blocksto be added inside the class - must be editable
-
setStaticCodeBlocks
- Parameters:
staticCodeBlocks- Thestatic code blocksinside the class - must be editable
-
addSingleLineComment
- Parameters:
singleLineComment- Asingle-line commentto be added inside the class - must be editable
-
addSingleLineComments
- Parameters:
singleLineComments-single-line commentsto be added inside the class - must be editable
-
setSingleLineComments
- Parameters:
singleLineComments-single-line commentsinside the class - must be editable
-
addMultiLineComment
- Parameters:
multiLineComment- Amulti-line commentto be added inside the class - must be editable
-
addMultiLineComments
- Parameters:
multiLineComments-multi-line commentsto be added inside the class - must be editable
-
setMultiLineComments
- Parameters:
multiLineComments-multi-line commentsinside the class - must be editable
-
addInnerClass
- Parameters:
innerClass- An innerclassto be added inside the class - must be editable
-
addInnerClasses
- Parameters:
innerClasses- Innerclassesto be added inside the class - must be editable
-
setInnerClasses
- Parameters:
innerClasses- Innerclassesinside the class - must be editable
-
addField
- Parameters:
field- Afieldto be added to the class - must be editable
-
addFields
- Parameters:
fields-fieldsto be added to the class - must be editable
-
setFields
- Parameters:
fields- Thefieldson the class - must be editable
-
addMethod
- Parameters:
method- Amethodto add to the class - must be editable
-
addMethods
- Parameters:
methods-methodsto add to the class - must be editable
-
setMethods
- Parameters:
methods- Themethodsin the class - must be editable
-
setInnerElementsOrder
public void setInnerElementsOrder(List<com.github.tadukoo.util.tuple.Pair<JavaCodeTypes, String>> innerElementsOrder) - Parameters:
innerElementsOrder- The order of the elements inside the class
-