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:
java.io.Serializable,java.lang.Comparable
public class ExpressionAttributeDescriptor extends AttributeDescriptor
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:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.type.AttributeDescriptor
AttributeDescriptor.AttributeDescriptorImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.type.Descriptor
Descriptor.DescriptorImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.type.TypeManagerManaged
TypeManagerManaged.TypeManagerManagedImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImpl
-
Nested 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
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_VALUE_EXPRESSIONParameter 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, ENCLOSING_TYPE, ENCRYPTED, ENCRYPTED_FLAG, 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, REMOVABLE, REMOVE, REMOVE_FLAG, SEARCH, SEARCH_FLAG, TIM_IGNORE, TIM_IGNORE_FLAG, UNIQUE, WRITABLE, WRITE, WRITE_FLAG
-
Fields inherited from class de.hybris.platform.jalo.type.Descriptor
ATTRIBUTETYPE, QUALIFIER
-
Fields inherited from class de.hybris.platform.jalo.type.TypeManagerManaged
AUTOCREATE, DEPRECATED, EXTENSION_NAME, GENERATE, NAME
-
Fields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLED
-
Fields 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, TYPE
-
Fields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant
-
-
Constructor Summary
Constructors Constructor Description ExpressionAttributeDescriptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidexportXMLDefinitionDefaultValue(org.znerd.xmlenc.XMLOutputter xout)java.lang.ObjectgetDefaultValue(SessionContext ctx)Gets the default value of this descriptor evaluated from from set expression.java.lang.ObjectgetDefaultValueExpression()Gets the value evaluated from set expression.java.lang.StringgetDefaultValueExpressionString()Gets the original expression as defined.voidsetDefaultValueExpressionString(java.lang.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, isInherited, isInitial, isLocalized, isOptional, isPartOf, isPrimitive, isPrivate, isProperty, isReadable, isRedeclared, isRemovable, isSearchable, isUnique, isWritable, isWriteable, redeclareAttributeType, removeLocalizedProperty, removeLocalizedPropertyNonRecursively, removeProperty, removePropertyNonRecursively, setAllDescriptions, setAllDescriptions, setAttributeHandler, setAttributeType, setDatabaseColumn, setDefaultValue, setDefaultValue, setDescription, setDescription, setDontOptimize, setEncrypted, setInitial, setLocalized, setLocalizedProperty, setLocalizedPropertyNonRecursively, setModifiers, setOptional, setPartOf, setPrimitive, setPrivate, setProperty, setProperty, setPropertyNonRecursively, setReadable, setRemovable, setSearchable, setSelectionOf, setUnique, setWritable, toString, toString, writeDefaultValueTagAtomic
-
Methods inherited from class de.hybris.platform.jalo.type.Descriptor
compareTo, getAttributeType, getAttributeType, getContextAdjustedAttributeType, getDescriptorImpl, getQualifier, getRealAttributeType
-
Methods inherited from class de.hybris.platform.jalo.type.TypeManagerManaged
getAllNames, getExtensionName, getImpl, getName, isAutocreate, isDeprecated, isGenerate, setAllNames, setAllNames, setAutocreate, setExtensionName, setGenerate, setName, setName
-
Methods 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, setLocalizedProperty
-
Methods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getImplementation, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, setAllProperties, setAllProperties, setProperty
-
Methods 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, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, 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, useTA, writeReplace
-
Methods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
-
-
-
Field Detail
-
DEFAULT_VALUE_EXPRESSION
public static final java.lang.String DEFAULT_VALUE_EXPRESSION
Parameter which indicates the property for defining the default expression.- See Also:
- Constant Field Values
-
-
Method Detail
-
getDefaultValueExpressionString
public java.lang.String getDefaultValueExpressionString()
Gets the original expression as defined.- Returns:
- defined expression which will be evaluated and used as default value
-
setDefaultValueExpressionString
public void setDefaultValueExpressionString(java.lang.String defaultValueExpression)
Sets a new expression which will be used instead.- Parameters:
defaultValueExpression- new expression
-
getDefaultValueExpression
public java.lang.Object getDefaultValueExpression()
Gets the value evaluated from set expression.- Returns:
- evaluated value
-
getDefaultValue
public java.lang.Object getDefaultValue(SessionContext ctx)
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:
AttributeDescriptor.setDefaultValue(Object),AttributeDescriptor.setDefaultValue(SessionContext, Object)
-
exportXMLDefinitionDefaultValue
protected void exportXMLDefinitionDefaultValue(org.znerd.xmlenc.XMLOutputter xout) throws java.io.IOException- Overrides:
exportXMLDefinitionDefaultValuein classAttributeDescriptor- Throws:
java.io.IOException
-
-