Class ClassDef

java.lang.Object
org.jfuncmachine.compiler.model.SourceElement
org.jfuncmachine.compiler.model.ClassDef
Direct Known Subclasses:
EnumDef

public class ClassDef extends SourceElement
A definition for a class, containing methods, fields, and the names of interfaces that are implemented
  • Field Details

    • packageName

      public final String packageName
      The package name of the class (may be null)
    • name

      public final String name
      The name of the class
    • superPackageName

      public final String superPackageName
      The package name of the superclass
    • superName

      public final String superName
      The class name of the superclass
    • access

      public final int access
      Any access flags for the class (can be a sum of values from the Access class)
    • methodDefs

      public final MethodDef[] methodDefs
      The methods defined for this class
    • fields

      public final ClassField[] fields
      The fields defined for this class
    • interfaces

      public final String[] interfaces
      The interfaces this class implements
  • Constructor Details

    • ClassDef

      public ClassDef(String packageName, String name, int access, MethodDef[] methodDefs, ClassField[] fields, String[] interfaces)
      Create a class definition
      Parameters:
      packageName - The package name of the class (may be null)
      name - The name of the class
      access - Any access flags for the class (can be a sum of values from the Access class)
      methodDefs - The methods defined for this class
      fields - The fields defined for this class
      interfaces - The interfaces this class implements
    • ClassDef

      public ClassDef(String packageName, String name, ClassDef superClass, int access, MethodDef[] methodDefs, ClassField[] fields, String[] interfaces)
      Create a class definition
      Parameters:
      packageName - The package name of the class (may be null)
      name - The name of the class
      superClass - The ClassDef of the superclass
      access - Any access flags for the class (can be a sum of values from the Access class)
      methodDefs - The methods defined for this class
      fields - The fields defined for this class
      interfaces - The interfaces this class implements
    • ClassDef

      public ClassDef(String packageName, String name, String superPackageName, String superName, int access, MethodDef[] methodDefs, ClassField[] fields, String[] interfaces)
      Create a class definition
      Parameters:
      packageName - The package name of the class (may be null)
      name - The name of the class
      superPackageName - The package name of the superclass
      superName - The name of the superclass
      access - Any access flags for the class (can be a sum of values from the Access class)
      methodDefs - The methods defined for this class
      fields - The fields defined for this class
      interfaces - The interfaces this class implements
    • ClassDef

      public ClassDef(String packageName, String name, int access, MethodDef[] methodDefs, ClassField[] fields, String[] interfaces, String filename, int lineNumber)
      Create a class definition
      Parameters:
      packageName - The package name of the class (may be null)
      name - The name of the class
      access - Any access flags for the class (can be a sum of values from the Access class)
      methodDefs - The methods defined for this class
      fields - The fields defined for this class
      interfaces - The interfaces this class implements
      filename - The source code filename this class was generated from
      lineNumber - The starting line number in the source code where this class is defined
    • ClassDef

      public ClassDef(String packageName, String name, ClassDef superClass, int access, MethodDef[] methodDefs, ClassField[] fields, String[] interfaces, String filename, int lineNumber)
      Create a class definition
      Parameters:
      packageName - The package name of the class (may be null)
      name - The name of the class
      superClass - The ClassDef of the superclass
      access - Any access flags for the class (can be a sum of values from the Access class)
      methodDefs - The methods defined for this class
      fields - The fields defined for this class
      interfaces - The interfaces this class implements
      filename - The source code filename this class was generated from
      lineNumber - The starting line number in the source code where this class is defined
    • ClassDef

      public ClassDef(String packageName, String name, String superPackageName, String superName, int access, MethodDef[] methodDefs, ClassField[] fields, String[] interfaces, String filename, int lineNumber)
      Create a class definition
      Parameters:
      packageName - The package name of the class (may be null)
      name - The name of the class
      superPackageName - The package name of the superclass
      superName - The name of the superclass
      access - Any access flags for the class (can be a sum of values from the Access class)
      methodDefs - The methods defined for this class
      fields - The fields defined for this class
      interfaces - The interfaces this class implements
      filename - The source code filename this class was generated from
      lineNumber - The starting line number in the source code where this class is defined
  • Method Details

    • getFullClassName

      public String getFullClassName()
      Returns the fully-qualified name of the class - package (if not null) + '.' + class name
      Returns:
      The fully-qualified name of this class