Class BeanUtils

java.lang.Object
com.alibaba.fastjson2.util.BeanUtils

public abstract class BeanUtils extends Object
Author:
Bob Lee, Jesse Wilson, Shaojin Wen
  • Constructor Details

    • BeanUtils

      public BeanUtils()
  • Method Details

    • getRecordFieldNames

      public static String[] getRecordFieldNames(Class<?> recordType)
    • getKotlinConstructor

      public static void getKotlinConstructor(Class<?> objectClass, BeanInfo beanInfo)
    • getKotlinConstructorParameters

      public static String[] getKotlinConstructorParameters(Class<?> clazz)
    • fields

      public static void fields(Class objectClass, Consumer<Field> fieldReaders)
    • getMethod

      public static Method getMethod(Class objectClass, String methodName)
    • getDeclaredField

      public static Field getDeclaredField(Class objectClass, String fieldName)
    • declaredFields

      public static void declaredFields(Class objectClass, Consumer<Field> fieldConsumer)
    • staticMethod

      public static void staticMethod(Class objectClass, Consumer<Method> methodConsumer)
    • buildMethod

      public static Method buildMethod(Class objectClass, String methodName)
    • constructor

      public static void constructor(Class objectClass, Consumer<Constructor> constructorConsumer)
    • getConstructor

      public static Constructor[] getConstructor(Class objectClass)
    • getDefaultConstructor

      public static Constructor getDefaultConstructor(Class objectClass, boolean includeNoneStaticMember)
    • setters

      public static void setters(Class objectClass, Consumer<Method> methodConsumer)
    • setters

      public static void setters(Class objectClass, boolean checkPrefix, Consumer<Method> methodConsumer)
    • annotationMethods

      public static void annotationMethods(Class objectClass, Consumer<Method> methodConsumer)
    • isWriteEnumAsJavaBean

      public static boolean isWriteEnumAsJavaBean(Class clazz)
    • getEnumValueField

      public static Member getEnumValueField(Class clazz, ObjectCodecProvider mixinProvider)
    • getters

      public static void getters(Class objectClass, Consumer<Method> methodConsumer)
    • isRecord

      public static boolean isRecord(Class objectClass)
    • setterName

      public static String setterName(String methodName, String namingStrategy)
    • setterName

      public static String setterName(String methodName, int prefixLength)
    • getterName

      public static String getterName(Method method, String namingStrategy)
    • getterName

      public static String getterName(String methodName, String namingStrategy)
    • fieldName

      public static String fieldName(String methodName, String namingStrategy)
    • getFieldType

      public static Type getFieldType(TypeReference type, Class<?> raw, Member field, Type fieldType)
    • newParameterizedTypeWithOwner

      public static ParameterizedType newParameterizedTypeWithOwner(Type ownerType, Type rawType, Type... typeArguments)
      Returns a new parameterized type, applying typeArguments to rawType and enclosed by ownerType.
      Returns:
      a serializable parameterized type.
    • arrayOf

      public static GenericArrayType arrayOf(Type componentType)
      Returns an array type whose elements are all instances of componentType.
      Returns:
      a serializable generic array type.
    • subtypeOf

      public static WildcardType subtypeOf(Type bound)
      Returns a type that represents an unknown type that extends bound. For example, if bound is CharSequence.class, this returns ? extends CharSequence. If bound is Object.class, this returns ?, which is shorthand for ? extends Object.
    • supertypeOf

      public static WildcardType supertypeOf(Type bound)
      Returns a type that represents an unknown supertype of bound. For example, if bound is String.class, this returns ? super String.
    • canonicalize

      public static Type canonicalize(Type type)
      Returns a type that is functionally equal but not necessarily equal according to Object.equals(). The returned type is Serializable.
    • getRawType

      public static Class<?> getRawType(Type type)
    • equals

      public static boolean equals(Type a, Type b)
      Returns true if a and b are equal.
    • typeToString

      public static String typeToString(Type type)
    • resolve

      public static Type resolve(Type context, Class<?> contextRawType, Type toResolve)
    • checkNotNull

      public static <T> T checkNotNull(T obj)
    • processJacksonJsonJsonIgnore

      public static void processJacksonJsonJsonIgnore(FieldInfo fieldInfo, Annotation annotation)
    • isNoneStaticMemberClass

      public static boolean isNoneStaticMemberClass(Class objectClass, Class memberClass)
    • setNoneStaticMemberClassParent

      public static void setNoneStaticMemberClassParent(Object object, Object parent)
    • cleanupCache

      public static void cleanupCache(Class objectClass)
    • cleanupCache

      public static void cleanupCache(ClassLoader classLoader)
    • processJSONType1x

      public static void processJSONType1x(BeanInfo beanInfo, Annotation jsonType1x, Method method)