Class DefaultTypeService
java.lang.Object
de.hybris.platform.servicelayer.internal.service.AbstractService
de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
de.hybris.platform.servicelayer.type.impl.DefaultTypeService
- All Implemented Interfaces:
TypeService,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
Default implementation of the type service interface
- Since:
- 4.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO -
Field Summary
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManagerFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAtomicType(String typeCode) Deprecated, for removal: This API element is subject to removal in a future version.since agesgetAtomicTypeForCode(String code) Gets the atomic type for code.getAtomicTypeForJavaClass(Class javaClass) Returns the atomic type for java class.getAttributeDescriptor(ComposedTypeModel composedType, String qualifier) Returns a specific attribute descriptor for a given composed type.getAttributeDescriptor(String composedType, String qualifier) Returns a specific attribute descriptor for a given composed type.getAttributeDescriptors(ComposedTypeModel composedType) Deprecated, for removal: This API element is subject to removal in a future version.since agesgetAttributeDescriptors(String composedTypeCode) Deprecated, for removal: This API element is subject to removal in a future version.since agesgetAttributeDescriptorsForType(ComposedTypeModel composedType) !!Note!! this service is not returning VariantAttributeDescriptors if there are any.getAttributesForModifiers(String composedTypeCode, AttributeModifierCriteria criteria) Gets the attributes for modifiers for given composed type and criteria container.getComposedType(Class modelClass) Deprecated, for removal: This API element is subject to removal in a future version.since agesgetComposedType(String typeCode) Deprecated, for removal: This API element is subject to removal in a future version.since agesgetComposedTypeForClass(Class modelClass) Returns the specific composed type for the model class.getComposedTypeForCode(String code) Returns the specific composed type for code.getDefaultValues(String type) Fetches all configured default values for a specified type.getDefaultValues(String type, Collection<String> attributes) Fetches a subset of all configured default values for a specified type.Deprecated, for removal: This API element is subject to removal in a future version.since agesgetEnumerationType(String code) Deprecated, for removal: This API element is subject to removal in a future version.since agesGets the enumeration type for code.getEnumerationValue(HybrisEnumValue plainEnum) Converts a plain enum value into its underlying model.getEnumerationValue(String type, String code) Returns a specific enumeration value.getInitialAttributeDescriptorsForType(ComposedTypeModel composedTypeModel) Returns all attribute descriptors of this type which are marked as being initial.getMandatoryAttributes(String type, boolean forCreation) Provides all mandatory attributes required to save models of the specified type.Returns model class for a type.getModelClass(String typeCode) Returns model class for a type code.getPartOfAttributes(String composedTypeCode) Provides all attribute qualifiers marked as part-of within the given type.getRuntimeAttributeDescriptorsForType(ComposedTypeModel composedTypeModel) Gets all runtime attributes for a type.Deprecated, for removal: This API element is subject to removal in a future version.since agesgetTypeForCode(String code) Returns a specific type.getUniqueAttributes(String type) Provides all attributes marked as unique within the given type.getUniqueModelRootType(String composedTypeCode) This method finds for the givencomposedtypecodethe root ComposedType which contains/declares the same unique attributes as the given ComposedType.booleanhasAttribute(ComposedTypeModel type, String qualifier) Checks if type has attribute.booleanisAssignableFrom(TypeModel target, TypeModel source) booleanisAssignableFrom(String superModelTypeCode, String subModelTypeCode) Returnstrueif the model type, given by the parametersuperModelTypeCode, is a super type of the type of the model OR the same type as the type of the model, given by the parametersubModelTypeCode.booleanisInstance(TypeModel typemodel, Object obj) Tests if the given object is an item instance of Type type.isRuntimeAttribute(AttributeDescriptorModel attributeDescriptorModel) Checks if the attribute descriptor is a runtime one.voidsetConverterRegistry(ConverterRegistry converterRegistry) voidsetEnumerationManager(EnumerationManager enumerationManager) voidsetTypeDao(TypeDao typeDao) Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
Constructor Details
-
DefaultTypeService
public DefaultTypeService()
-
-
Method Details
-
getAtomicType
Deprecated, for removal: This API element is subject to removal in a future version.since agesDescription copied from interface:TypeServiceReturns a specific atomic type.- Specified by:
getAtomicTypein interfaceTypeService- Parameters:
typeCode- the unique code of this type
-
getAtomicTypeForCode
Description copied from interface:TypeServiceGets the atomic type for code.- Specified by:
getAtomicTypeForCodein interfaceTypeService- Parameters:
code- the code- Returns:
- the atomic type for code
-
getAtomicTypeForJavaClass
Description copied from interface:TypeServiceReturns the atomic type for java class.- Specified by:
getAtomicTypeForJavaClassin interfaceTypeService- Parameters:
javaClass- the java class that we are looking atomic type for- Returns:
- the atomic type for java class
-
getComposedType
@Deprecated(since="ages", forRemoval=true) public ComposedTypeModel getComposedType(String typeCode) Deprecated, for removal: This API element is subject to removal in a future version.since agesDescription copied from interface:TypeServiceReturns a specific composed type.- Specified by:
getComposedTypein interfaceTypeService- Parameters:
typeCode- the unique code of this type
-
getComposedTypeForCode
Description copied from interface:TypeServiceReturns the specific composed type for code.- Specified by:
getComposedTypeForCodein interfaceTypeService- Parameters:
code- the unique code of this type code- Returns:
- the composed type for the specified code
-
getComposedType
@Deprecated(since="ages", forRemoval=true) public ComposedTypeModel getComposedType(Class modelClass) Deprecated, for removal: This API element is subject to removal in a future version.since agesDescription copied from interface:TypeServiceReturns the composed type for a specified model class.- Specified by:
getComposedTypein interfaceTypeService- Parameters:
modelClass- the model class
-
getComposedTypeForClass
Description copied from interface:TypeServiceReturns the specific composed type for the model class.- Specified by:
getComposedTypeForClassin interfaceTypeService- Parameters:
modelClass- the model class we are looking composed type for- Returns:
- the composed type for class
-
getType
Deprecated, for removal: This API element is subject to removal in a future version.since agesDescription copied from interface:TypeServiceReturns a specific type. This includes composed, atomic, collection and map types.- Specified by:
getTypein interfaceTypeService- Parameters:
typeCode- the unique code of this type
-
getTypeForCode
Description copied from interface:TypeServiceReturns a specific type. This includes composed, atomic, collection and map types.- Specified by:
getTypeForCodein interfaceTypeService- Parameters:
code- the code for the required type- Returns:
- the type for code
-
getAttributeDescriptor
public AttributeDescriptorModel getAttributeDescriptor(ComposedTypeModel composedType, String qualifier) Description copied from interface:TypeServiceReturns a specific attribute descriptor for a given composed type. This includes declared and inherited attributes.- Specified by:
getAttributeDescriptorin interfaceTypeService- Parameters:
composedType- the composed type to get attribute descriptor forqualifier- the attribute qualifier
-
getAttributeDescriptor
Description copied from interface:TypeServiceReturns a specific attribute descriptor for a given composed type. This includes declared and inherited attributes.- Specified by:
getAttributeDescriptorin interfaceTypeService- Parameters:
composedType- the code of the composed type to get attribute descriptor forqualifier- the attribute qualifier
-
getAttributeDescriptors
@Deprecated(since="ages", forRemoval=true) public Set<AttributeDescriptorModel> getAttributeDescriptors(ComposedTypeModel composedType) Deprecated, for removal: This API element is subject to removal in a future version.since agesDescription copied from interface:TypeServiceReturns all attribute descriptors of a single composed type. This includes declared and inherited ones.- Specified by:
getAttributeDescriptorsin interfaceTypeService- Parameters:
composedType- the composed type to get attribute descriptors from
-
getAttributeDescriptorsForType
!!Note!! this service is not returning VariantAttributeDescriptors if there are any.- Specified by:
getAttributeDescriptorsForTypein interfaceTypeService- Parameters:
composedType- the composed type- Returns:
- the attribute descriptors for type
-
getRuntimeAttributeDescriptorsForType
public Collection<AttributeDescriptorModel> getRuntimeAttributeDescriptorsForType(ComposedTypeModel composedTypeModel) Description copied from interface:TypeServiceGets all runtime attributes for a type. A runtime attribute was created from a code and does not have a definition in the *item.xml.- Specified by:
getRuntimeAttributeDescriptorsForTypein interfaceTypeService- Parameters:
composedTypeModel- the composed type model model- Returns:
- runtime attributes
-
isRuntimeAttribute
Description copied from interface:TypeServiceChecks if the attribute descriptor is a runtime one. A runtime attribute was created from a code and does not have a definition in the *item.xml. For attributes marked as dontoptimize it returns false.- Specified by:
isRuntimeAttributein interfaceTypeService- Parameters:
attributeDescriptorModel- the attribute descriptor model- Returns:
- true is the attribute is runtime
-
getAttributeDescriptors
@Deprecated(since="ages", forRemoval=true) public Set<AttributeDescriptorModel> getAttributeDescriptors(String composedTypeCode) Deprecated, for removal: This API element is subject to removal in a future version.since agesDescription copied from interface:TypeServiceReturns all attribute descriptors (asAttributeDescriptorModel) of a single composed type. This includes declared and inherited ones. This also includes attributes which are not generated in the model layer.- Specified by:
getAttributeDescriptorsin interfaceTypeService- Parameters:
composedTypeCode- the code of the composed type to get attribute descriptors from
-
getInitialAttributeDescriptorsForType
public Set<AttributeDescriptorModel> getInitialAttributeDescriptorsForType(ComposedTypeModel composedTypeModel) Description copied from interface:TypeServiceReturns all attribute descriptors of this type which are marked as being initial.Initial attributes are normally non-writable attributes intended to be set during item creation only. Therefore having initial and writable attributed does not make much sense.
- Specified by:
getInitialAttributeDescriptorsForTypein interfaceTypeService- Parameters:
composedTypeModel- the composed type model we look initial attribute descriptors for- Returns:
- the initial attribute descriptors for the given model
-
getEnumerationType
@Deprecated(since="ages", forRemoval=true) public EnumerationMetaTypeModel getEnumerationType(String code) Deprecated, for removal: This API element is subject to removal in a future version.since agesDescription copied from interface:TypeServiceReturns a specific enumeration type.- Specified by:
getEnumerationTypein interfaceTypeService- Parameters:
code- the unique code of this type
-
getEnumerationTypeForCode
Description copied from interface:TypeServiceGets the enumeration type for code.- Specified by:
getEnumerationTypeForCodein interfaceTypeService- Parameters:
code- the code for the required type- Returns:
- the enumeration type for code
-
getEnumerationValue
Description copied from interface:TypeServiceReturns a specific enumeration value.- Specified by:
getEnumerationValuein interfaceTypeService- Parameters:
type- the enumeration type codecode- the value code
-
getEnumerationValue
Description copied from interface:TypeServiceConverts a plain enum value into its underlying model.- Specified by:
getEnumerationValuein interfaceTypeService- Parameters:
plainEnum- the enum constant
-
getMandatoryAttributes
Description copied from interface:TypeServiceProvides all mandatory attributes required to save models of the specified type. If the model is new (creation) this method will return initial attributes but omit attributes providing default values. Otherwise initial attributes are omitted but all other mandatory ones are returned no matter if they've got default values or not.- Specified by:
getMandatoryAttributesin interfaceTypeService- Parameters:
type- the type to get attributes forforCreation- creation or update
-
getUniqueAttributes
Description copied from interface:TypeServiceProvides all attributes marked as unique within the given type.- Specified by:
getUniqueAttributesin interfaceTypeService- Parameters:
type- the type to get unique attributes for- Returns:
- an empty set if type has no unique attributes
-
getUniqueModelRootType
Description copied from interface:TypeServiceThis method finds for the givencomposedtypecodethe root ComposedType which contains/declares the same unique attributes as the given ComposedType. This could be the same typecode or a typecode of any supertype of this ComposedType. The result is returned as typecode String.- Specified by:
getUniqueModelRootTypein interfaceTypeService- Parameters:
composedTypeCode- any composed type code of the platform- Returns:
nullif the given ComposedType contains no unique attributes.
-
getDefaultValues
Description copied from interface:TypeServiceFetches all configured default values for a specified type.- Specified by:
getDefaultValuesin interfaceTypeService- Parameters:
type- the type to get default values for- Returns:
- a map containing all attributes and their default values which have got a configured value
-
getDefaultValues
Description copied from interface:TypeServiceFetches a subset of all configured default values for a specified type.- Specified by:
getDefaultValuesin interfaceTypeService- Parameters:
type- the type to get default values forattributes- the attributes to consider- Returns:
- a map containing all attributes and their default values which have got a configured value
-
isAssignableFrom
Description copied from interface:TypeServiceReturnstrueif theTypeModel, given by the parametersuperModelType, is a super type of theTypeModelOR the same type as theTypeModel, given by the parametersubModelTypeCode.- Specified by:
isAssignableFromin interfaceTypeService- Returns:
trueif source type can be assigned to target type
-
isInstance
Description copied from interface:TypeServiceTests if the given object is an item instance of Type type.- Specified by:
isInstancein interfaceTypeService- Returns:
trueif given object is an item instance of Type type
-
isAssignableFrom
Description copied from interface:TypeServiceReturnstrueif the model type, given by the parametersuperModelTypeCode, is a super type of the type of the model OR the same type as the type of the model, given by the parametersubModelTypeCode.- Specified by:
isAssignableFromin interfaceTypeService- Parameters:
superModelTypeCode- - the type code (TypeModel) of the super typesubModelTypeCode- - the type code (TypeModel) of the sub type- Returns:
falseif the sub model type is not addignable from the super model type or if any parameter isnull
-
getPartOfAttributes
Description copied from interface:TypeServiceProvides all attribute qualifiers marked as part-of within the given type.- Specified by:
getPartOfAttributesin interfaceTypeService- Parameters:
composedTypeCode- the composedType code to get part-of attributes for- Returns:
- an empty set if type has no part-of attributes
-
setConverterRegistry
-
getTypeDao
-
setTypeDao
-
getEnumerationManager
Deprecated, for removal: This API element is subject to removal in a future version.since ages -
setEnumerationManager
-
hasAttribute
Description copied from interface:TypeServiceChecks if type has attribute.- Specified by:
hasAttributein interfaceTypeService- Parameters:
type- typequalifier- qualifier to check- Returns:
- true if type has attribute
-
getModelClass
Description copied from interface:TypeServiceReturns model class for a type.- Specified by:
getModelClassin interfaceTypeService- Parameters:
type- type- Returns:
- model class for a given type
-
getModelClass
Description copied from interface:TypeServiceReturns model class for a type code.- Specified by:
getModelClassin interfaceTypeService- Parameters:
typeCode- code of a type- Returns:
- model class for a given type code
-
getAttributesForModifiers
public Set<AttributeDescriptorModel> getAttributesForModifiers(String composedTypeCode, AttributeModifierCriteria criteria) Description copied from interface:TypeServiceGets the attributes for modifiers for given composed type and criteria container. To add proper criterias to the argument use constants in the classAttributeModifiers.- Specified by:
getAttributesForModifiersin interfaceTypeService- Parameters:
composedTypeCode- the composed type codecriteria- the criteria- Returns:
- the attributes for modifiers
-