Class ImplJAnonymousClassDef

    • Constructor Detail

      • ImplJAnonymousClassDef

        ImplJAnonymousClassDef​(JType type)
    • Method Detail

      • type

        public JType type()
      • _extends

        public JClassDef _extends​(java.lang.String name)
        Description copied from interface: JClassDef
        Add an extends type to this type.
        Specified by:
        _extends in interface JClassDef
        Parameters:
        name - the type name
        Returns:
        this type definition
      • _extends

        public JClassDef _extends​(JType type)
        Description copied from interface: JClassDef
        Add an extends type to this type.
        Specified by:
        _extends in interface JClassDef
        Parameters:
        type - the type
        Returns:
        this type definition
      • _extends

        public JClassDef _extends​(java.lang.Class<?> clazz)
        Description copied from interface: JClassDef
        Add an extends type to this type.
        Specified by:
        _extends in interface JClassDef
        Parameters:
        clazz - the type
        Returns:
        this type definition
      • _implements

        public JClassDef _implements​(java.lang.String... names)
        Description copied from interface: JClassDef
        Add one or more implements type(s) to this type.
        Specified by:
        _implements in interface JClassDef
        Parameters:
        names - the type name
        Returns:
        this type definition
      • _implements

        public JClassDef _implements​(JType... types)
        Description copied from interface: JClassDef
        Add one or more implements type(s) to this type.
        Specified by:
        _implements in interface JClassDef
        Parameters:
        types - the type
        Returns:
        this type definition
      • _implements

        public JClassDef _implements​(java.lang.Class<?>... classes)
        Description copied from interface: JClassDef
        Add one or more implements type(s) to this type.
        Specified by:
        _implements in interface JClassDef
        Parameters:
        classes - the type
        Returns:
        this type definition
      • erasedType

        public JType erasedType()
        Description copied from interface: JClassDef
        Get the erased type corresponding to this type definition.
        Specified by:
        erasedType in interface JClassDef
        Returns:
        the erased type
      • genericType

        public JType genericType()
        Description copied from interface: JClassDef
        Get a generic type for this type definition, where the type arguments are the same as the type parameters of this type (as defined at the time this method is called).
        Specified by:
        genericType in interface JClassDef
        Returns:
        the generic type
      • typeParam

        public JTypeParamDef typeParam​(java.lang.String name)
        Description copied from interface: JGenericDef
        Define a type parameter.
        Specified by:
        typeParam in interface JGenericDef
        Parameters:
        name - the type parameter name
        Returns:
        the type parameter definition
      • init

        public JBlock init()
        Description copied from interface: JClassDefSection
        Add a "raw" initialization block to this type definition.
        Specified by:
        init in interface JClassDefSection
        Returns:
        the initialization block
      • staticInit

        public JBlock staticInit()
        Description copied from interface: JClassDefSection
        Add a static initialization block to this type definition.
        Specified by:
        staticInit in interface JClassDefSection
        Returns:
        the static initialization block
      • _enum

        public JEnumConstant _enum​(java.lang.String name)
        Description copied from interface: JClassDef
        Add an enum constant. If the class being defined is not an enum, an exception is thrown.
        Specified by:
        _enum in interface JClassDef
        Parameters:
        name - the constant name
        Returns:
        the call for enum construction
      • field

        public JVarDeclaration field​(int mods,
                                     JType type,
                                     java.lang.String name)
        Description copied from interface: JClassDefSection
        Add a field to this type.
        Specified by:
        field in interface JClassDefSection
        Parameters:
        mods - the modifiers
        type - the field type
        name - the field name
        Returns:
        the field declaration
      • field

        public JVarDeclaration field​(int mods,
                                     JType type,
                                     java.lang.String name,
                                     JExpr init)
        Description copied from interface: JClassDefSection
        Add a field to this type.
        Specified by:
        field in interface JClassDefSection
        Parameters:
        mods - the modifiers
        type - the field type
        name - the field name
        init - the field assigned value
        Returns:
        the field declaration
      • field

        public JVarDeclaration field​(int mods,
                                     java.lang.Class<?> type,
                                     java.lang.String name)
        Description copied from interface: JClassDefSection
        Add a field to this type.
        Specified by:
        field in interface JClassDefSection
        Parameters:
        mods - the modifiers
        type - the field type
        name - the field name
        Returns:
        the field declaration
      • field

        public JVarDeclaration field​(int mods,
                                     java.lang.Class<?> type,
                                     java.lang.String name,
                                     JExpr init)
        Description copied from interface: JClassDefSection
        Add a field to this type.
        Specified by:
        field in interface JClassDefSection
        Parameters:
        mods - the modifiers
        type - the field type
        name - the field name
        init - the field assigned value
        Returns:
        the field declaration
      • field

        public JVarDeclaration field​(int mods,
                                     java.lang.String type,
                                     java.lang.String name)
        Description copied from interface: JClassDefSection
        Add a field to this type.
        Specified by:
        field in interface JClassDefSection
        Parameters:
        mods - the modifiers
        type - the field type
        name - the field name
        Returns:
        the field declaration
      • field

        public JVarDeclaration field​(int mods,
                                     java.lang.String type,
                                     java.lang.String name,
                                     JExpr init)
        Description copied from interface: JClassDefSection
        Add a field to this type.
        Specified by:
        field in interface JClassDefSection
        Parameters:
        mods - the modifiers
        type - the field type
        name - the field name
        init - the field assigned value
        Returns:
        the field declaration
      • method

        public JMethodDef method​(int mods,
                                 JType returnType,
                                 java.lang.String name)
        Description copied from interface: JClassDefSection
        Add a method to this type.
        Specified by:
        method in interface JClassDefSection
        Parameters:
        mods - the modifiers
        returnType - the method return type
        name - the method name
        Returns:
        the method definition
      • method

        public JMethodDef method​(int mods,
                                 java.lang.Class<?> returnType,
                                 java.lang.String name)
        Description copied from interface: JClassDefSection
        Add a method to this type.
        Specified by:
        method in interface JClassDefSection
        Parameters:
        mods - the modifiers
        returnType - the method return type
        name - the method name
        Returns:
        the method definition
      • method

        public JMethodDef method​(int mods,
                                 java.lang.String returnType,
                                 java.lang.String name)
        Description copied from interface: JClassDefSection
        Add a method to this type.
        Specified by:
        method in interface JClassDefSection
        Parameters:
        mods - the modifiers
        returnType - the method return type
        name - the method name
        Returns:
        the method definition
      • constructor

        public JMethodDef constructor​(int mods)
        Description copied from interface: JClassDefSection
        Add a constructor to this type.
        Specified by:
        constructor in interface JClassDefSection
        Parameters:
        mods - the modifiers
        Returns:
        the constructor definition
      • typeParams

        public JTypeParamDef[] typeParams()
        Description copied from interface: JGenericDef
        Get all the type parameters defined at the time of invocation.
        Specified by:
        typeParams in interface JGenericDef
        Returns:
        the type parameters
      • annotate

        public JAnnotation annotate​(java.lang.String type)
        Description copied from interface: JAnnotatable
        Add an annotation.
        Specified by:
        annotate in interface JAnnotatable
        Parameters:
        type - the type of the annotation to add
        Returns:
        the new annotation
      • annotate

        public JAnnotation annotate​(JType type)
        Description copied from interface: JAnnotatable
        Add an annotation.
        Specified by:
        annotate in interface JAnnotatable
        Parameters:
        type - the type of the annotation to add
        Returns:
        the new annotation
      • annotate

        public JAnnotation annotate​(java.lang.Class<? extends java.lang.annotation.Annotation> type)
        Description copied from interface: JAnnotatable
        Add an annotation.
        Specified by:
        annotate in interface JAnnotatable
        Parameters:
        type - the type of the annotation to add
        Returns:
        the new annotation
      • _class

        public JClassDef _class​(int mods,
                                java.lang.String name)
        Description copied from interface: JClassDefSection
        Add a nested class to this type.
        Specified by:
        _class in interface JClassDefSection
        Parameters:
        mods - the class modifiers
        name - the class name
        Returns:
        the nested class
      • _enum

        public JClassDef _enum​(int mods,
                               java.lang.String name)
        Description copied from interface: JClassDefSection
        Add a nested enum to this type.
        Specified by:
        _enum in interface JClassDefSection
        Parameters:
        mods - the enum modifiers
        name - the enum name
        Returns:
        the nested enum
      • _interface

        public JClassDef _interface​(int mods,
                                    java.lang.String name)
        Description copied from interface: JClassDefSection
        Add a nested interface to this type.
        Specified by:
        _interface in interface JClassDefSection
        Parameters:
        mods - the interface modifiers
        name - the interface name
        Returns:
        the nested interface
      • annotationInterface

        public JClassDef annotationInterface​(int mods,
                                             java.lang.String name)
        Description copied from interface: JClassDefSection
        Add a nested annotation interface to this type.
        Specified by:
        annotationInterface in interface JClassDefSection
        Parameters:
        mods - the annotation interface modifiers
        name - the annotation interface name
        Returns:
        the nested annotation interface