Package de.hybris.platform.jalo.type
Class ExpressionAttributeDescriptor
java.lang.Object
de.hybris.platform.util.BridgeAbstraction
de.hybris.platform.jalo.Item
de.hybris.platform.jalo.ExtensibleItem
de.hybris.platform.jalo.c2l.LocalizableItem
de.hybris.platform.jalo.type.TypeManagerManaged
de.hybris.platform.jalo.type.Descriptor
de.hybris.platform.jalo.type.AttributeDescriptor
de.hybris.platform.jalo.type.ExpressionAttributeDescriptor
- All Implemented Interfaces:
Serializable,Comparable
This descriptor gives the possibility for declaring dynamic default values, means that the given expression will be
evaluated at runtime by the bean shell interpreter. Therefore a new parameter 'defaultValueExpression' is introduced.
ATTENTION: The normal 'defaultvalue' tag will be treated as ever and will be used as fallback.
Sample definition:
<attribute qualifier="sampleUser" type="User" metatype="ExpressionAttributeDescriptor">
<modifiers initial="true" read="true" write="false" optional="false" />
<persistence type="property" />
<custom-properties>
<property name="defaultValueExpression"><value>"de.hybris.platform.jalo.JaloSession.getCurrentSession().getUser()"</value></property>
</custom-properties>
</attribute>
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.jalo.type.AttributeDescriptor
AttributeDescriptor.AttributeDescriptorImplNested classes/interfaces inherited from class de.hybris.platform.jalo.type.Descriptor
Descriptor.DescriptorImplNested classes/interfaces inherited from class de.hybris.platform.jalo.type.TypeManagerManaged
TypeManagerManaged.TypeManagerManagedImplNested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.Item
Item.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationException -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringParameter which indicates the property for defining the default expression.Fields inherited from class de.hybris.platform.jalo.type.AttributeDescriptor
ALL, ALL_PUBLIC, ATTRIBUTE_HANDLER, DATABASECOLUMN, DECLARING_ENCLOSING_TYPE, DEFAULTVALUE, DEFAULTVALUE_DEFINITIONSTRING, DESCRIPTION, DONT_COPY, ENCLOSING_TYPE, ENCRYPTED, ENCRYPTED_FLAG, HIDDENFORUI, INHERITED, INHERITED_FLAG, INITIAL, INITIAL_FLAG, LOCALIZED, LOCALIZED_FLAG, MODIFIERS, OPTIONAL, OPTIONAL_FLAG, PARTOF, PARTOF_FLAG, PERSISTENCE_CLASS, PERSISTENCETYPE, PRIMITIVE, PRIMITIVE_FLAG, PRIVATE, PRIVATE_FLAG, PROPERTY, PROPERTY_FLAG, PROPOSED_DATABASE_COLUMN, READ, READ_FLAG, READABLE, READONLYFORUI, REMOVABLE, REMOVE, REMOVE_FLAG, SEARCH, SEARCH_FLAG, TIM_IGNORE, TIM_IGNORE_FLAG, UNIQUE, WRITABLE, WRITE, WRITE_FLAGFields inherited from class de.hybris.platform.jalo.type.Descriptor
ATTRIBUTETYPE, QUALIFIERFields inherited from class de.hybris.platform.jalo.type.TypeManagerManaged
AUTOCREATE, DEPRECATED, EXTENSION_NAME, GENERATE, NAMEFields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLEDFields inherited from class de.hybris.platform.jalo.Item
_CREATION_TIME_INTERNAL, _MODIFIED_TIME_INTERNAL, accessorLog, CREATION_TIME, DISABLE_ATTRIBUTE_CHECK, DISABLE_ITEMCHECK_BEFORE_REMOVABLE, EVEN, FEATURE_ACCESSMAP_QUALIFIER, HJMPTS, INITIAL_CREATION_FLAG, isJaloOnly, MODIFIED_TIME, NEGATIVE, NOT_FOUND, OWNER, PK, POSITIVE, SAVE_FROM_SERVICE_LAYER, staticTransientObjects, TYPEFields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidexportXMLDefinitionDefaultValue(org.znerd.xmlenc.XMLOutputter xout) Gets the default value of this descriptor evaluated from from set expression.Gets the value evaluated from set expression.Gets the original expression as defined.voidsetDefaultValueExpressionString(String defaultValueExpression) Sets a new expression which will be used instead.Methods inherited from class de.hybris.platform.jalo.type.AttributeDescriptor
checkDefaultValueAssignability, checkLocalizedChange, checkPartOfChange, checkPropertyChange, checkSearchableChange, checkSelectionOfDescriptor, checkTypeChange, checkTypePermission, checkTypePermission, createItem, exportXMLDefinition, getAllDescriptions, getAllDescriptions, getAllNames, getAllSubAttributeDescriptors, getAttributeDescriptorImpl, getAttributeHandler, getDatabaseColumn, getDeclaringEnclosingType, getDefaultValue, getDefaultValueDefinitionString, getDescription, getDescription, getDontOptimize, getEnclosingType, getIntModifiersFromMap, getModifiers, getName, getNonInitialAttributes, getPersistenceClass, getPersistenceQualifier, getPersistenceType, getProposedDatabaseColumn, getSelectionOf, getSubAttributeDescriptors, getXMLCustomProperties, getXMLDefinition, interpretAndReplaceDefaultValue, isEncrypted, isHiddenForUI, isInherited, isInitial, isLocalized, isOptional, isPartOf, isPrimitive, isPrivate, isProperty, isReadable, isReadOnlyForUI, isRedeclared, isRemovable, isRuntime, isSearchable, isUnique, isWritable, isWriteable, redeclareAttributeType, removeLocalizedProperty, removeLocalizedPropertyNonRecursively, removeProperty, removePropertyNonRecursively, setAllDescriptions, setAllDescriptions, setAttributeHandler, setAttributeType, setDatabaseColumn, setDefaultValue, setDefaultValue, setDescription, setDescription, setDontOptimize, setEncrypted, setHiddenForUI, setInitial, setLocalized, setLocalizedProperty, setLocalizedPropertyNonRecursively, setModifiers, setOptional, setPartOf, setPrimitive, setPrivate, setProperty, setProperty, setPropertyNonRecursively, setReadable, setReadOnlyForUI, setRemovable, setSearchable, setSelectionOf, setUnique, setWritable, toString, toString, writeDefaultValueTagAtomicMethods inherited from class de.hybris.platform.jalo.type.Descriptor
compareTo, getAttributeType, getAttributeType, getContextAdjustedAttributeType, getDescriptorImpl, getQualifier, getRealAttributeTypeMethods inherited from class de.hybris.platform.jalo.type.TypeManagerManaged
getAllNames, getExtensionName, getImpl, getName, isAutocreate, isDeprecated, isGenerate, setAllNames, setAllNames, setAutocreate, setExtensionName, setGenerate, setName, setNameMethods inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllValuesSessionContext, getLocalizedProperty, getLocalizedProperty, getLocalizedPropertyInternal, getLocalizedPropertyNames, getLocalizedPropertyNames, hasLanguage, isEmptyValue, isFallbackEnabled, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedPropertyMethods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getImplementation, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, setAllProperties, setAllProperties, setPropertyMethods inherited from class de.hybris.platform.jalo.Item
addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addNegativePermission, addPermission, addPositivePermission, assureExtensionsLoaded, changeTypeAfterCreation, checkConstraint, checkItemPermission, checkMandatoryAttribute, checkMandatoryAttribute, checkPermission, checkPermission, checkRemovable, clearPermission, ctx, doAfterRemove, doBeforeRemove, equals, getAccessorFor, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributesInternal, getAllLinkedItems, getAndCheckCacheBoundItem, getAttribute, getAttribute, getCacheBoundItem, getComposedType, getComposedTypePK, getCreationTime, getCurrentlyRemovingCount, getDefaultAttributeModes, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItemsCount, getLinkedItemsCount, getLinkedItemsCount, getModificationTime, getNegativePermissions, getOwner, getPartOfRemovedSessionMarker, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, getRelatedItems, getRelatedItems, getRestrictedPrincipals, getSession, getSyncObject, getTenant, getTransientObject, getTransientObjectMap, hashCode, hasRegisteredClassAccessorFor, internal_registerClassAccessorFor, internal_registerNonClassAccessorFor, invalidateLocalCaches, isAlive, isCacheBound, isCurrentlyRemoving, isCurrentlyRemoving, isEmptyRelationValue, isInCreate, isInstanceOf, isItemCheckBeforeRemoveableDisabled, isMarkModifiedDisabled, isRelationLocalizationFallbackEnabled, newInstance, notifyExtensionsAfterItemCreation, notifyExtensionsBeforeItemCreation, notifyItemRemoval, notifyManagerAboutItemRemoval, readResolve, registerAccessFor, registerAccessFor, registerJaloInvalidationListeners, remove, remove, removeItemCollection, removeItemCollection, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinks, removePartOfItems, removePartOfItems, setAllAttributes, setAllAttributes, setAllAttributesInternal, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAttribute, setAttribute, setAttributeFromString, setAttributeFromString, setCacheBound, setComposedType, setCreationTime, setImplementation, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setModificationTime, setNonInitialAttributes, setOwner, setPermissionsByMap, setRelatedItems, setTransientObject, setUseTA, suppressRelation, useTA, writeReplaceMethods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
Field Details
-
DEFAULT_VALUE_EXPRESSION
Parameter which indicates the property for defining the default expression.- See Also:
-
-
Constructor Details
-
ExpressionAttributeDescriptor
public ExpressionAttributeDescriptor()
-
-
Method Details
-
getDefaultValueExpressionString
Gets the original expression as defined.- Returns:
- defined expression which will be evaluated and used as default value
-
setDefaultValueExpressionString
Sets a new expression which will be used instead.- Parameters:
defaultValueExpression- new expression
-
getDefaultValueExpression
Gets the value evaluated from set expression.- Returns:
- evaluated value
-
getDefaultValue
Gets the default value of this descriptor evaluated from from set expression. if no expression is set or evaluation results in null, the default value of the super descriptor is returned.- Overrides:
getDefaultValuein classAttributeDescriptor- Parameters:
ctx- the session context specifying the language ( affect for localized attributes only )- See Also:
-
exportXMLDefinitionDefaultValue
protected void exportXMLDefinitionDefaultValue(org.znerd.xmlenc.XMLOutputter xout) throws IOException - Overrides:
exportXMLDefinitionDefaultValuein classAttributeDescriptor- Throws:
IOException
-