keycloak
|
静的公開メンバ関数 | |
static< T > T | cast (Object obj) |
static Set< Field > | getAllDeclaredFields (Class<?> clazz) |
static Field | findDeclaredField (Class<?> clazz, String name) |
static Set< Annotation > | getAnnotationsWithMetaAnnotation (Set< Annotation > annotations, Class<? extends Annotation > metaAnnotationType) |
static boolean | methodExists (Class<?> clazz, String name) |
static Set< Method > | getAllDeclaredMethods (Class<?> clazz) |
static Method | findDeclaredMethod (Class<?> clazz, String name, Class<?>... args) |
static Constructor<?> | findDeclaredConstructor (Class<?> clazz, Class<?>... args) |
static Set< Constructor<?> > | getAllDeclaredConstructors (Class<?> clazz) |
static Class<?> | getMemberType (Member member) |
static< T > Class< T > | classForName (String name, ClassLoader... loaders) throws ClassNotFoundException |
static Object | invokeMethod (Method method, Object instance, Object... args) |
static Object | invokeMethod (boolean setAccessible, Method method, Object instance, Object... args) |
static< T > T | invokeMethod (Method method, Class< T > expectedReturnType, Object instance, Object... args) |
static< T > T | invokeMethod (boolean setAccessible, Method method, Class< T > expectedReturnType, Object instance, Object... args) |
static< A extends AccessibleObject > A | setAccessible (A member) |
static Object | getFieldValue (Field field, Object instance) |
static< T > T | getFieldValue (Field field, Object instance, Class< T > expectedType) |
static< T > Class< T > | getRawType (Type type) |
static boolean | isSerializable (Class<?> clazz) |
static Map< Class<?>, Type > | buildTypeMap (Set< Type > types) |
static boolean | isCacheable (Set< Annotation > annotations) |
static boolean | isCacheable (Annotation[] annotations) |
static String | getPropertyName (Method method) |
static boolean | isFinal (Class<?> clazz) |
static int | getNesting (Class<?> clazz) |
static boolean | isFinal (Member member) |
static boolean | isPrivate (Member member) |
static boolean | isTypeOrAnyMethodFinal (Class<?> type) |
static Object | getNonPrivateFinalMethodOrType (Class<?> type) |
static boolean | isPackagePrivate (int mod) |
static boolean | isStatic (Class<?> type) |
static boolean | isStatic (Member member) |
static boolean | isTransient (Member member) |
static boolean | isAbstract (Method method) |
static boolean | isArrayType (Class<?> rawType) |
static boolean | isParameterizedType (Class<?> type) |
static boolean | isParamerterizedTypeWithWildcard (Class<?> type) |
static boolean | containsWildcards (Type[] types) |
static boolean | isAssignableFrom (Class<?> rawType1, Type[] actualTypeArguments1, Class<?> rawType2, Type[] actualTypeArguments2) |
static boolean | matches (Class<?> rawType1, Type[] actualTypeArguments1, Class<?> rawType2, Type[] actualTypeArguments2) |
static boolean | isAssignableFrom (Type[] actualTypeArguments1, Type[] actualTypeArguments2) |
static boolean | isAssignableFrom (Type type1, Set<? extends Type > types2) |
static boolean | matches (Type type1, Set<? extends Type > types2) |
static boolean | isAssignableFrom (Type type1, Type[] types2) |
static boolean | isAssignableFrom (Type type1, Type type2) |
static boolean | matches (Type type1, Type type2) |
static boolean | isTypeBounded (Type type, Type[] lowerBounds, Type[] upperBounds) |
static boolean | isAssignableFrom (Class<?> rawType1, Type[] actualTypeArguments1, Type type2) |
static boolean | matches (Class<?> rawType1, Type[] actualTypeArguments1, Type type2) |
static boolean | isAssignableFrom (Set< Type > types1, Set< Type > types2) |
static boolean | matches (Set< Type > types1, Set< Type > types2) |
static boolean | isAssignableFrom (Set< Type > types1, Type type2) |
static boolean | isAssignableFrom (Type[] types1, Type type2) |
static boolean | isPrimitive (Type type) |
static< T > T | newInstance (final Class< T > fromClass) throws ClassNotFoundException, IllegalAccessException, InstantiationException |
static< T > T | newInstance (final Class<?> type, final String fullQualifiedName) throws ClassNotFoundException, IllegalAccessException, InstantiationException |
静的公開変数類 | |
static final Annotation [] | EMPTY_ANNOTATION_ARRAY = new Annotation[0] |
static final Object [] | EMPTY_OBJECT_ARRAY = new Object[0] |
static final Type [] | EMPTY_TYPES = {} |
static final Class<?> [] | EMPTY_CLASSES = new Class<?>[0] |
非公開メンバ関数 | |
Reflections () | |
静的非公開メンバ関数 | |
static String | buildInvokeMethodErrorMessage (Method method, Object obj, Object... args) |
static String | buildSetFieldValueErrorMessage (Field field, Object obj, Object value) |
static String | buildGetFieldValueErrorMessage (Field field, Object obj) |
Utility class for working with JDK Reflection and also CDI's {link Annotated} metadata.
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestatic |
|
inlinestatic |
Perform a runtime cast. Similar to Class#cast(Object), but useful when you do not have a Class object for type you wish to cast to.
Class#cast(Object) should be used if possible
<T> | the type to cast to |
obj | the object to perform the cast on |
ClassCastException | if the type T is not a subtype of the object |
|
inlinestatic |
Loads and initializes a class for the given name.
If the Thread Context Class Loader is available, it will be used, otherwise the classloader used to load Reflections will be used
It is also possible to specify additional classloaders to attempt to load the class with. If the first attempt fails, then these additional loaders are tried in order.
name | the name of the class to load |
loaders | additional classloaders to use to attempt to load the class |
ClassNotFoundException | if the class cannot be found |
|
inlinestatic |
|
inlinestatic |
Search the class hierarchy for a constructor with the given arguments. Will return the nearest match, starting with the class specified and searching up the hierarchy.
clazz | The class to search |
args | The arguments of the constructor to search for |
|
inlinestatic |
Search the class hierarchy for a field with the given name. Will return the nearest match, starting with the class specified and searching up the hierarchy.
clazz | The class to search |
name | The name of the field to search for |
|
inlinestatic |
Search the class hierarchy for a method with the given name and arguments. Will return the nearest match, starting with the class specified and searching up the hierarchy.
clazz | The class to search |
name | The name of the method to search for |
args | The arguments of the method to search for |
|
inlinestatic |
Get all the declared constructors on the class hierarchy. This will return overridden constructors.
clazz | The class to search |
|
inlinestatic |
Get all the declared fields on the class hierarchy. This will return overridden fields.
clazz | The class to search |
|
inlinestatic |
Get all the declared methods on the class hierarchy. This will return overridden methods.
clazz | The class to search |
|
inlinestatic |
Search for annotations with the specified meta annotation type
annotations | The annotation set to search |
metaAnnotationType | The type of the meta annotation to search for |
|
inlinestatic |
|
inlinestatic |
Get the value of the field, on the specified instance, casting the value of the field to the expected type.
This method wraps Field#get(Object), converting the checked exceptions that Field#get(Object) specifies to runtime exceptions.
<T> | the type of the field's value |
field | the field to operate on |
instance | the instance from which to retrieve the value |
expectedType | the expected type of the field's value |
RuntimeException | if the underlying field is inaccessible. |
IllegalArgumentException | if the specified instance is not an instance of the class or interface declaring the underlying field (or a subclass or implementor thereof). |
NullPointerException | if the specified instance is null and the field is an instance field. |
ExceptionInInitializerError | if the initialization provoked by this method fails. |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Gets the property name from a getter method.
We extend JavaBean conventions, allowing the getter method to have parameters
method | The getter method |
|
inlinestatic |
Extract the raw type, given a type.
<T> | the type |
type | the type to extract the raw type from |
|
inlinestatic |
Invoke the specified method on the provided instance, passing any additional arguments included in this method as arguments to the specified method.
This method provides the same functionality and throws the same exceptions as Reflections#invokeMethod(boolean, Method, Class, Object, Object...), with the expected return type set to Object and no change to the method's accessibility.
|
inlinestatic |
Invoke the specified method on the provided instance, passing any additional arguments included in this method as arguments to the specified method.
This method attempts to set the accessible flag of the method in a {link PrivilegedAction} before invoking the method if the first argument is true.
This method provides the same functionality and throws the same exceptions as Method, Class, Object, Object...), with the expected return type set to Object.
|
inlinestatic |
Invoke the specified method on the provided instance, passing any additional arguments included in this method as arguments to the specified method.
This method provides the same functionality and throws the same exceptions as Reflections#invokeMethod(boolean, Method, Class, Object, Object...), with the expected return type set to Object and honoring the accessibility of the method.
|
inlinestatic |
Invoke the method on the instance, with any arguments specified, casting the result of invoking the method to the expected return type.
This method wraps Method#invoke(Object, Object...), converting the checked exceptions that Method#invoke(Object, Object...) specifies to runtime exceptions.
If instructed, this method attempts to set the accessible flag of the method in a {link PrivilegedAction} before invoking the method.
setAccessible | flag indicating whether method should first be set as accessible |
method | the method to invoke |
instance | the instance to invoke the method |
args | the arguments to the method |
RuntimeException | if this Method object enforces Java language access control and the underlying method is inaccessible or if the underlying method throws an exception or if the initialization provoked by this method fails. |
IllegalArgumentException | if the method is an instance method and the specified instance argument is not an instance of the class or interface declaring the underlying method (or of a subclass or implementor thereof); if the number of actual and formal parameters differ; if an unwrapping conversion for primitive arguments fails; or if, after possible unwrapping, a parameter value cannot be converted to the corresponding formal parameter type by a method invocation conversion. |
NullPointerException | if the specified instance is null and the method is an instance method. |
ClassCastException | if the result of invoking the method cannot be cast to the expectedReturnType |
ExceptionInInitializerError | if the initialization provoked by this method fails. |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Check the assignability of one type to another, taking into account the actual type arguements
rawType1 | the raw type of the class to check |
actualTypeArguments1 | the actual type arguements to check, or an empty array if not a parameterized type |
rawType2 | the raw type of the class to check |
actualTypeArguments2 | the actual type arguements to check, or an empty array if not a parameterized type |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Check the assiginability of a set of flattened types. This algorithm will check whether any of the types1 matches a type in types2
types1 | |
types2 |
|
inlinestatic |
Check the assignability of a set of flattened types. This algorithm will check whether any of the types1 matches a type in types2
types1 | |
type2 |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Checks if type or member is final
type | Type or member |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Check whether whether any of the types1 matches a type in types2
types1 | |
types2 |
|
inlinestatic |
Determine if a method exists in a specified class hierarchy
clazz | The class to search |
name | The name of the method |
|
inlinestatic |
Creates a new instance of a class.
This method will use the same class loader of the given class to create the new instance.
fromClass | The class from where the instance should be created. |
ClassNotFoundException | |
IllegalAccessException | |
InstantiationException |
|
inlinestatic |
Creates a new instance of a class given its fullQualifiedName
.
This method will use the same class loader of type
to create the new instance.
type | The class that will be used to get the class loader from. |
fullQualifiedName | The full qualified name of the class from which the instance will be created. |
ClassNotFoundException | |
IllegalAccessException | |
InstantiationException |
|
inlinestatic |
Set the accessibility flag on the AccessibleObject as described in AccessibleObject#setAccessible(boolean) within the context of a {link PrivilegedAction}.
<A> | member the accessible object type |
member | the accessible object |
|
static |
An empty array of type java.lang.annotation.Annotation, useful converting lists to arrays.
|
static |
|
static |
An empty array of type Object, useful for converting lists to arrays.
|
static |