Package com.chemaxon.apidiscovery
Class Discovery
java.lang.Object
com.chemaxon.apidiscovery.Discovery
@Beta
@PublicAPI
@Deprecated(forRemoval=true)
@SubjectToRemoval(date=JAN_01_2025)
public final class Discovery
extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
The API discovery tool will be removed.
Utility methods for parameter discovery.
Please note that this class is marked with Beta
annotation, so it can be subject of incompatible changes
or removal in later releases.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Annotation>
TgetAnnotation
(Class<T> a, Object o) Deprecated, for removal: This API element is subject to removal in a future version.Retrieve an annotation on an object.static <T extends Annotation>
TgetAnnotationForClass
(Class<T> annotationClass, Class<?> clazz) Deprecated, for removal: This API element is subject to removal in a future version.Retrieve annotation for a class.static <T extends Annotation>
Optional<T>getAnnotationIfPresent
(Class<T> a, Object o) Deprecated, for removal: This API element is subject to removal in a future version.Retrieve an annotation on an object if present.static Description
Deprecated, for removal: This API element is subject to removal in a future version.Retrieve the description annotation on an object.static <T> Optional<ParameterBuilder<T>>
Deprecated, for removal: This API element is subject to removal in a future version.Create initial Builder if possible.static boolean
Deprecated, for removal: This API element is subject to removal in a future version.Check if an object is parametrized.static <T> List<CreatorWrapper<T>>
listCreators
(Object o, Class<T> targetType) Deprecated, for removal: This API element is subject to removal in a future version.CreatorWrapper acts as a type-dependent service loader.static <T> List<InstanceWrapper<T>>
listInstances
(Class<T> type) Deprecated, for removal: This API element is subject to removal in a future version.Collect instances of a specific type.static List<ParameterWrapper>
Deprecated, for removal: This API element is subject to removal in a future version.Retrieve parameters for a mutable parameter object.static <T> Optional<InstanceWrapper<T>>
selectInstance
(Class<T> type, String shortName) Deprecated, for removal: This API element is subject to removal in a future version.Look up an instance by its short name.
-
Method Details
-
listInstances
Deprecated, for removal: This API element is subject to removal in a future version.Collect instances of a specific type.- Type Parameters:
T
- Type to collect- Parameters:
type
- Type to collect- Returns:
- One or more instances of the specified type. Interfaces are retrieved as services; classes are instantiated with their nullary constructors; enums are enumerated
-
selectInstance
Deprecated, for removal: This API element is subject to removal in a future version.Look up an instance by its short name.- Type Parameters:
T
- Type to collect- Parameters:
type
- Type to collect (bylistInstances(java.lang.Class)
shortName
- Short name of the instance to select- Returns:
- The first matching instance if found
-
isParametrized
Deprecated, for removal: This API element is subject to removal in a future version.Check if an object is parametrized.- Parameters:
o
- Object in question- Returns:
- true if o is parametrized
-
listParameters
Deprecated, for removal: This API element is subject to removal in a future version.Retrieve parameters for a mutable parameter object.Parameter set mode is specified by
Parametrized.parameterSetMode()
on the objectsParametrized
annotation.- Parameters:
o
- Mutable parametrized object annotated withParametrized
- Returns:
- Parameters of o wrapped
- Throws:
IllegalArgumentException
- when o is not annotated withParametrized
or no parameters found
-
getAnnotationForClass
@Beta public static <T extends Annotation> T getAnnotationForClass(Class<T> annotationClass, Class<?> clazz) Deprecated, for removal: This API element is subject to removal in a future version.Retrieve annotation for a class.Note that enum constants are not handled by this method.
- Type Parameters:
T
- Annotation class- Parameters:
annotationClass
- Annotation classclazz
- Target class- Returns:
- Annotation retrieved
- Throws:
IllegalArgumentException
- when noDescription
annotation found
-
getAnnotationIfPresent
Deprecated, for removal: This API element is subject to removal in a future version.Retrieve an annotation on an object if present.- Type Parameters:
T
- Annotation class- Parameters:
a
- Annotation classo
- Object to examine- Returns:
- The description annotation if exist
-
getAnnotation
Deprecated, for removal: This API element is subject to removal in a future version.Retrieve an annotation on an object.- Type Parameters:
T
- Annotation class- Parameters:
a
- Annotation classo
- Object to examine- Returns:
- The annotation if exists or null; If o is an instance of an enum then enum constant annotation is retrieved
- Throws:
IllegalArgumentException
- when no annotation found
-
getDescriptionAnnotation
Deprecated, for removal: This API element is subject to removal in a future version.Retrieve the description annotation on an object.- Parameters:
o
- Object to examine- Returns:
- The description annotation if exists or null; If o is an instance of an enum then enum constant annotation is retrieved
- Throws:
IllegalArgumentException
- when noDescription
annotation found
-
listCreators
Deprecated, for removal: This API element is subject to removal in a future version.CreatorWrapper acts as a type-dependent service loader.Note that the order of the returned list is defined by
- Type Parameters:
T
- type to be created- Parameters:
targetType
- type to be createdo
- Instance on which the creators should be called- Returns:
- All distinct creator parameters
-
initializeBuilderIfExists
Deprecated, for removal: This API element is subject to removal in a future version.Create initial Builder if possible.Builder association is identified by annotation BuilderClass
- Type Parameters:
T
- Parameter object type- Parameters:
o
- An object- Returns:
- An associated builder instance if the parameter object has associated builder.
-