public final class ReflectionUtils extends ObjectSE
| 修飾子と型 | クラスと説明 |
|---|---|
static class | ReflectionUtils.AnnotationFieldFilter 指定されたアノテーションの ReflectionUtils.FieldFilter。 |
static interface | ReflectionUtils.DescribedFieldFilter 説明のある ReflectionUtils.FieldFilter。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
static <T> T | createInstanceIfPresent(StringSE classname, T defaultInstance) 指定された完全修飾名でクラスのインスタンスを作成するか、クラスをロードまたはインスタンス化できない場合は、指定されたデフォルトインスタンスを返します。 |
static OptionalSE<ConstructorSE<?>> | findConstructor(ClassSE<?> type, ObjectSE... constructorArguments) 指定されたコンストラクター引数に一致する、指定された型のコンストラクターを検索します。 |
static FieldSE | findField(ClassSE<?> type, ReflectionUtils.DescribedFieldFilter filter) 指定された ReflectionUtils.DescribedFieldFilter に一致するフィールドを検索します。 |
static FieldSE | findField(ClassSE<?> type, ReflectionUtils.DescribedFieldFilter filter, boolean enforceUniqueness) 指定された ReflectionUtils.DescribedFieldFilter に一致するフィールドを検索します。 |
static FieldSE | findField(ClassSE<?> type, ReflectionUtils.FieldFilter filter) 指定された ReflectionUtils.FieldFilter に一致する指定されたクラスの最初のフィールドを検索します。 |
static FieldSE | findRequiredField(ClassSE<?> type, StringSE name) 指定された型の指定された名前のフィールドを検索します。 |
static MethodSE | findRequiredMethod(ClassSE<?> type, StringSE name, ClassSE<?>... parameterTypes) 指定されたクラスおよびパラメーター型の指定された名前のメソッドを返します。 |
static OptionalSE<MethodSE> | getMethod(ClassSE<?> type, StringSE name, ResolvableType... parameterTypes) 可能な場合は、指定された型で宣言された指定された名前とパラメーターを持つ MethodSE を返します。 |
static ObjectSE | getPrimitiveDefault(ClassSE<?> type) プリミティブ型のデフォルト値を取得します。 |
static boolean | isKotlinClass(ClassSE<?> type) 指定されたクラスが Kotlin クラスの場合は true を返します。 |
static boolean | isNullable(MethodParameter parameter) 指定された MethodParameter が NULL 可能かどうかを返します。 |
static boolean | isSupportedKotlinClass(ClassSE<?> type) 指定されたクラスがサポートされている Kotlin クラスの場合、true を返します。 |
static StreamSE<ClassSE<?>> | returnTypeAndParameters(MethodSE method) |
static void | setField(FieldSE field, ObjectSE target, ObjectSE value) 指定されたオブジェクトの指定されたフィールドを指定された値に設定します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEpublic static <T> T createInstanceIfPresent(StringSE classname, T defaultInstance)
classname - インスタンスを作成するための完全修飾クラス名。defaultInstance - 指定されたクラスをロードまたはインスタンス化できない場合にフォールバックするインスタンス。@Nullable public static FieldSE findField(ClassSE<?> type, ReflectionUtils.FieldFilter filter)
ReflectionUtils.FieldFilter に一致する指定されたクラスの最初のフィールドを検索します。type - null であってはなりません。filter - null であってはなりません。@Nullable public static FieldSE findField(ClassSE<?> type, ReflectionUtils.DescribedFieldFilter filter)
ReflectionUtils.DescribedFieldFilter に一致するフィールドを検索します。フィルターに一致するフィールドが 1 つだけであることを確認します。type - null であってはなりません。filter - null であってはなりません。ReflectionUtils.DescribedFieldFilter に一致するフィールド、または見つからない場合は null。IllegalStateExceptionSE - 一致するフィールドが複数見つかった場合 findField(Class, DescribedFieldFilter, boolean)@Nullable public static FieldSE findField(ClassSE<?> type, ReflectionUtils.DescribedFieldFilter filter, boolean enforceUniqueness)
ReflectionUtils.DescribedFieldFilter に一致するフィールドを検索します。enforceUniqueness が真の場合、フィルターに一致するフィールドが 1 つだけであることを確認します。type - null であってはなりません。filter - null であってはなりません。enforceUniqueness - フィールドの一意性を強制するかどうか ReflectionUtils.DescribedFieldFilter に一致するフィールド、または見つからない場合は null。IllegalStateExceptionSE - enforceUniqueness が真で、一致するフィールドが複数見つかった場合 public static FieldSE findRequiredField(ClassSE<?> type, StringSE name)
type - null であってはなりません。name - null または空であってはなりません。IllegalArgumentExceptionSE - フィールドが見つからない場合。public static void setField(FieldSE field, ObjectSE target, @Nullable ObjectSE value)
field - null であってはなりません。target - null であってはなりません。value -public static OptionalSE<ConstructorSE<?>> findConstructor(ClassSE<?> type, ObjectSE... constructorArguments)
type - null であってはなりません。constructorArguments - null であってはなりません。ConstructorSE。public static MethodSE findRequiredMethod(ClassSE<?> type, StringSE name, ClassSE<?>... parameterTypes)
type - null であってはなりません。name - null であってはなりません。parameterTypes - null であってはなりません。IllegalArgumentExceptionSE - メソッドを解決できない場合。public static StreamSE<ClassSE<?>> returnTypeAndParameters(MethodSE method)
method - null であってはなりません。public static OptionalSE<MethodSE> getMethod(ClassSE<?> type, StringSE name, ResolvableType... parameterTypes)
MethodSE を返します。type - null であってはなりません。name - null または空であってはなりません。parameterTypes - null であってはなりません。public static boolean isKotlinClass(ClassSE<?> type)
type が Kotlin クラスの場合は true。public static boolean isSupportedKotlinClass(ClassSE<?> type)
type がサポートされている Kotlin クラスの場合は true。public static boolean isNullable(MethodParameter parameter)
MethodParameter が NULL 可能かどうかを返します。null 可能パラメーターは、参照型であり、Kotlin でそのように定義されているものです。MethodParameter が NULL 可能である場合は true。Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.