Package de.hybris.platform.jalo.type
Class MapType
- java.lang.Object
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable
public class MapType extends Type
This type represents a typed map. Both argument type and element type is typed.Map types fulfil s special role describing localized attributes since each localized attribute must point to a map type having the
Languagecomposed type as argument type and the actual attribute type as return type.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceMapType.MapTypeImplInternal persistence layer implementation interface.-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.type.Type
Type.TypeImpl
-
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.StringARGUMENT_TYPEThe argument type attribute string constant.static java.lang.StringRETURN_TYPEThe element (or return ) type attribute string constant.-
Fields inherited from class de.hybris.platform.jalo.type.Type
CODE, DEFAULTVALUE, DESCRIPTION, XMLDEFINITION
-
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 MapType()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ItemcreateItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes)The generic creation method for maptypes.protected static java.lang.StringescapeForMap(java.lang.String raw)java.lang.StringexportXMLDefinition(org.znerd.xmlenc.XMLOutputter xout)TypegetArgumentType()Returns the argument type.TypegetArgumentType(SessionContext ctx)Returns the argument type.static int[]getEscapedMapPositions(java.lang.String escaped, int startFrom)protected MapType.MapTypeImplgetMapTypeImpl()Internal access to persistence layer implementation.protected Item.ItemAttributeMapgetNonInitialAttributes(SessionContext ctx, Item.ItemAttributeMap allAttributes)Cuts the following attributes which have been already set during creation:Type.CODEARGUMENT_TYPERETURN_TYPETypegetReturnType()Returns the element ( or return-) type.TypegetReturnType(SessionContext ctx)Returns the element ( or return-) type.java.lang.StringgetXMLDefinition()Assembles the XML definition to put inside aitems.xml.booleanisAssignableFrom(Type type)Checks if this maptype is assignable from another maptype.booleanisInstance(java.lang.Object o)Checks if a given object is instance of this maptype.java.lang.ObjectparseValue(SessionContext ctx, java.lang.String value)java.lang.StringtoString()The string representation of this map type.java.lang.StringtoString(SessionContext ctx, java.lang.Object value)booleantypeCheckContent(java.util.Map map)Helper method forisInstance(Object).protected static java.lang.StringunescapeForMap(java.lang.String escaped)-
Methods inherited from class de.hybris.platform.jalo.type.Type
compareTo, getAllDescriptions, getAllDescriptions, getCode, getDefaultValue, getDefaultValue, getDescription, getDescription, getTypeImpl, setAllDescriptions, setAllDescriptions, setDefaultValue, setDefaultValue, setDescription, setDescription
-
Methods inherited from class de.hybris.platform.jalo.type.TypeManagerManaged
getAllNames, getAllNames, getExtensionName, getImpl, getName, 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, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedProperty, setLocalizedProperty
-
Methods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getImplementation, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, 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
-
-
-
-
Method Detail
-
createItem
protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException
The generic creation method for maptypes.The following attributes are required:
- Specified by:
createItemin classItem- Parameters:
ctx- the current session context which this item is created withintype- the actual item type ( since subtypes may not provide a own jalo class this may be different from the type which this method was implemented for )- Returns:
- the new item instance
- Throws:
JaloBusinessException- indicates an error during creation - any changes will be rollbacked
-
getNonInitialAttributes
protected Item.ItemAttributeMap getNonInitialAttributes(SessionContext ctx, Item.ItemAttributeMap allAttributes)
Cuts the following attributes which have been already set during creation:- Overrides:
getNonInitialAttributesin classItem- Parameters:
ctx- session context with language = NULLallAttributes- aItemAttributeMapcontaning attribute values.- Returns:
- a
ItemAttributeMapcontaining all attribute values, which belong to non-initial attributes.
-
getEscapedMapPositions
public static int[] getEscapedMapPositions(java.lang.String escaped, int startFrom)- Since:
- 2.10
-
escapeForMap
protected static final java.lang.String escapeForMap(java.lang.String raw)
- Since:
- 2.10
-
unescapeForMap
protected static final java.lang.String unescapeForMap(java.lang.String escaped)
- Since:
- 2.10
-
toString
public java.lang.String toString(SessionContext ctx, java.lang.Object value) throws JaloInvalidParameterException
- Specified by:
toStringin classType- Throws:
JaloInvalidParameterException- Since:
- 2.10
-
parseValue
public java.lang.Object parseValue(SessionContext ctx, java.lang.String value) throws JaloInvalidParameterException
- Specified by:
parseValuein classType- Throws:
JaloInvalidParameterException- Since:
- 2.10
-
getArgumentType
public Type getArgumentType()
Returns the argument type.
-
getArgumentType
public Type getArgumentType(SessionContext ctx)
Returns the argument type.
-
getReturnType
public Type getReturnType()
Returns the element ( or return-) type.
-
getReturnType
public Type getReturnType(SessionContext ctx)
Returns the element ( or return-) type.
-
getXMLDefinition
public java.lang.String getXMLDefinition()
Assembles the XML definition to put inside aitems.xml.- Specified by:
getXMLDefinitionin classType
-
exportXMLDefinition
public java.lang.String exportXMLDefinition(org.znerd.xmlenc.XMLOutputter xout)
- Specified by:
exportXMLDefinitionin classTypeManagerManaged
-
getMapTypeImpl
protected MapType.MapTypeImpl getMapTypeImpl()
Internal access to persistence layer implementation.
-
isAssignableFrom
public boolean isAssignableFrom(Type type)
Checks if this maptype is assignable from another maptype.This is true if its argument type is assignable from the other type's argument type and its element type is assignable from the other type's element type.
- Specified by:
isAssignableFromin classType- Parameters:
type- the type to be checked.
-
isInstance
public boolean isInstance(java.lang.Object o)
Checks if a given object is instance of this maptype.This is true if the object is a map and each key is instance of the argument type and each value is instance of the element type.
- Specified by:
isInstancein classType- Parameters:
o- the object to be checked.
-
typeCheckContent
public boolean typeCheckContent(java.util.Map map)
Helper method forisInstance(Object). Checks content of a map if it is compatible with the argument and element type.
-
-