Package io.github.toolfactory.jvm.util
Class ObjectProvider
java.lang.Object
io.github.toolfactory.jvm.util.ObjectProvider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static interface
static class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectProvider
getExceptionHandler
(Map<Object, Object> context) static <F> F
private <F> F
getObjectInternal
(Class<? super F> clazz, Map<Object, Object> context) <T> T
getOrBuildObject
(Class<? super T> clazz, Map<Object, Object> context) private <T> T
getOrBuildObjectInternal
(Class<? super T> clazz, Map<Object, Object> context) private void
init
(int... versions) boolean
<T> boolean
markToBeInitializedViaExceptionHandler
(Class<? super T> clazz, Map<Object, Object> context) <T> boolean
markToBeInitializedViaExceptionHandler
(Class<? super T> clazz, Map<Object, Object> context, ObjectProvider.InitializationMarkViaExceptionHandler exception) (package private) boolean
putClassNameOptionalItem
(List<String> classNameOptionalItems, String value) static void
putIfAbsent
(Map<Object, Object> context, Supplier<ObjectProvider> objectProvider) (package private) Collection
<String> retrieveAllClassNameCombinations
(List<String> classNameItems, String separator) private <T> Class
<? super T> retrieveClass
(List<String> classNameItems, Collection<String> notFoundClasses, String separator) static void
setExceptionHandler
(Map<Object, Object> context, ObjectProvider.ExceptionHandler exceptionHandler)
-
Field Details
-
classNameItems
-
jVMVendorToClassSuffix
-
CLASS_NAME
-
jVMVersion
private int jVMVersion -
vendor
-
-
Constructor Details
-
ObjectProvider
public ObjectProvider(int... versions)
-
-
Method Details
-
init
private void init(int... versions) -
getOrBuildObject
-
putClassNameOptionalItem
-
getOrBuildObjectInternal
private <T> T getOrBuildObjectInternal(Class<? super T> clazz, Map<Object, Object> context) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException -
retrieveClass
private <T> Class<? super T> retrieveClass(List<String> classNameItems, Collection<String> notFoundClasses, String separator) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
retrieveAllClassNameCombinations
-
getObjectInternal
-
getObject
-
get
-
putIfAbsent
-
markToBeInitializedViaExceptionHandler
-
markToBeInitializedViaExceptionHandler
public <T> boolean markToBeInitializedViaExceptionHandler(Class<? super T> clazz, Map<Object, Object> context, ObjectProvider.InitializationMarkViaExceptionHandler exception) -
isMarkedToBeInitializedViaExceptionHandler
public boolean isMarkedToBeInitializedViaExceptionHandler(ObjectProvider.BuildingException exception) -
setExceptionHandler
public static void setExceptionHandler(Map<Object, Object> context, ObjectProvider.ExceptionHandler exceptionHandler) -
getExceptionHandler
-