Class DefaultTypeFacade
- java.lang.Object
-
- com.hybris.cockpitng.dataaccess.facades.type.impl.DefaultTypeFacade
-
- All Implemented Interfaces:
TypeFacade
public class DefaultTypeFacade extends java.lang.Object implements TypeFacade
Default implementation ofTypeFacadeusing aAbstractStrategyRegistryfor delegating toTypeFacadeStrategys which then do the actual work.
-
-
Constructor Summary
Constructors Constructor Description DefaultTypeFacade()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataAttributegetAttribute(java.lang.Object object, java.lang.String attributeQualifier)Gets a attribute of given object for given qualifier.java.lang.StringgetAttributeDescription(java.lang.String type, java.lang.String attribute)Gets attribute description for the given attributejava.lang.StringgetAttributeDescription(java.lang.String type, java.lang.String attribute, java.util.Locale locale)Gets attribute description for the given attributejava.lang.StringgetType(java.lang.Object object)Gets type of given objectDataTypeload(java.lang.String qualifier)Convenience method, calls load(qualifier, null).
SeeTypeFacade.load(String, Context).DataTypeload(java.lang.String qualifier, Context ctx)Loads aDataTypefor the given code, if it exists.voidsetStrategyRegistry(TypeFacadeStrategyRegistry strategyRegistry)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.hybris.cockpitng.dataaccess.facades.type.TypeFacade
getAttribute
-
-
-
-
Method Detail
-
load
public DataType load(java.lang.String qualifier, Context ctx) throws TypeNotFoundException
Description copied from interface:TypeFacadeLoads aDataTypefor the given code, if it exists.- Specified by:
loadin interfaceTypeFacade- Parameters:
qualifier- A unique qualifier identifying the type.ctx- Context specifying the loaded attributes of the returned type as well as application settings.- Returns:
- The type instance for given id loaded with attributes defined in context.
- Throws:
TypeNotFoundException- if there is no type available for the given code.
-
load
public DataType load(java.lang.String qualifier) throws TypeNotFoundException
Description copied from interface:TypeFacadeConvenience method, calls load(qualifier, null).
SeeTypeFacade.load(String, Context).- Specified by:
loadin interfaceTypeFacade- Parameters:
qualifier- A unique qualifier identifying the type.- Returns:
- The type instance for given id loaded with attributes defined in context.
- Throws:
TypeNotFoundException- if there is no type available for the given code.
-
setStrategyRegistry
public void setStrategyRegistry(TypeFacadeStrategyRegistry strategyRegistry)
-
getType
public java.lang.String getType(java.lang.Object object)
Description copied from interface:TypeFacadeGets type of given object- Specified by:
getTypein interfaceTypeFacade- Parameters:
object- a object for which type qualifier should be returned- Returns:
- type qualifier for the given object. If there is no custom type system or the object doesn't belong to it, it returns the java class name.
-
getAttributeDescription
public java.lang.String getAttributeDescription(java.lang.String type, java.lang.String attribute)Description copied from interface:TypeFacadeGets attribute description for the given attribute- Specified by:
getAttributeDescriptionin interfaceTypeFacade- Parameters:
type- code of the type for which the attribute's description should be fetchedattribute- qualifier of the attribute for which the description should be fetched- Returns:
- description of the attribute
-
getAttributeDescription
public java.lang.String getAttributeDescription(java.lang.String type, java.lang.String attribute, java.util.Locale locale)Description copied from interface:TypeFacadeGets attribute description for the given attribute- Specified by:
getAttributeDescriptionin interfaceTypeFacade- Parameters:
type- code of the type for which the attribute's description should be fetchedattribute- qualifier of the attribute for which the description should be fetchedlocale- prefered locale - if available the description should be returned in the prefered locale- Returns:
- description of the attribute
-
getAttribute
public DataAttribute getAttribute(java.lang.Object object, java.lang.String attributeQualifier)
Description copied from interface:TypeFacadeGets a attribute of given object for given qualifier.As a qualifier may be given any expression compatible with SpEL specification, yet more sophisticated expressions may strongly affect performance. If expression may not be interpreted as item's attribute, a expressions value class is returned.
- Specified by:
getAttributein interfaceTypeFacade- Parameters:
object- object, which attribute is to be extractedattributeQualifier- attribute qualifier or SpEL- Returns:
- evaluation's result - attribute which is pointed by an expression or
nullif expression does not point an attribute straightforward or is outside of platform domain
-
-