Class ElementReflectionUtils
java.lang.Object
dev.getelements.elements.sdk.util.reflection.ElementReflectionUtils
- All Implemented Interfaces:
ElementStandardBeanProperties
Some basic utilities for accessing reflections within SDK code.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.getelements.elements.sdk.ElementStandardBeanProperties
ElementStandardBeanProperties.StandardBeanProperty<T>
-
Field Summary
Fields inherited from interface dev.getelements.elements.sdk.ElementStandardBeanProperties
ELEMENT_DEFINITION_RECORD, ELEMENT_DEFINITION_RECORD_PROPERTY, ELEMENT_RECORD, ELEMENT_RECORD_PROPERTY, ELEMENT_REGISTRY, ELEMENT_REGISTRY_PROPERTY, SERVICE_LOCATOR, SERVICE_LOCATOR_PROPERTY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ElementReflectionUtils
Gets the static shared instance.Gets thePackage
from the package-info class.getPackageForElementsAnnotations
(String name, ClassLoader classLoader) Gets thePackage
from the package-info class.Class
<?> getPackageInfo
(String name) Gets the package-infoClass
for the supplied package name.Class
<?> getPackageInfo
(String name, ClassLoader classLoader) Gets the package-infoClass
for the supplied package name.<T> T
injectBeanProperties
(T target, Object... objects) Injects the standard bean properties into the supplied object.
-
Constructor Details
-
ElementReflectionUtils
public ElementReflectionUtils()
-
-
Method Details
-
getInstance
Gets the static shared instance.- Returns:
- the
ElementReflectionUtils
-
getPackageInfo
Gets the package-infoClass
for the supplied package name.- Parameters:
name
- the package name- Returns:
- the
Package
-
getPackageInfo
Gets the package-infoClass
for the supplied package name.- Parameters:
name
- the package nameclassLoader
- theClassLoader
to use- Returns:
- the
Package
-
getPackageForElementsAnnotations
Gets thePackage
from the package-info class.- Parameters:
name
- the package name- Returns:
- the
Package
-
getPackageForElementsAnnotations
Gets thePackage
from the package-info class.- Parameters:
name
- the package nameclassLoader
- theClassLoader
to use- Returns:
- the
Package
-
injectBeanProperties
Injects the standard bean properties into the supplied object. Standard bean property names are defined inElementStandardBeanProperties
.- Type Parameters:
T
- the target type- Parameters:
target
- the targetobjects
- the beans- Returns:
- the target object
-