Package de.hybris.platform.jalo.type
Class RelationAttributeAccess
- java.lang.Object
-
- de.hybris.platform.jalo.type.RelationAttributeAccess
-
- All Implemented Interfaces:
AttributeAccess
public class RelationAttributeAccess extends java.lang.Object implements AttributeAccess
Base class for relation attribute accesses. use this for building n:m-relations with attribute accesses.
-
-
Constructor Summary
Constructors Constructor Description RelationAttributeAccess(java.lang.String qualifier, boolean isSource, boolean localized, boolean singleValued)
Creates a new attribute access for one end of a relation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Map
convertListMapToSingleValuedMap(java.util.Map listMap)
protected java.util.Map
convertSingleValuedMapToListMap(java.util.Map singleValuedMap)
java.lang.Object
getValue(SessionContext ctx, Item item)
Retrieves the attribute data from a given item.void
setValue(SessionContext ctx, Item item, java.lang.Object value)
Stores the attribute data for a given item.
-
-
-
Constructor Detail
-
RelationAttributeAccess
public RelationAttributeAccess(java.lang.String qualifier, boolean isSource, boolean localized, boolean singleValued)
Creates a new attribute access for one end of a relation.- Parameters:
qualifier
- the relation qualifier - must be the same at both ends for unidirectional relationsisSource
- tells whether this end is the source - only one end can be sourcelocalized
- tells whether the relation value is localized or notsingleValued
- for the special case when the 1-end of an unidirectional 1:n relation is described - use with care, mostly using a simple typed property should be preferred
-
-
Method Detail
-
convertSingleValuedMapToListMap
protected java.util.Map convertSingleValuedMapToListMap(java.util.Map singleValuedMap)
-
convertListMapToSingleValuedMap
protected java.util.Map convertListMapToSingleValuedMap(java.util.Map listMap)
-
setValue
public final void setValue(SessionContext ctx, Item item, java.lang.Object value) throws JaloTypeException, JaloInvalidParameterException, JaloSecurityException
Description copied from interface:AttributeAccess
Stores the attribute data for a given item.- Specified by:
setValue
in interfaceAttributeAccess
- Parameters:
ctx
- the current session context - e.g. specifies the session languageitem
- the item to store data forvalue
- the value to store- Throws:
JaloTypeException
- in case the attribute type does not allow storing this valueJaloInvalidParameterException
- in case the value is not compatible with this attributeJaloSecurityException
- in case there are security constraints which do not allow this value to be written
-
getValue
public final java.lang.Object getValue(SessionContext ctx, Item item) throws JaloTypeException, JaloInvalidParameterException, JaloSecurityException
Description copied from interface:AttributeAccess
Retrieves the attribute data from a given item. Primitive data types likeint
are wrapped into their object instances.- Specified by:
getValue
in interfaceAttributeAccess
- Parameters:
ctx
- the current session context - e.g. specifies the session languageitem
- the item to get data from- Returns:
- the data value
- Throws:
JaloTypeException
- in case the attribute type does not allow reading this valueJaloInvalidParameterException
- in some data required for reading the value is missing or not as expected ( like missing session language )JaloSecurityException
- in case there are security constraints which do not allow reding this value
-
-