public class NestedListProperty extends Property implements ESPropertyInfo
NestedList
field within a MongoEntity
.Modifier and Type | Class and Description |
---|---|
static class |
NestedListProperty.Factory
Factory for generating properties based on their field type
|
accessPath, alternativePropertyKey, defaultValue, descriptor, field, label, length, name, nameAsMapping, nullable, propertyKey, propertyName
Modifier | Constructor and Description |
---|---|
protected |
NestedListProperty(EntityDescriptor descriptor,
AccessPath accessPath,
Field field) |
Modifier and Type | Method and Description |
---|---|
void |
describeProperty(com.alibaba.fastjson.JSONObject description)
Creates the mapping description for this property into the given JSON.
|
protected EntityDescriptor |
getNestedDescriptor() |
protected NestedList<?> |
getNestedList(Object entity) |
Object |
getValueAsCopy(Object entity)
For modifyable datatypes like collections, this returns the value as copy so that further modifications
will not change the returned value.
|
protected Object |
getValueFromField(Object target)
Obtains the value from the field in the given target object
|
protected void |
onBeforeSaveChecks(Object entity)
Invoked before an entity is written to the database.
|
protected void |
setValueToField(Object value,
Object target)
Applies the given value to the field in the given target object
|
protected Object |
transformFromDatasource(Class<? extends BaseMapper<?,?,?>> mapperType,
sirius.kernel.commons.Value object)
Converts the database value to the appropriate field value.
|
protected Object |
transformToDatasource(Class<? extends BaseMapper<?,?,?>> mapperType,
Object object)
Converts the Java object which resides in the associated field to the database value which is to be
written into the database.
|
Object |
transformValue(sirius.kernel.commons.Value value)
Converts the given value, which most probably contains user input as string into the target type of this
property.
|
checkNullability, checkUniqueness, determineDefaultValue, determineLengths, determineNullability, equals, getAnnotation, getDefaultValue, getDefinition, getDescriptor, getField, getLabel, getLength, getName, getPropertyName, getValue, getValueForDatasource, hashCode, illegalFieldValue, isNullable, link, onAfterDelete, onAfterSave, onBeforeDelete, onBeforeSave, parseValue, setValue, setValueFromDatasource, toString, transformFromElastic, transformFromJDBC, transformFromMongo, transformToElastic, transformToJDBC, transformToMongo
is, makeNewInstance, tryAs
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
transferOption
protected NestedListProperty(EntityDescriptor descriptor, AccessPath accessPath, Field field)
protected NestedList<?> getNestedList(Object entity)
protected Object getValueFromField(Object target)
Property
getValueFromField
in class Property
target
- the target object determined by the access pathpublic Object getValueAsCopy(Object entity)
Property
getValueAsCopy
in class Property
entity
- the entity to fetch the value frompublic Object transformValue(sirius.kernel.commons.Value value)
Property
transformValue
in class Property
value
- the value to convertprotected void setValueToField(Object value, Object target)
Property
setValueToField
in class Property
value
- the database value to storetarget
- the target object determined by the access pathprotected void onBeforeSaveChecks(Object entity)
Property
This method is intended to be overwritten with custom logic.
onBeforeSaveChecks
in class Property
entity
- the entity to checkprotected EntityDescriptor getNestedDescriptor()
protected Object transformToDatasource(Class<? extends BaseMapper<?,?,?>> mapperType, Object object)
Property
transformToDatasource
in class Property
mapperType
- the mapper which is currently active. This can be used to determine which kind of database is
active and therefore which data format will be required.object
- the current field valueprotected Object transformFromDatasource(Class<? extends BaseMapper<?,?,?>> mapperType, sirius.kernel.commons.Value object)
Property
transformFromDatasource
in class Property
mapperType
- the mapper which is currently active. This can be used to determine which kind of database is
active and therefore which data format will be available.object
- the database valuepublic void describeProperty(com.alibaba.fastjson.JSONObject description)
ESPropertyInfo
describeProperty
in interface ESPropertyInfo
description
- the target JSON to fillCopyright © 2018. All rights reserved.