Class AnnotatedTypeMirror.AnnotatedArrayType

  • All Implemented Interfaces:
    org.plumelib.util.DeepCopyable<AnnotatedTypeMirror>
    Enclosing class:
    AnnotatedTypeMirror

    public static class AnnotatedTypeMirror.AnnotatedArrayType
    extends AnnotatedTypeMirror
    Represents Array types in java. A multidimensional array type is represented as an array type whose component type is also an array type.
    • Method Detail

      • accept

        public <R,​P> R accept​(AnnotatedTypeVisitor<R,​P> v,
                                    P p)
        Description copied from class: AnnotatedTypeMirror
        Applies a visitor to this type.
        Specified by:
        accept in class AnnotatedTypeMirror
        Type Parameters:
        R - the return type of the visitor's methods
        P - the type of the additional parameter to the visitor's methods
        Parameters:
        v - the visitor operating on this type
        p - additional parameter to the visitor
        Returns:
        a visitor-specified result
      • getUnderlyingType

        public javax.lang.model.type.ArrayType getUnderlyingType()
        Description copied from class: AnnotatedTypeMirror
        Returns the underlying unannotated Java type, which this wraps.
        Overrides:
        getUnderlyingType in class AnnotatedTypeMirror
        Returns:
        the underlying type
      • setComponentType

        public void setComponentType​(AnnotatedTypeMirror type)
        Sets the component type of this array.
        Parameters:
        type - the component type
      • getComponentType

        public AnnotatedTypeMirror getComponentType()
        Returns the component type of this array.
        Returns:
        the component type of this array
      • deepCopy

        public AnnotatedTypeMirror.AnnotatedArrayType deepCopy​(boolean copyAnnotations)
        Description copied from class: AnnotatedTypeMirror
        Returns a deep copy of this type. A deep copy implies that each component type is copied recursively and the returned type refers to those copies in its component locations.

        Note: deepCopy provides two important properties in the returned copy:

        1. Structure preservation -- The exact structure of the original AnnotatedTypeMirror is preserved in the copy including all component types.
        2. Annotation preservation -- All of the annotations from the original AnnotatedTypeMirror and its components have been copied to the new type.
        If copyAnnotations is set to false, the second property, Annotation preservation, is removed. This is useful for cases in which the user may want to copy the structure of a type exactly but NOT its annotations.
        Specified by:
        deepCopy in class AnnotatedTypeMirror
        Returns:
        a deep copy
      • shallowCopy

        public AnnotatedTypeMirror.AnnotatedArrayType shallowCopy​(boolean copyAnnotations)
        Description copied from class: AnnotatedTypeMirror
        Returns a shallow copy of this type. A shallow copy implies that each component type in the output copy refers to the same object as the object being copied.
        Specified by:
        shallowCopy in class AnnotatedTypeMirror
        Parameters:
        copyAnnotations - whether copy should have annotations, i.e. whether field annotations should be copied.