Class JavaClass

java.lang.Object
com.github.tadukoo.parsing.code.java.JavaClass

public class JavaClass extends Object
Java Class is used to represent a class in Java.
Since:
Alpha v.0.2
Version:
Alpha v.0.3
Author:
Logan Ferree (Tadukoo)
  • Field Details

    • packageName

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

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

      private final List<String> staticImports
      The classes imported statically by the class
    • annotations

      private final List<JavaAnnotation> annotations
      The annotations on the class
    • visibility

      private final Visibility visibility
      The Visibility of the class
    • className

      private final String className
      The name of the class
    • superClassName

      private final String superClassName
      The name of the class this one extends (may be null)
    • fields

      private final List<JavaField> fields
      The fields on the class
    • methods

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

    • JavaClass

      private JavaClass(String packageName, List<String> imports, List<String> staticImports, List<JavaAnnotation> annotations, Visibility visibility, String className, String superClassName, List<JavaField> fields, List<JavaMethod> methods)
      Constructs a new Java Class with the given parameters
      Parameters:
      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
      annotations - The annotations on the class
      visibility - The Visibility of the class
      className - The name of the class
      superClassName - The name of the class this one extends (may be null)
      fields - The fields on the class
      methods - The methods in the class
  • Method Details

    • builder

      public static JavaClass.JavaClassBuilder builder()
      Returns:
      A new JavaClass.JavaClassBuilder to use to build a JavaClass
    • 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
    • getAnnotations

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

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