Class JavaClass
java.lang.Object
com.github.tadukoo.java.javaclass.JavaClass
- All Implemented Interfaces:
JavaClassType,JavaCodeType,JavaTokens
- Direct Known Subclasses:
EditableJavaClass,UneditableJavaClass
Java Class is used to represent a class in Java.
- Since:
- Alpha v.0.2 (as old version that is now more like UneditableJavaClass), Alpha v.0.4 (as newer version)
- Version:
- Beta v.0.6
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<JavaAnnotation>Theannotationson the classprotected JavaTypeThe name of the class, along with type parameters to form aJavaTypeThefieldson the classThe names of interfaces this class implements, along with type parameters to form aJavaTypeprotected List<JavaImportStatement>Theimport statementsof the classInnerclassesinside the classprotected List<com.github.tadukoo.util.tuple.Pair<JavaCodeTypes,String>> The order of the elements inside the classprotected booleanWhether this is an abstract class or notprotected booleanWhether this is a final class or notprotected booleanWhether this is an inner class or notprotected booleanWhether this is a static class or notprotected JavadocTheJavadocfor the classprotected List<JavaMethod>Themethodsin the classprotected List<JavaMultiLineComment>Themulti-line commentsinside the classprotected JavaPackageDeclarationThepackage declarationof the classprotected List<JavaSingleLineComment>Thesingle-line commentsinside the classprotected List<JavaStaticCodeBlock>Thestatic code blocksinside the classprotected JavaTypeThe name of the class this one extends (can be null), along with type parameters to form aJavaTypeprotected VisibilityTheVisibilityof the classFields 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 -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJavaClass(boolean editable, boolean isInnerClass, JavaPackageDeclaration packageDeclaration, List<JavaImportStatement> importStatements, Javadoc javadoc, List<JavaAnnotation> annotations, Visibility visibility, boolean isAbstract, boolean isStatic, boolean isFinal, JavaType className, JavaType superClassName, List<JavaType> implementsInterfaceNames, List<JavaStaticCodeBlock> staticCodeBlocks, List<JavaSingleLineComment> singleLineComments, List<JavaMultiLineComment> multiLineComments, List<JavaClass> innerClasses, List<JavaField> fields, List<JavaMethod> methods, List<com.github.tadukoo.util.tuple.Pair<JavaCodeTypes, String>> innerElementsOrder) Constructs a new Java Class with the given parameters -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.github.tadukoo.java.JavaCodeType
escapeQuotes
-
Field Details
-
isInnerClass
protected boolean isInnerClassWhether this is an inner class or not -
packageDeclaration
Thepackage declarationof the class -
importStatements
Theimport statementsof the class -
javadoc
TheJavadocfor the class -
annotations
Theannotationson the class -
visibility
TheVisibilityof the class -
isAbstract
protected boolean isAbstractWhether this is an abstract class or not -
isStatic
protected boolean isStaticWhether this is a static class or not -
isFinal
protected boolean isFinalWhether this is a final class or not -
className
The name of the class, along with type parameters to form aJavaType -
superClassName
The name of the class this one extends (can be null), along with type parameters to form aJavaType -
implementsInterfaceNames
The names of interfaces this class implements, along with type parameters to form aJavaType -
staticCodeBlocks
Thestatic code blocksinside the class -
singleLineComments
Thesingle-line commentsinside the class -
multiLineComments
Themulti-line commentsinside the class -
innerClasses
Innerclassesinside the class -
fields
Thefieldson the class -
methods
Themethodsin the class -
innerElementsOrder
The order of the elements inside the class
-
-
Constructor Details
-
JavaClass
protected JavaClass(boolean editable, boolean isInnerClass, JavaPackageDeclaration packageDeclaration, List<JavaImportStatement> importStatements, Javadoc javadoc, List<JavaAnnotation> annotations, Visibility visibility, boolean isAbstract, boolean isStatic, boolean isFinal, JavaType className, JavaType superClassName, List<JavaType> implementsInterfaceNames, List<JavaStaticCodeBlock> staticCodeBlocks, List<JavaSingleLineComment> singleLineComments, List<JavaMultiLineComment> multiLineComments, List<JavaClass> innerClasses, List<JavaField> fields, List<JavaMethod> methods, List<com.github.tadukoo.util.tuple.Pair<JavaCodeTypes, String>> innerElementsOrder) Constructs a new Java Class with the given parameters- Parameters:
editable- Whether this class is editable or notisInnerClass- Whether this is an inner class or notpackageDeclaration- Thepackage declarationof the classimportStatements- Theimport statementsof the classjavadoc- TheJavadocfor the classannotations- Theannotationson the classvisibility- TheVisibilityof the classisAbstract- Whether this is an abstract class or notisStatic- Whether this is a static class or notisFinal- Whether this is a final class or notclassName- The name of the class, along with type parameters to form aJavaTypesuperClassName- The name of the class this one extends (can be null), along with type parameters to form aJavaTypeimplementsInterfaceNames- The names of interfaces this class implements, along with type parameters to form aJavaTypestaticCodeBlocks- Thestatic code blocksinside the classsingleLineComments- Thesingle-line commentsinside the classmultiLineComments- Themulti-line commentsinside the classinnerClasses- Innerclassesinside the classfields- Thefieldson the classmethods- Themethodsin the classinnerElementsOrder- The order of the elements inside the class
-
-
Method Details
-
getJavaCodeType
- Specified by:
getJavaCodeTypein interfaceJavaCodeType- Returns:
- What
typethis is
-
isEditable
public boolean isEditable()- Returns:
- Whether this class is editable or not
-
isInnerClass
public boolean isInnerClass()- Returns:
- Whether this is an inner class or not
-
getPackageDeclaration
- Returns:
- The
package declarationof the class
-
getImportStatements
- Returns:
- The
import statementsof the class
-
getJavadoc
- Returns:
- The
Javadocfor the class
-
getAnnotations
- Returns:
- The
annotationson the class
-
getVisibility
- Returns:
- The
Visibilityof the class
-
isAbstract
public boolean isAbstract()- Returns:
- Whether this class is abstract or not
-
isStatic
public boolean isStatic()- Returns:
- Whether this class is static or not
-
isFinal
public boolean isFinal()- Returns:
- Whether this class is final or not
-
getClassName
- Returns:
- The name of the class, along with type parameters to form a
JavaType
-
getSimpleClassName
- Returns:
- The simple name of the class, not including any type parameters
-
getSuperClassName
- Returns:
- The name of the class this one extends (can be null), along with type parameters to form a
JavaType
-
getImplementsInterfaceNames
- Returns:
- The names of interfaces this class implements, along with type parameters to form a
JavaType
-
getStaticCodeBlocks
- Returns:
- The
static code blocksinside this class
-
getSingleLineComments
- Returns:
- The
single-line commentsinside this class
-
getMultiLineComments
- Returns:
- The
multi-line commentsinside this class
-
getInnerClasses
- Returns:
- Inner
classesinside this class
-
getInnerClassesMap
- Returns:
- The
classesinside this class as a Map by class name
-
getFields
- Returns:
- The
fieldson the class
-
getFieldsMap
- Returns:
- The
fieldson the class as a Map by field name
-
getMethods
- Returns:
- The
methodsin the class
-
getMethodsMap
- Returns:
- The
methodson the class as a Map by method name (usingJavaMethod.getUniqueName())
-
getInnerElementsOrder
- Returns:
- The order of elements inside the class
-
toString
-
equals
-
toBuilderCode
- Specified by:
toBuilderCodein interfaceJavaCodeType- Returns:
- The String of code to build the
JavaCodeType
-