Package 

Interface TypeVariableMirror

  • All Implemented Interfaces:
    dev.thecodewarrior.mirror.type.TypeMirror , dev.thecodewarrior.mirror.util.DeclarationMirror

    
    public interface TypeVariableMirror
     implements TypeMirror, DeclarationMirror
                        

    The type of mirror used to represent type variables.

    Note: Type variables' bounds will never be specialized, as doing so would require a significant increase in complexity in order to avoid infinite recursion and/or deadlocks. However, should a pressing enough need come up in the future to outweigh this increase in complexity, it is likely possible it could be added.

    • Method Summary

      Modifier and Type Method Description
      abstract TypeVariableMirror withTypeAnnotations(List<Annotation> annotations) Creates a copy of this type mirror that has been specialized to have the passed Type Annotations.
      abstract TypeVariable<?> getCoreType() The Java Core Reflection type this mirror represents
      abstract AnnotatedTypeVariable getCoreAnnotatedType() The Java Core Reflection annotated type this mirror represents.
      abstract TypeVariableMirror getRaw() The mirror representing this type without any generic specialization
      abstract List<TypeMirror> getBounds() The bounds of this type variable.
      abstract Class<?> getErasure() The JVM erasure of this type.
      abstract AnnotationList getTypeAnnotations() The type annotations present on this type.
      • Methods inherited from class dev.thecodewarrior.mirror.type.TypeVariableMirror

        asArrayMirror, asClassMirror, isAssignableFrom, toDeclarationString, toJavaDeclarationString, toJavaString, toKotlinDeclarationString, toKotlinString, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • withTypeAnnotations

         abstract TypeVariableMirror withTypeAnnotations(List<Annotation> annotations)

        Creates a copy of this type mirror that has been specialized to have the passed Type Annotations. Type annotations on this mirror will not carry over to the resulting mirror.

        Note that are not the annotations present on the class declaration, they are the annotations present on the use of the type.

      • getCoreAnnotatedType

         abstract AnnotatedTypeVariable getCoreAnnotatedType()

        The Java Core Reflection annotated type this mirror represents.

        !!NOTE!! The JVM implementations of AnnotatedType don't implement equals or hashCode, so they will equal neither each other nor this. If you need these methods pass any annotated type through Mirror.toCanonical.

      • getBounds

         abstract List<TypeMirror> getBounds()

        The bounds of this type variable. Types specializing this type variable must extend all of these.

        By default it contains the Object mirror.