Top Description Fields Constructors Methods
org.hibernate.validator.internal.util.privilegedactions

public final Class LoadClass

extends Object
implements PrivilegedAction<Class<?>>
Class Inheritance
All Implemented Interfaces
java.security.PrivilegedAction
Imports
java.lang.invoke.MethodHandles, java.security.PrivilegedAction, org.hibernate.validator.HibernateValidator, org.hibernate.validator.internal.util.logging.Log, .LoggerFactory

Loads a class specified by name.

If no class loader is provided, first the thread context class loader is tried, and finally Hibernate Validator's own class loader.

Note

When loading classes provided by the user (such as XML-configured beans or constraint types), the user class loader passed to the configuration must be passed.

Authors
Emmanuel Bernard, Hardy Ferentschik, Kevin Pollet <[email protected]> (C) 2011 SERLI, Gunnar Morling, Guillaume Smet

Field Summary

Modifier and TypeField and Description
private final ClassLoader
private final String
private final boolean
fallbackOnTCCL

when true, it will check the Thread Context ClassLoader when the class is not found in the provided one

private static final String
private final ClassLoader
private static final Log

Constructor Summary

AccessConstructor and Description
private
LoadClass(String className, ClassLoader classLoader, ClassLoader initialThreadContextClassLoader, boolean fallbackOnTCCL)

Method Summary

Modifier and TypeMethod and Description
public static LoadClass
action(String className, ClassLoader classLoader)

public static LoadClass
action(String className, ClassLoader classLoader, boolean fallbackOnTCCL)

public static LoadClass
action(String className, ClassLoader classLoader, ClassLoader initialThreadContextClassLoader)

in some cases, the TCCL has been overridden so we need to pass it explicitly.

private Class<?>
private Class<?>
public Class<?>
run()

Implements java.security.PrivilegedAction.run.

Performs the computation.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classLoaderback to summary
private final ClassLoader classLoader
classNameback to summary
private final String className
fallbackOnTCCLback to summary
private final boolean fallbackOnTCCL

when true, it will check the Thread Context ClassLoader when the class is not found in the provided one

HIBERNATE_VALIDATOR_CLASS_NAMEback to summary
private static final String HIBERNATE_VALIDATOR_CLASS_NAME
initialThreadContextClassLoaderback to summary
private final ClassLoader initialThreadContextClassLoader
LOGback to summary
private static final Log LOG

Constructor Detail

LoadClassback to summary
private LoadClass(String className, ClassLoader classLoader, ClassLoader initialThreadContextClassLoader, boolean fallbackOnTCCL)

Method Detail

actionback to summary
public static LoadClass action(String className, ClassLoader classLoader)
actionback to summary
public static LoadClass action(String className, ClassLoader classLoader, boolean fallbackOnTCCL)
actionback to summary
public static LoadClass action(String className, ClassLoader classLoader, ClassLoader initialThreadContextClassLoader)

in some cases, the TCCL has been overridden so we need to pass it explicitly.

loadClassInValidatorNameSpaceback to summary
private Class<?> loadClassInValidatorNameSpace()
loadNonValidatorClassback to summary
private Class<?> loadNonValidatorClass()
runback to summary
public Class<?> run()

Implements java.security.PrivilegedAction.run.

Doc from java.security.PrivilegedAction.run.

Performs the computation. This method will be called by AccessController.doPrivileged after enabling privileges.

Returns:Class<?>

a class-dependent value that may represent the results of the computation. Each class that implements PrivilegedAction should document what (if anything) this value represents.

Annotations
@Override