Class JavaClass

java.lang.Object
com.github.tadukoo.java.JavaClass
Direct Known Subclasses:
EditableJavaClass, UneditableJavaClass

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

    • isInnerClass

      protected boolean isInnerClass
      Whether this is an inner class or not
    • packageName

      protected String packageName
      The name of the package the class is in
    • imports

      protected List<String> imports
      The classes imported by the class
    • staticImports

      protected List<String> staticImports
      The classes imported statically by the class
    • javadoc

      protected Javadoc javadoc
      The Javadoc for the class
    • annotations

      protected List<JavaAnnotation> annotations
      The annotations on the class
    • visibility

      protected Visibility visibility
      The Visibility of the class
    • isStatic

      protected boolean isStatic
      Whether this is a static class or not
    • className

      protected String className
      The name of the class
    • superClassName

      protected String superClassName
      The name of the class this one extends (may be null)
    • innerClasses

      protected List<JavaClass> innerClasses
      Inner classes inside the class
    • fields

      protected List<JavaField> fields
      The fields on the class
    • methods

      protected List<JavaMethod> methods
      The methods in the class
  • Constructor Details

    • JavaClass

      protected JavaClass(boolean editable, boolean isInnerClass, String packageName, List<String> imports, List<String> staticImports, Javadoc javadoc, List<JavaAnnotation> annotations, Visibility visibility, boolean isStatic, String className, String superClassName, List<JavaClass> innerClasses, List<JavaField> fields, List<JavaMethod> methods)
      Constructs a new Java Class with the given parameters
      Parameters:
      editable - Whether this class is editable or not
      isInnerClass - Whether this is an inner class or not
      packageName - The name of the package the class is in
      imports - The classes imported by the class
      staticImports - The classes imported statically by the class
      javadoc - The Javadoc for the class
      annotations - The annotations on the class
      visibility - The Visibility of the class
      isStatic - Whether this is a static class or not
      className - The name of the class
      superClassName - The name of the class this one extends (may be null)
      innerClasses - Inner classes inside the class
      fields - The fields on the class
      methods - The methods in the class
  • Method Details

    • 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
    • getPackageName

      public String getPackageName()
      Returns:
      The name of the package the class is in
    • getImports

      public List<String> getImports()
      Returns:
      The classes imported by the class
    • getStaticImports

      public List<String> getStaticImports()
      Returns:
      The classes imported statically by 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
    • isStatic

      public boolean isStatic()
      Returns:
      Whether this class is static 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)
    • getInnerClasses

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

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

      public List<JavaMethod> getMethods()
      Returns:
      The methods in 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