public final class ExtractionUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ExtractionUtils.AssigningConstructor
Result of the extraction in
extractAssigningConstructor(Class, List) . |
Modifier and Type | Method and Description |
---|---|
static Type |
boxPrimitive(Type type)
Returns the boxed type of a primitive type.
|
static List<Field> |
collectStructuredFields(Class<?> clazz)
Returns the fields of a class for a
StructuredType . |
static List<Method> |
collectStructuredMethods(Class<?> clazz)
Collects all methods that qualify as methods of a
StructuredType . |
static List<Type> |
collectTypeHierarchy(Type type)
Collects the partially ordered type hierarchy (i.e.
|
static DataType |
createRawType(DataTypeLookup lookup,
Class<? extends TypeSerializer<?>> rawSerializer,
Class<?> conversionClass)
Creates a raw data type.
|
static ExtractionUtils.AssigningConstructor |
extractAssigningConstructor(Class<?> clazz,
List<Field> fields)
Checks whether the given constructor takes all of the given fields with matching (possibly
primitive) type and name.
|
static ValidationException |
extractionError(String message,
Object... args)
Helper method for creating consistent exceptions during extraction.
|
static ValidationException |
extractionError(Throwable cause,
String message,
Object... args)
Helper method for creating consistent exceptions during extraction.
|
static boolean |
hasFieldSetter(Class<?> clazz,
Field field)
Checks for a field setters.
|
static boolean |
hasStructuredFieldGetter(Class<?> clazz,
Field field)
Checks for a field getter.
|
static boolean |
isStructuredFieldMutable(Class<?> clazz,
Field field)
Checks if a field is mutable or immutable.
|
static Type |
resolveVariable(List<Type> typeHierarchy,
TypeVariable<?> variable)
Resolves a
TypeVariable using the given type hierarchy if possible. |
static Class<?> |
toClass(Type type)
|
static void |
validateStructuredClass(Class<?> clazz)
Validates the characteristics of a class for a
StructuredType such as accessibility. |
static void |
validateStructuredFieldReadability(Class<?> clazz,
Field field)
Validates if a field is properly readable either directly or through a getter.
|
public static ValidationException extractionError(String message, Object... args)
public static ValidationException extractionError(Throwable cause, String message, Object... args)
public static List<Type> collectTypeHierarchy(Type type)
public static DataType createRawType(DataTypeLookup lookup, @Nullable Class<? extends TypeSerializer<?>> rawSerializer, @Nullable Class<?> conversionClass)
public static Type resolveVariable(List<Type> typeHierarchy, TypeVariable<?> variable)
TypeVariable
using the given type hierarchy if possible.public static void validateStructuredClass(Class<?> clazz)
StructuredType
such as accessibility.public static List<Field> collectStructuredFields(Class<?> clazz)
StructuredType
.public static void validateStructuredFieldReadability(Class<?> clazz, Field field)
public static boolean isStructuredFieldMutable(Class<?> clazz, Field field)
true
if the field is properly
mutable. Returns false
if it is properly immutable.public static boolean hasFieldSetter(Class<?> clazz, Field field)
public static boolean hasStructuredFieldGetter(Class<?> clazz, Field field)
public static List<Method> collectStructuredMethods(Class<?> clazz)
StructuredType
.@Nullable public static ExtractionUtils.AssigningConstructor extractAssigningConstructor(Class<?> clazz, List<Field> fields)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.