Package oracle.dbtools.plugin.api.types
Class TypeReflections
- java.lang.Object
-
- oracle.dbtools.plugin.api.types.TypeReflections
-
- All Implemented Interfaces:
java.lang.Iterable<TypeReflection<?>>
,TypeLocator
public class TypeReflections extends java.lang.Object implements TypeLocator, java.lang.Iterable<TypeReflection<?>>
Represents a set ofClass
instances that may be instantiated and injected usingInstanceLocator
- Since:
- 19.3.0
- Author:
- cdivilly
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TypeReflections.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TypeReflections.Builder
builder()
Produce a newTypeReflections.Builder
instanceboolean
contains(java.lang.Class<?> type)
Indicates if the specified type is known to thisTypeReflections
setboolean
equals(java.lang.Object obj)
<T> TypeReflection<T>
forType(java.lang.Class<T> type)
Returns theTypeReflection
for the specified type, note the type must be part of thisTypeReflections
set<T> TypeReflection<T>
get(java.lang.Class<T> type)
Synonym forforType(Class)
int
hashCode()
boolean
isIgnored(TypeQualifier<?> service)
Determines if the specified service type has been marked as ignored in this type setjava.util.Iterator<TypeReflection<?>>
iterator()
static java.lang.invoke.MethodHandles.Lookup
lookup()
Provide theMethodHandles.Lookup
service used for reflective constructor invocationTypeReflections.Builder
modify()
Modify thisTypeReflections
set.<T> java.util.Set<TypeReflection<? extends T>>
selectType(TypeQualifier<T> service)
Choose theTypeReflection
s that matches the specified criteriaInstances
singletons()
Provides access to singleton fields annotated withProvides
java.lang.String
toString()
java.util.Set<java.lang.Class<?>>
types()
Enumerate the types in thisTypeReflections
set
-
-
-
Method Detail
-
contains
public boolean contains(java.lang.Class<?> type)
Indicates if the specified type is known to thisTypeReflections
set- Parameters:
type
- The type to search for- Returns:
- true if the type is present, false otherwise
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
forType
public <T> TypeReflection<T> forType(java.lang.Class<T> type) throws java.lang.IllegalArgumentException
Returns theTypeReflection
for the specified type, note the type must be part of thisTypeReflections
set- Specified by:
forType
in interfaceTypeLocator
- Type Parameters:
T
- The type to search for- Parameters:
type
- The type to lookup- Returns:
TypeReflection
instance- Throws:
java.lang.IllegalArgumentException
- if the type is not part of this type reflection set
-
get
public <T> TypeReflection<T> get(java.lang.Class<T> type) throws java.lang.IllegalArgumentException
Synonym forforType(Class)
- Specified by:
get
in interfaceTypeLocator
- Type Parameters:
T
- The type to search for- Parameters:
type
- The type to lookup- Returns:
TypeReflection
instance- Throws:
java.lang.IllegalArgumentException
- if the type is not part of this type reflection set
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
isIgnored
public boolean isIgnored(TypeQualifier<?> service)
Determines if the specified service type has been marked as ignored in this type set- Parameters:
service
- The service to check- Returns:
- true if the service is ignored, false otherwise
-
iterator
public java.util.Iterator<TypeReflection<?>> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<TypeReflection<?>>
-
modify
public TypeReflections.Builder modify()
Modify thisTypeReflections
set. Produces aTypeReflections.Builder
instance initialized with the state of thisTypeReflections
set.- Returns:
TypeReflections.Builder
instance
-
selectType
public <T> java.util.Set<TypeReflection<? extends T>> selectType(TypeQualifier<T> service)
Description copied from interface:TypeLocator
Choose theTypeReflection
s that matches the specified criteria- Specified by:
selectType
in interfaceTypeLocator
- Type Parameters:
T
- The type of the service to find- Parameters:
service
- The qualifiers on the service- Returns:
Set
of matchingTypeReflection
instances
-
singletons
public Instances singletons()
Provides access to singleton fields annotated withProvides
- Returns:
Instances
instance which can be used to resolve singleton fields
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
types
public java.util.Set<java.lang.Class<?>> types()
Enumerate the types in thisTypeReflections
set- Returns:
Set
ofClass
instances
-
builder
public static TypeReflections.Builder builder()
Produce a newTypeReflections.Builder
instance- Returns:
TypeReflections.Builder
instance
-
lookup
public static java.lang.invoke.MethodHandles.Lookup lookup()
Provide theMethodHandles.Lookup
service used for reflective constructor invocation- Returns:
MethodHandles.Lookup
instance
-
-