Class AbstractJType

    • Constructor Detail

      • AbstractJType

        AbstractJType()
    • Method Detail

      • qualifiedName

        java.lang.String qualifiedName()
      • hashCode

        public abstract int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public final boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • simpleName

        public abstract java.lang.String simpleName()
        Description copied from interface: JType
        Get the simple name of this type.
        Specified by:
        simpleName in interface JType
        Returns:
        the type's simple name
      • toString

        public abstract java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • _class

        public JExpr _class()
        Description copied from interface: JType
        An expression of the form ThisType.class.
        Specified by:
        _class in interface JType
        Returns:
        the expression
      • _this

        public JExpr _this()
        Description copied from interface: JType
        An expression of the form ThisType.this. If the type is an array type, an exception is thrown.
        Specified by:
        _this in interface JType
        Returns:
        the expression
      • _super

        public JExpr _super()
        Description copied from interface: JType
        An expression of the form ThisType.super. If the type is an array type, an exception is thrown.
        Specified by:
        _super in interface JType
        Returns:
        the expression
      • array

        public JType array()
        Description copied from interface: JType
        An array of this type.
        Specified by:
        array in interface JType
        Returns:
        the array type
      • _new

        public JCall _new()
        Description copied from interface: JType
        Construct a new instance of this non-array type. If the type is an array type, an exception is thrown.
        Specified by:
        _new in interface JType
        Returns:
        the construction call
      • _new

        public JExpr _new​(JExpr dim)
        Description copied from interface: JType
        Construct a new instance of this array type. If the type is not an array type, an exception is thrown.
        Specified by:
        _new in interface JType
        Parameters:
        dim - the array size
        Returns:
        the construction call
      • _new

        public JExpr _new​(int dim)
        Description copied from interface: JType
        Construct a new instance of this array type. If the type is not an array type, an exception is thrown.
        Specified by:
        _new in interface JType
        Parameters:
        dim - the array size
        Returns:
        the construction call
      • _newArray

        public JArrayExpr _newArray()
        Description copied from interface: JType
        Create a new array of this type which is inline-initialized.
        Specified by:
        _newArray in interface JType
        Returns:
        the array, initially with zero elements
      • _newAnon

        public JAnonymousClassDef _newAnon()
        Description copied from interface: JType
        Construct a new anonymous subclass of this type.
        Specified by:
        _newAnon in interface JType
        Returns:
        the anonymous subclass definition
      • typeArg

        public JType typeArg​(java.lang.String... args)
        Description copied from interface: JType
        This type, with the given generic type arguments.
        Specified by:
        typeArg in interface JType
        Parameters:
        args - the type arguments
        Returns:
        the generic type
      • typeArg

        public JType typeArg​(JType... args)
        Description copied from interface: JType
        This type, with the given generic type arguments.
        Specified by:
        typeArg in interface JType
        Parameters:
        args - the type arguments
        Returns:
        the generic type
      • typeArg

        public JType typeArg​(java.lang.Class<?>... args)
        Description copied from interface: JType
        This type, with the given generic type arguments.
        Specified by:
        typeArg in interface JType
        Parameters:
        args - the type arguments
        Returns:
        the generic type
      • typeArgs

        public JType[] typeArgs()
        Description copied from interface: JType
        Get the type arguments of this type.
        Specified by:
        typeArgs in interface JType
        Returns:
        the type arguments of this type
      • erasure

        public JType erasure()
        Description copied from interface: JType
        The erasure of this type.
        Specified by:
        erasure in interface JType
        Returns:
        the erasure of this type
      • elementType

        public JType elementType()
        Description copied from interface: JType
        The element type, if this an array (otherwise null).
        Specified by:
        elementType in interface JType
        Returns:
        the element type, or null if it is not an array
      • box

        public JType box()
        Description copied from interface: JType
        The primitive-boxed version of this type.
        Specified by:
        box in interface JType
        Returns:
        the boxed version of this type
      • unbox

        public JType unbox()
        Description copied from interface: JType
        The primitive-unboxed version of this type.
        Specified by:
        unbox in interface JType
        Returns:
        the unboxed version of this type
      • wildcardExtends

        public JType wildcardExtends()
        Description copied from interface: JType
        Get a wildcard that extends this type.
        Specified by:
        wildcardExtends in interface JType
        Returns:
        the wildcard
      • wildcardSuper

        public JType wildcardSuper()
        Description copied from interface: JType
        Get a wildcard that this type extends.
        Specified by:
        wildcardSuper in interface JType
        Returns:
        the wildcard
      • nestedType

        public JType nestedType​(java.lang.String name)
        Description copied from interface: JType
        Get a nested type within this reference type.
        Specified by:
        nestedType in interface JType
        Parameters:
        name - the name of the nested type
        Returns:
        the nested type
      • $t

        public JType $t​(java.lang.String name)
        Description copied from interface: JType
        Get a nested type within this reference type.
        Specified by:
        $t in interface JType
        Parameters:
        name - the name of the nested type
        Returns:
        the nested type
      • field

        public JAssignableExpr field​(java.lang.String name)
        Description copied from interface: JType
        Look up a static field on this type.
        Specified by:
        field in interface JType
        Parameters:
        name - the field name
        Returns:
        the field expression
      • $v

        public JAssignableExpr $v​(java.lang.String name)
        Description copied from interface: JType
        Look up a static field on this type.
        Specified by:
        $v in interface JType
        Parameters:
        name - the field name
        Returns:
        the field expression
      • call

        public JCall call​(java.lang.String name)
        Description copied from interface: JType
        Call a static method on this type.
        Specified by:
        call in interface JType
        Parameters:
        name - the method to call
        Returns:
        the method call
      • call

        public JCall call​(javax.lang.model.element.ExecutableElement method)
        Description copied from interface: JType
        Call a static method on this type.
        Specified by:
        call in interface JType
        Parameters:
        method - the method to call
        Returns:
        the method call
      • methodRef

        public JExpr methodRef​(java.lang.String name)
        Description copied from interface: JType
        Get a method reference of this type.
        Specified by:
        methodRef in interface JType
        Parameters:
        name - the method name
        Returns:
        the method reference expression
      • methodRef

        public JExpr methodRef​(javax.lang.model.element.ExecutableElement method)
        Description copied from interface: JType
        Get a method reference of this type.
        Specified by:
        methodRef in interface JType
        Parameters:
        method - the method element
        Returns:
        the method reference expression
      • writeDirect

        abstract void writeDirect​(SourceFileWriter sourceFileWriter)
                           throws java.io.IOException
        Throws:
        java.io.IOException