Class Scopes
java.lang.Object
org.microbean.scopelet.Scopes
A utility class for working with scopes and their identifiers.
- Author:
- Laird Nelson
-
Constructor Summary
ConstructorsConstructorDescriptionScopes(Qualifiers aq, Qualifiers sq, AnnotationMirror metaNormalScope, AnnotationMirror metaPseudoScope, AnnotationMirror singletonScope, AnnotationMirror noneScope) Creates a newScopes.Scopes(Domain d, Qualifiers aq, Qualifiers sq) Creates a newScopes.Scopes(Domain d, Qualifiers aq, Qualifiers sq, AnnotationMirror metaNormalScope, AnnotationMirror metaPseudoScope, AnnotationMirror singletonScope, AnnotationMirror noneScope) Creates a newScopes. -
Method Summary
Modifier and TypeMethodDescriptionfindNormalScope(Collection<? extends AnnotationMirror> c) Returns the firstAnnotationMirrorthat is present in the suppliedCollectionofAnnotationMirrors, and their meta-annotations, for which an invocation of thenormalScope(AnnotationMirror)method returnstrue, ornull, if no suchAnnotationMirrorexists.findScope(Collection<? extends AnnotationMirror> c) Returns the firstAnnotationMirrorthat is present in the suppliedCollectionofAnnotationMirrors, and their meta-annotations, for which an invocation of thescope(AnnotationMirror)method returnstrue, ornull, if no suchAnnotationMirrorexists.final AnnotationMirrorReturns the non-null, determinateAnnotationMirrorthat can be used to designate otherAnnotationMirrors as normal scopes.final AnnotationMirrorReturns the non-null, determinateAnnotationMirrorthat can be used to designate otherAnnotationMirrors as scopes.final AnnotationMirrorReturns a non-null, determinateAnnotationMirrorrepresenting the identifier for the none scope.booleanReturnstrueif the suppliedAnnotationMirrorhas elements that might be used to indicate that it is a normal scope.booleanReturnstrueif and only if the suppliedAnnotationMirroris a normal scope identifier.booleanReturnstrueif and only if the suppliedAnnotationMirroris a pseudo-scope identifier.final booleanReturnstrueif and only if the suppliedAnnotationMirroris a scope identifier (either a pseudo-scope identifier or a normal scope identifier.final AnnotationMirrorReturns a non-null, determinateAnnotationMirrorrepresenting the identifier for the singleton pseudo-scope.
-
Constructor Details
-
Scopes
Creates a newScopes.- Parameters:
d- a non-nullDomainaq- a non-nullQualifierssq- a non-nullQualifiers- Throws:
NullPointerException- if any argument isnull- See Also:
-
Scopes
public Scopes(Qualifiers aq, Qualifiers sq, AnnotationMirror metaNormalScope, AnnotationMirror metaPseudoScope, AnnotationMirror singletonScope, AnnotationMirror noneScope) Creates a newScopes.- Parameters:
aq- a non-nullQualifierssq- a non-nullQualifiersmetaNormalScope- a non-nullAnnotationMirrordesignating anotherAnnotationMirroras identifying a normal scopemetaPseudoScope- a non-nullAnnotationMirrordesignating anotherAnnotationMirroras identifying a pseudo scopesingletonScope- a non-nullAnnotationMirroridentifying the singleton scopenoneScope- a non-nullAnnotationMirroridentifying the none scope- Throws:
NullPointerException- if any argument isnull- See Also:
-
Scopes
public Scopes(Domain d, Qualifiers aq, Qualifiers sq, AnnotationMirror metaNormalScope, AnnotationMirror metaPseudoScope, AnnotationMirror singletonScope, AnnotationMirror noneScope) Creates a newScopes.- Parameters:
d- aDomain; ifnull, thenmetaNormalScope,metaPseudoScope,singletonScope, andnoneScopemust be non-nullaq- a non-nullQualifierssq- a non-nullQualifiersmetaNormalScope- anAnnotationMirrordesignating anotherAnnotationMirroras identifying a normal scope; may benullin which casedmust be non-nullmetaPseudoScope- anAnnotationMirrordesignating anotherAnnotationMirroras identifying a pseudo scope; may benullin which casedmust be non-nullsingletonScope- anAnnotationMirroridentifying the singleton scope; may benullin which casedmust be non-nullnoneScope- anAnnotationMirroridentifying the none scope; may benullin which casedmust be non-null- Throws:
NullPointerException- ifaqorsqisnull, or ifdisnullin certain situations
-
-
Method Details
-
findNormalScope
Returns the firstAnnotationMirrorthat is present in the suppliedCollectionofAnnotationMirrors, and their meta-annotations, for which an invocation of thenormalScope(AnnotationMirror)method returnstrue, ornull, if no suchAnnotationMirrorexists.The search is conducted in a breadth-first manner.
- Parameters:
c- aCollectionofAnnotationMirrors; must not benull- Returns:
- the first
AnnotationMirrorthat is present in the suppliedCollectionofAnnotationMirrors, and their meta-annotations, for which an invocation of thenormalScope(AnnotationMirror)method returnstrue, ornull, if no suchAnnotationMirrorexists - Throws:
NullPointerException- ifcisnull
-
findScope
Returns the firstAnnotationMirrorthat is present in the suppliedCollectionofAnnotationMirrors, and their meta-annotations, for which an invocation of thescope(AnnotationMirror)method returnstrue, ornull, if no suchAnnotationMirrorexists.The search is conducted in a breadth-first manner.
- Parameters:
c- aCollectionofAnnotationMirrors; must not benull- Returns:
- the first
AnnotationMirrorthat is present in the suppliedCollectionofAnnotationMirrors, and their meta-annotations, for which an invocation of thescope(AnnotationMirror)method returnstrue, ornull, if no suchAnnotationMirrorexists - Throws:
NullPointerException- ifcisnull
-
noneScope
Returns a non-null, determinateAnnotationMirrorrepresenting the identifier for the none scope.- Returns:
- a non-
null, determinateAnnotationMirrorrepresenting the identifier for the none scope
-
normal
Returnstrueif the suppliedAnnotationMirrorhas elements that might be used to indicate that it is a normal scope.- Parameters:
a- a non-null, determinateAnnotationMirror- Returns:
trueif the suppliedAnnotationMirrorhas elements that might be used to indicate that it is a normal scope- Throws:
NullPointerException- ifaisnull- See Also:
-
metaNormalScope
Returns the non-null, determinateAnnotationMirrorthat can be used to designate otherAnnotationMirrors as normal scopes.- Returns:
- the non-
null, determinateAnnotationMirrorthat can be used to designate otherAnnotationMirrors as normal scopes
-
metaPseudoScope
Returns the non-null, determinateAnnotationMirrorthat can be used to designate otherAnnotationMirrors as scopes.- Returns:
- the non-
null, determinateAnnotationMirrorthat can be used to designate otherAnnotationMirrors as scopes
-
normalScope
Returnstrueif and only if the suppliedAnnotationMirroris a normal scope identifier.- Parameters:
a- anAnnotationMirror; must not benull- Returns:
trueif and only if the suppliedAnnotationMirroris a normal scope identifier- Throws:
NullPointerException- ifaisnull
-
pseudoScope
Returnstrueif and only if the suppliedAnnotationMirroris a pseudo-scope identifier.- Parameters:
a- anAnnotationMirror; must not benull- Returns:
trueif and only if the suppliedAnnotationMirroris a pseudo-scope identifier- Throws:
NullPointerException- ifaisnull
-
scope
Returnstrueif and only if the suppliedAnnotationMirroris a scope identifier (either a pseudo-scope identifier or a normal scope identifier.- Parameters:
a- anAnnotationMirror; must not benull- Returns:
trueif and only if the suppliedAnnotationMirroris a scope identifier (either a pseudo-scope identifier or a normal scope identifier- Throws:
NullPointerException- ifaisnull
-
singletonScope
Returns a non-null, determinateAnnotationMirrorrepresenting the identifier for the singleton pseudo-scope.- Returns:
- a non-
null, determinateAnnotationMirrorrepresenting the identifier for the singleton pseudo-scope
-