public abstract class Scope
extends java.lang.Object
Scope
.Constructor and Description |
---|
Scope() |
Modifier and Type | Method and Description |
---|---|
boolean |
canReleaseReferences()
Returns
true for scopes that are annotated with CanReleaseReferences or some
other annotation that is itself annotated with CanReleaseReferences . |
boolean |
isProductionScope()
Returns
true if this scope is the @ProductionScope scope. |
boolean |
isReusable()
Returns
true if this scope is the @Reusable scope. |
static boolean |
isScope(javax.lang.model.element.AnnotationMirror scopeAnnotation)
|
static boolean |
isScope(javax.lang.model.element.TypeElement scopeAnnotationType)
Returns
true if scopeAnnotationType is a Scope annotation. |
boolean |
isSingleton()
Returns
true if this scope is the @Singleton scope. |
com.google.common.collect.ImmutableSet<javax.lang.model.element.AnnotationMirror> |
releasableReferencesMetadata()
Returns the set of annotations on the scope that are themselves annotated with
CanReleaseReferences . |
java.util.Optional<javax.lang.model.element.AnnotationMirror> |
releasableReferencesMetadata(javax.lang.model.type.TypeMirror metadataType)
Returns the releasable references metadata
annotation of the given type, if there is one for this scope.
|
static Scope |
scope(javax.lang.model.element.AnnotationMirror scopeAnnotation)
Creates a
Scope object from the Scope -annotated annotation type. |
javax.lang.model.element.AnnotationMirror |
scopeAnnotation()
The
AnnotationMirror that represents the scope annotation. |
javax.lang.model.element.TypeElement |
scopeAnnotationElement()
The scope annotation element.
|
java.lang.String |
toString()
Returns a debug representation of the scope.
|
public final javax.lang.model.element.AnnotationMirror scopeAnnotation()
AnnotationMirror
that represents the scope annotation.public final javax.lang.model.element.TypeElement scopeAnnotationElement()
public static Scope scope(javax.lang.model.element.AnnotationMirror scopeAnnotation)
Scope
object from the Scope
-annotated annotation type.public static boolean isScope(javax.lang.model.element.AnnotationMirror scopeAnnotation)
public static boolean isScope(javax.lang.model.element.TypeElement scopeAnnotationType)
true
if scopeAnnotationType
is a Scope
annotation.public final boolean isSingleton()
true
if this scope is the @Singleton
scope.public final boolean isReusable()
true
if this scope is the @Reusable
scope.public final boolean isProductionScope()
true
if this scope is the @ProductionScope
scope.public final boolean canReleaseReferences()
true
for scopes that are annotated with CanReleaseReferences
or some
other annotation that is itself annotated with CanReleaseReferences
.public final com.google.common.collect.ImmutableSet<javax.lang.model.element.AnnotationMirror> releasableReferencesMetadata()
CanReleaseReferences
. These annotations are used as metadata for TypedReleasableReferenceManager
.public final java.util.Optional<javax.lang.model.element.AnnotationMirror> releasableReferencesMetadata(javax.lang.model.type.TypeMirror metadataType)
public java.lang.String toString()
toString
in class java.lang.Object