Package de.hybris.platform.jalo.type
Class ReflectionAttributeAccess
- java.lang.Object
-
- de.hybris.platform.jalo.type.ReflectionAttributeAccess
-
- All Implemented Interfaces:
AttributeAccess
public class ReflectionAttributeAccess extends java.lang.Object implements AttributeAccess
-
-
Constructor Summary
Constructors Constructor Description ReflectionAttributeAccess(java.lang.String label, de.hybris.platform.jalo.type.ReflectionAttributeAccess.AttributeMethod getter, de.hybris.platform.jalo.type.ReflectionAttributeAccess.AttributeMethod allGetter, de.hybris.platform.jalo.type.ReflectionAttributeAccess.AttributeMethod setter, de.hybris.platform.jalo.type.ReflectionAttributeAccess.AttributeMethod allSetter, boolean localized, boolean writable, boolean initialWritable)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
adjustPermissions()
static AttributeAccess
createReflectionAccess(Tenant t, java.lang.Class itemClass, AttributeDescriptor ad)
java.lang.reflect.Method
getAllGetter()
java.lang.reflect.Method
getAllSetter()
java.lang.reflect.Method
getGetter()
java.lang.String
getInfo()
java.lang.reflect.Method
getSetter()
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.java.lang.String
toString()
-
-
-
Constructor Detail
-
ReflectionAttributeAccess
public ReflectionAttributeAccess(java.lang.String label, de.hybris.platform.jalo.type.ReflectionAttributeAccess.AttributeMethod getter, de.hybris.platform.jalo.type.ReflectionAttributeAccess.AttributeMethod allGetter, de.hybris.platform.jalo.type.ReflectionAttributeAccess.AttributeMethod setter, de.hybris.platform.jalo.type.ReflectionAttributeAccess.AttributeMethod allSetter, boolean localized, boolean writable, boolean initialWritable)
-
-
Method Detail
-
createReflectionAccess
public static final AttributeAccess createReflectionAccess(Tenant t, java.lang.Class itemClass, AttributeDescriptor ad)
-
getGetter
public java.lang.reflect.Method getGetter()
-
getSetter
public java.lang.reflect.Method getSetter()
-
getAllGetter
public java.lang.reflect.Method getAllGetter()
-
getAllSetter
public java.lang.reflect.Method getAllSetter()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getInfo
public java.lang.String getInfo()
-
adjustPermissions
protected void adjustPermissions()
-
getValue
public 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
-
setValue
public void setValue(SessionContext ctx, Item item, java.lang.Object value) throws JaloTypeException, JaloInvalidParameterException, JaloSecurityException, JaloBusinessException
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 writtenJaloBusinessException
- any other error
-
-