Class GenClass

  • All Implemented Interfaces:
    AccessFlags

    public class GenClass
    extends Object
    implements AccessFlags
    Wrapper for a generated class. An instance is built by a Generator.
    Author:
    Uwe Finke
    • Constructor Detail

      • GenClass

        public GenClass​(int accessFlags,
                        String className,
                        Type superClass,
                        Type... implementedInterfaces)
        Constructor.
        Parameters:
        accessFlags - access bits
        className - name of the class
        superClass - type of the classes super class
        implementedInterfaces - optional types of interfaces
    • Method Detail

      • createField

        public GenField createField​(int fieldAccessFlags,
                                    Type type,
                                    String fieldName)
        Creates a field.
        Parameters:
        fieldAccessFlags - access bits of the field
        type - type of the field
        fieldName - name of the field
        Returns:
        field
      • createMethod

        public GenMethod createMethod​(int methodAccessFlags,
                                      Type returnType,
                                      String methodName,
                                      Type... args)
        Creates a method.
        Parameters:
        methodAccessFlags - access bits of the method
        returnType - return type of the method
        methodName - name of the method
        args - argument types of the method
        Returns:
        method
      • createConstructor

        public GenMethod createConstructor​(int methodAccessFlags,
                                           Type... args)
        Creates a constructor.
        Parameters:
        methodAccessFlags - access bits
        args - argument types of the constructor
        Returns:
        constructor (method with name '<init>')
      • createDefaultConstructor

        public void createDefaultConstructor()
        Creates an empty default constructor.
      • getName

        public String getName()
        Returns the class name.
        Returns:
        class name