Class AnnotatedTypeMirror.AnnotatedArrayType
- java.lang.Object
-
- org.checkerframework.framework.type.AnnotatedTypeMirror
-
- org.checkerframework.framework.type.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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.checkerframework.framework.type.AnnotatedTypeMirror
AnnotatedTypeMirror.AnnotatedArrayType, AnnotatedTypeMirror.AnnotatedDeclaredType, AnnotatedTypeMirror.AnnotatedExecutableType, AnnotatedTypeMirror.AnnotatedIntersectionType, AnnotatedTypeMirror.AnnotatedNoType, AnnotatedTypeMirror.AnnotatedNullType, AnnotatedTypeMirror.AnnotatedPrimitiveType, AnnotatedTypeMirror.AnnotatedTypeVariable, AnnotatedTypeMirror.AnnotatedUnionType, AnnotatedTypeMirror.AnnotatedWildcardType
-
-
Field Summary
-
Fields inherited from class org.checkerframework.framework.type.AnnotatedTypeMirror
atypeFactory, EQUALITY_COMPARER, HASHCODE_VISITOR, primaryAnnotations, underlyingType
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R,P>
Raccept(AnnotatedTypeVisitor<R,P> v, P p)
Applies a visitor to this type.AnnotatedTypeMirror.AnnotatedArrayType
deepCopy()
Returns a deep copy of this type with annotations.AnnotatedTypeMirror.AnnotatedArrayType
deepCopy(boolean copyAnnotations)
Returns a deep copy of this type.AnnotatedTypeMirror
getComponentType()
Returns the component type of this array.AnnotatedTypeMirror.AnnotatedArrayType
getErased()
Returns the erasure type of this type, according to JLS specifications.javax.lang.model.type.ArrayType
getUnderlyingType()
Returns the underlying unannotated Java type, which this wraps.void
setComponentType(AnnotatedTypeMirror type)
Sets the component type of this array.AnnotatedTypeMirror.AnnotatedArrayType
shallowCopy()
Returns a shallow copy of this type with annotations.AnnotatedTypeMirror.AnnotatedArrayType
shallowCopy(boolean copyAnnotations)
Returns a shallow copy of this type.-
Methods inherited from class org.checkerframework.framework.type.AnnotatedTypeMirror
addAnnotation, addAnnotation, addAnnotations, addMissingAnnotation, addMissingAnnotations, asUse, clearAnnotations, containsUninferredTypeArguments, createType, createTypeOfObject, createTypeOfRecord, directSupertypes, equals, getAnnotation, getAnnotation, getAnnotationInHierarchy, getAnnotations, getAnnotationsField, getEffectiveAnnotation, getEffectiveAnnotationInHierarchy, getEffectiveAnnotations, getExplicitAnnotations, getKind, getPrimitiveKind, getUnderlyingTypeHashCode, hasAnnotation, hasAnnotation, hasAnnotationInHierarchy, hasAnnotationRelaxed, hasEffectiveAnnotation, hasEffectiveAnnotation, hasEffectiveAnnotationRelaxed, hasExplicitAnnotation, hasExplicitAnnotation, hasExplicitAnnotationRelaxed, hashCode, isAnnotatedInHierarchy, isDeclaration, removeAnnotation, removeAnnotationByClass, removeAnnotationInHierarchy, removeAnnotations, removeNonTopAnnotationInHierarchy, replaceAnnotation, replaceAnnotations, toString, toString
-
-
-
-
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 classAnnotatedTypeMirror
- Type Parameters:
R
- the return type of the visitor's methodsP
- the type of the additional parameter to the visitor's methods- Parameters:
v
- the visitor operating on this typep
- 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 classAnnotatedTypeMirror
- 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:
- Structure preservation -- The exact structure of the original AnnotatedTypeMirror is preserved in the copy including all component types.
- Annotation preservation -- All of the annotations from the original AnnotatedTypeMirror and its components have been copied to the new type.
- Specified by:
deepCopy
in classAnnotatedTypeMirror
- Returns:
- a deep copy
-
deepCopy
public AnnotatedTypeMirror.AnnotatedArrayType deepCopy()
Description copied from class:AnnotatedTypeMirror
Returns a deep copy of this type with annotations.Each subclass implements this method with the subclass return type. The method body must always be a call to deepCopy(true).
- Specified by:
deepCopy
in interfaceorg.plumelib.util.DeepCopyable<AnnotatedTypeMirror>
- Specified by:
deepCopy
in classAnnotatedTypeMirror
- Returns:
- a deep copy of this type with annotations
- See Also:
AnnotatedTypeMirror.deepCopy(boolean)
-
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 classAnnotatedTypeMirror
- Parameters:
copyAnnotations
- whether copy should have annotations, i.e. whether fieldannotations
should be copied.
-
shallowCopy
public AnnotatedTypeMirror.AnnotatedArrayType shallowCopy()
Description copied from class:AnnotatedTypeMirror
Returns a shallow copy of this type with annotations.Each subclass implements this method with the subclass return type. The method body must always be a call to shallowCopy(true).
- Specified by:
shallowCopy
in classAnnotatedTypeMirror
- Returns:
- a shallow copy of this type with annotations
- See Also:
AnnotatedTypeMirror.shallowCopy(boolean)
-
getErased
public AnnotatedTypeMirror.AnnotatedArrayType getErased()
Description copied from class:AnnotatedTypeMirror
Returns the erasure type of this type, according to JLS specifications.- Overrides:
getErased
in classAnnotatedTypeMirror
- Returns:
- the erasure of this AnnotatedTypeMirror, this is always a copy even if the erasure and the original type are equivalent
- See Also:
- https://docs.oracle.com/javase/specs/jls/se17/html/jls-4.html#jls-4.6
-
-