Class BeanUtilUtil

java.lang.Object
jodd.bean.BeanUtilUtil
All Implemented Interfaces:
BeanUtil
Direct Known Subclasses:
BeanUtilBean

abstract class BeanUtilUtil extends Object implements BeanUtil
Various bean property utilities that makes writings of BeanUtil classes easy.
  • Field Details

    • isDeclared

      protected boolean isDeclared
    • isForced

      protected boolean isForced
    • isSilent

      protected boolean isSilent
    • introspector

      protected ClassIntrospector introspector
    • typeConverterManager

      protected TypeConverterManager typeConverterManager
  • Constructor Details

    • BeanUtilUtil

      BeanUtilUtil()
  • Method Details

    • setIntrospector

      public void setIntrospector(ClassIntrospector introspector)
      Sets introspector implementation.
    • setTypeConverterManager

      public void setTypeConverterManager(TypeConverterManager typeConverterManager)
      Sets type converter manager implementation.
    • convertType

      protected Object convertType(Object value, Class type)
      Converts object to destination type. Invoked before the value is set into destination. Throws TypeConversionException if conversion fails.
    • convertToCollection

      protected Object convertToCollection(Object value, Class destinationType, Class componentType)
      Converter to collection.
    • invokeSetter

      protected Object invokeSetter(Setter setter, BeanProperty bp, Object value)
      Invokes setter, but first converts type to match the setter type.
    • arrayForcedGet

      protected Object arrayForcedGet(BeanProperty bp, Object array, int index)
      Returns the element of an array forced. If value is null, it will be instantiated. If not the last part of indexed bean property, array will be expanded to the index if necessary.
    • arrayForcedSet

      protected void arrayForcedSet(BeanProperty bp, Object array, int index, Object value)
      Sets the array element forced. If index is greater then arrays length, array will be expanded to the index. If speed is critical, it is better to allocate an array with proper size before using this method.
    • ensureArraySize

      protected Object ensureArraySize(BeanProperty bp, Object array, Class componentType, int index)
    • ensureListSize

      protected void ensureListSize(List list, int size)
    • indexOfDot

      protected int indexOfDot(String name)
      Finds the very first next dot. Ignores dots between index brackets. Returns -1 when dot is not found.
    • extractIndex

      protected String extractIndex(BeanProperty bp)
      Extract index string from non-nested property name. If index is found, it is stripped from bean property name. If no index is found, it returns null.
    • parseInt

      protected int parseInt(String indexString, BeanProperty bp)
    • createBeanProperty

      protected Object createBeanProperty(BeanProperty bp)
      Creates new instance for current property name through its setter. It uses default constructor!
    • extractGenericComponentType

      protected Class extractGenericComponentType(Getter getter)
      Extracts generic component type of a property. Returns Object.class when property does not have component.
    • convertIndexToMapKey

      protected Object convertIndexToMapKey(Getter getter, Object index)
      Converts Map index to key type. If conversion fails, original value will be returned.
    • extractType

      protected Class extractType(BeanProperty bp)
      Extracts type of current property.