Class JavaClass

java.lang.Object
com.github.tadukoo.java.javaclass.JavaClass
All Implemented Interfaces:
JavaClassType, JavaCodeType, JavaTokens
Direct Known Subclasses:
EditableJavaClass, UneditableJavaClass

public abstract class JavaClass extends Object implements JavaClassType
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.5
Author:
Logan Ferree (Tadukoo)
  • Field Details

  • Constructor Details

  • Method Details

    • getJavaCodeType

      public JavaCodeTypes getJavaCodeType()
      Specified by:
      getJavaCodeType in interface JavaCodeType
      Returns:
      What type this 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

      public JavaPackageDeclaration getPackageDeclaration()
      Returns:
      The package declaration of the class
    • getImportStatements

      public List<JavaImportStatement> getImportStatements()
      Returns:
      The import statements of the class
    • getJavadoc

      public Javadoc getJavadoc()
      Returns:
      The Javadoc for the class
    • getAnnotations

      public List<JavaAnnotation> getAnnotations()
      Returns:
      The annotations on the class
    • getVisibility

      public Visibility getVisibility()
      Returns:
      The Visibility of 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

      public String getClassName()
      Returns:
      The name of the class
    • getSuperClassName

      public String getSuperClassName()
      Returns:
      The name of the class this one extends (may be null)
    • getImplementsInterfaceNames

      public List<String> getImplementsInterfaceNames()
      Returns:
      The names of interfaces this class implements
    • getSingleLineComments

      public List<JavaSingleLineComment> getSingleLineComments()
      Returns:
      The single-line comments inside this class
    • getMultiLineComments

      public List<JavaMultiLineComment> getMultiLineComments()
      Returns:
      The multi-line comments inside this class
    • getInnerClasses

      public List<JavaClass> getInnerClasses()
      Returns:
      Inner classes inside this class
    • getInnerClassesMap

      public Map<String,JavaClass> getInnerClassesMap()
      Returns:
      The classes inside this class as a Map by class name
    • getFields

      public List<JavaField> getFields()
      Returns:
      The fields on the class
    • getFieldsMap

      public Map<String,JavaField> getFieldsMap()
      Returns:
      The fields on the class as a Map by field name
    • getMethods

      public List<JavaMethod> getMethods()
      Returns:
      The methods in the class
    • getMethodsMap

      public Map<String,JavaMethod> getMethodsMap()
      Returns:
      The methods on the class as a Map by method name (using JavaMethod.getUniqueName())
    • getInnerElementsOrder

      public List<com.github.tadukoo.util.tuple.Pair<JavaCodeTypes,String>> getInnerElementsOrder()
      Returns:
      The order of elements inside the class
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      The actual Java code this JavaClass represents
    • equals

      public boolean equals(Object otherClass)
      Overrides:
      equals in class Object
    • toBuilderCode

      public String toBuilderCode()
      Specified by:
      toBuilderCode in interface JavaCodeType
      Returns:
      The String of code to build the JavaCodeType