Package jodd.bean
Class BeanUtilBean
java.lang.Object
jodd.bean.BeanUtilUtil
jodd.bean.BeanUtilBean
- All Implemented Interfaces:
BeanUtil
Instantiable version of
BeanUtil.-
Field Summary
FieldsFields inherited from class jodd.bean.BeanUtilUtil
introspector, isDeclared, isForced, isSilent, typeConverterManagerFields inherited from interface jodd.bean.BeanUtil
declared, declaredForced, declaredForcedSilent, declaredSilent, forced, forcedSilent, pojo, silent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Objectprivate void_setIndexProperty(BeanProperty bp, Object value) declared(boolean declared) Sets the declared flag.extractThisReference(String propertyName) Extract the first name of this reference.forced(boolean forced) Sets the forced flag.<T> TgetIndexProperty(Object bean, String property, int index) Returns value of indexed property.protected ObjectGet non-nested property value: either simple or indexed property.<T> TgetProperty(Object bean, String name) Returns value of bean's property.Class<?> getPropertyType(Object bean, String name) Returns property type.<T> TgetSimpleProperty(Object bean, String property) Reads simple property.protected Objectprotected booleanbooleanhasProperty(Object bean, String name) Returnstrueif bean has a property.booleanhasRootProperty(Object bean, String name) Returnstrueif bean has only a root property.booleanhasSimpleProperty(Object bean, String property) Returnstrueif simple property exist.protected booleanprotected booleanprotected voidResolves nested property name to the very last indexed property.voidsetIndexProperty(Object bean, String property, int index, Object value) Sets indexed property.protected voidsetIndexProperty(BeanProperty bp, Object value) Sets indexed or regular properties (no nested!).voidsetProperty(Object bean, String name, Object value) Sets Java Bean property.voidsetSimpleProperty(Object bean, String property, Object value) Sets simple property.protected voidsetSimpleProperty(BeanProperty bp, Object value) Sets a value of simple property.silent(boolean silent) Sets the silent flag.Methods inherited from class jodd.bean.BeanUtilUtil
arrayForcedGet, arrayForcedSet, convertIndexToMapKey, convertToCollection, convertType, createBeanProperty, ensureArraySize, ensureListSize, extractGenericComponentType, extractIndex, extractType, indexOfDot, invokeSetter, parseInt, setIntrospector, setTypeConverterManager
-
Field Details
-
INDEX_CHARS
private static final char[] INDEX_CHARS
-
-
Constructor Details
-
BeanUtilBean
public BeanUtilBean()
-
-
Method Details
-
declared
Sets the declared flag. -
forced
Sets the forced flag. -
silent
Sets the silent flag. -
resolveNestedProperties
Resolves nested property name to the very last indexed property. If forced,nullor non-existing properties will be created. -
resolveExistingNestedProperties
-
hasSimpleProperty
Description copied from interface:BeanUtilReturnstrueif simple property exist.- Specified by:
hasSimplePropertyin interfaceBeanUtil
-
hasSimpleProperty
-
getSimpleProperty
Description copied from interface:BeanUtilReads simple property.- Specified by:
getSimplePropertyin interfaceBeanUtil
-
getSimpleProperty
-
setSimpleProperty
Description copied from interface:BeanUtilSets simple property.- Specified by:
setSimplePropertyin interfaceBeanUtil
-
setSimpleProperty
Sets a value of simple property. -
hasIndexProperty
-
getIndexProperty
Description copied from interface:BeanUtilReturns value of indexed property.- Specified by:
getIndexPropertyin interfaceBeanUtil
-
getIndexProperty
Get non-nested property value: either simple or indexed property. If forced, missing bean will be created if possible. -
_getIndexProperty
-
setIndexProperty
Description copied from interface:BeanUtilSets indexed property.- Specified by:
setIndexPropertyin interfaceBeanUtil
-
setIndexProperty
Sets indexed or regular properties (no nested!). -
_setIndexProperty
-
setProperty
Description copied from interface:BeanUtilSets Java Bean property.- Specified by:
setPropertyin interfaceBeanUtil- Parameters:
bean- Java POJO bean or a Mapname- property namevalue- property value
-
getProperty
Returns value of bean's property.- Specified by:
getPropertyin interfaceBeanUtil
-
hasProperty
Description copied from interface:BeanUtilReturnstrueif bean has a property.- Specified by:
hasPropertyin interfaceBeanUtil
-
hasRootProperty
Description copied from interface:BeanUtilReturnstrueif bean has only a root property. If yes, this means that property may be injected into the bean. If not, bean does not contain the property.- Specified by:
hasRootPropertyin interfaceBeanUtil
-
getPropertyType
Description copied from interface:BeanUtilReturns property type.- Specified by:
getPropertyTypein interfaceBeanUtil
-
extractThisReference
Extract the first name of this reference.- Specified by:
extractThisReferencein interfaceBeanUtil
-