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 ofClassinstances that may be instantiated and injected usingInstanceLocator- Since:
- 19.3.0
- Author:
- cdivilly
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTypeReflections.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TypeReflections.Builderbuilder()Produce a newTypeReflections.Builderinstancebooleancontains(java.lang.Class<?> type)Indicates if the specified type is known to thisTypeReflectionssetbooleanequals(java.lang.Object obj)<T> TypeReflection<T>forType(java.lang.Class<T> type)Returns theTypeReflectionfor the specified type, note the type must be part of thisTypeReflectionsset<T> TypeReflection<T>get(java.lang.Class<T> type)Synonym forforType(Class)inthashCode()booleanisIgnored(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.Lookuplookup()Provide theMethodHandles.Lookupservice used for reflective constructor invocationTypeReflections.Buildermodify()Modify thisTypeReflectionsset.<T> java.util.Set<TypeReflection<? extends T>>selectType(TypeQualifier<T> service)Choose theTypeReflections that matches the specified criteriaInstancessingletons()Provides access to singleton fields annotated withProvidesjava.lang.StringtoString()java.util.Set<java.lang.Class<?>>types()Enumerate the types in thisTypeReflectionsset
-
-
-
Method Detail
-
contains
public boolean contains(java.lang.Class<?> type)
Indicates if the specified type is known to thisTypeReflectionsset- 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:
equalsin classjava.lang.Object
-
forType
public <T> TypeReflection<T> forType(java.lang.Class<T> type) throws java.lang.IllegalArgumentException
Returns theTypeReflectionfor the specified type, note the type must be part of thisTypeReflectionsset- Specified by:
forTypein interfaceTypeLocator- Type Parameters:
T- The type to search for- Parameters:
type- The type to lookup- Returns:
TypeReflectioninstance- 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:
getin interfaceTypeLocator- Type Parameters:
T- The type to search for- Parameters:
type- The type to lookup- Returns:
TypeReflectioninstance- Throws:
java.lang.IllegalArgumentException- if the type is not part of this type reflection set
-
hashCode
public int hashCode()
- Overrides:
hashCodein 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:
iteratorin interfacejava.lang.Iterable<TypeReflection<?>>
-
modify
public TypeReflections.Builder modify()
Modify thisTypeReflectionsset. Produces aTypeReflections.Builderinstance initialized with the state of thisTypeReflectionsset.- Returns:
TypeReflections.Builderinstance
-
selectType
public <T> java.util.Set<TypeReflection<? extends T>> selectType(TypeQualifier<T> service)
Description copied from interface:TypeLocatorChoose theTypeReflections that matches the specified criteria- Specified by:
selectTypein interfaceTypeLocator- Type Parameters:
T- The type of the service to find- Parameters:
service- The qualifiers on the service- Returns:
Setof matchingTypeReflectioninstances
-
singletons
public Instances singletons()
Provides access to singleton fields annotated withProvides- Returns:
Instancesinstance which can be used to resolve singleton fields
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
types
public java.util.Set<java.lang.Class<?>> types()
Enumerate the types in thisTypeReflectionsset- Returns:
SetofClassinstances
-
builder
public static TypeReflections.Builder builder()
Produce a newTypeReflections.Builderinstance- Returns:
TypeReflections.Builderinstance
-
lookup
public static java.lang.invoke.MethodHandles.Lookup lookup()
Provide theMethodHandles.Lookupservice used for reflective constructor invocation- Returns:
MethodHandles.Lookupinstance
-
-