Package 

Interface ArrayMirror

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

    
    public interface ArrayMirror
     implements ConcreteTypeMirror
                        

    The type of mirror used to represent arrays, as opposed to classes, type variables, wildcards, and void.

    • Method Summary

      Modifier and Type Method Description
      abstract ArrayMirror withComponent(TypeMirror component) Creates a type mirror with the passed specialized component.
      abstract ArrayMirror withTypeAnnotations(List<Annotation> annotations) Creates a copy of this type mirror that has been specialized to have the passed Type Annotations.
      abstract Object newInstance(Integer length) Create a new instance of this array type with the given length.
      abstract Type getCoreType() The Java Core Reflection type this mirror represents
      abstract AnnotatedArrayType getCoreAnnotatedType() The Java Core Reflection annotated type this mirror represents.
      abstract ArrayMirror getRaw() The mirror representing this type without any generic specialization
      abstract TypeMirror getComponent() The specialized component type of this mirror
      abstract Class<?> getJava() The raw Core Reflection class this mirror represents
      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.ConcreteTypeMirror

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

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

      • withComponent

         abstract ArrayMirror withComponent(TypeMirror component)

        Creates a type mirror with the passed specialized component. The passed component must be assignable to the raw component of this mirror.

      • withTypeAnnotations

         abstract ArrayMirror 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.

      • newInstance

         abstract Object newInstance(Integer length)

        Create a new instance of this array type with the given length. Returns an Object because there is no common superclass for arrays. Use ArrayReflect to access this array's values or cast if the result type is known. If this mirror represents a non-primitive array, the returned array is filled with null values.

      • getCoreType

         abstract Type getCoreType()

        The Java Core Reflection type this mirror represents

      • getCoreAnnotatedType

         abstract AnnotatedArrayType 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.

      • getRaw

         abstract ArrayMirror getRaw()

        The mirror representing this type without any generic specialization

      • getJava

         abstract Class<?> getJava()

        The raw Core Reflection class this mirror represents