public class DefaultTypeService extends AbstractBusinessService implements TypeService
AbstractService.SerializableDTOmodelService, sessionService, txManagertenant| Constructor and Description |
|---|
DefaultTypeService() |
| Modifier and Type | Method and Description |
|---|---|
AtomicTypeModel |
getAtomicType(String typeCode)
Deprecated.
|
AtomicTypeModel |
getAtomicTypeForCode(String code)
Gets the atomic type for code.
|
AtomicTypeModel |
getAtomicTypeForJavaClass(Class javaClass)
Returns the atomic type for java class.
|
AttributeDescriptorModel |
getAttributeDescriptor(ComposedTypeModel composedType,
String qualifier)
Returns a specific attribute descriptor for a given composed type.
|
AttributeDescriptorModel |
getAttributeDescriptor(String composedType,
String qualifier)
Returns a specific attribute descriptor for a given composed type.
|
Set<AttributeDescriptorModel> |
getAttributeDescriptors(ComposedTypeModel composedType)
Deprecated.
|
Set<AttributeDescriptorModel> |
getAttributeDescriptors(String composedTypeCode)
Deprecated.
|
Set<AttributeDescriptorModel> |
getAttributeDescriptorsForType(ComposedTypeModel composedType)
!!Note!! this service is not returning VariantAttributeDescriptors if there are any.
|
Set<AttributeDescriptorModel> |
getAttributesForModifiers(String composedTypeCode,
AttributeModifierCriteria criteria)
Gets the attributes for modifiers for given composed type and criteria container.
|
ComposedTypeModel |
getComposedType(Class modelClass)
Deprecated.
|
ComposedTypeModel |
getComposedType(String typeCode)
Deprecated.
|
ComposedTypeModel |
getComposedTypeForClass(Class modelClass)
Returns the specific composed type for the model class.
|
ComposedTypeModel |
getComposedTypeForCode(String code)
Returns the specific composed type for code.
|
Map<String,Object> |
getDefaultValues(String type)
Fetches all configured default values for a specified type.
|
Map<String,Object> |
getDefaultValues(String type,
Collection<String> attributes)
Fetches a subset of all configured default values for a specified type.
|
EnumerationManager |
getEnumerationManager()
Deprecated.
|
EnumerationMetaTypeModel |
getEnumerationType(String code)
Deprecated.
|
EnumerationMetaTypeModel |
getEnumerationTypeForCode(String code)
Gets the enumeration type for code.
|
EnumerationValueModel |
getEnumerationValue(HybrisEnumValue plainEnum)
Converts a plain enum value into its underlying model.
|
EnumerationValueModel |
getEnumerationValue(String type,
String code)
Returns a specific enumeration value.
|
Set<AttributeDescriptorModel> |
getInitialAttributeDescriptorsForType(ComposedTypeModel composedTypeModel)
Returns all attribute descriptors of this type which are marked as being initial.
|
Set<String> |
getMandatoryAttributes(String type,
boolean forCreation)
Provides all mandatory attributes required to save models of the specified type.
|
<T extends ItemModel> |
getModelClass(ComposedTypeModel type)
Returns model class for a type.
|
<T extends ItemModel> |
getModelClass(String typeCode)
Returns model class for a type code.
|
TypeModel |
getType(String typeCode)
Deprecated.
|
TypeDao |
getTypeDao() |
TypeModel |
getTypeForCode(String code)
Returns a specific type.
|
Set<String> |
getUniqueAttributes(String type)
Provides all attributes marked as unique within the given type.
|
String |
getUniqueModelRootType(String composedTypeCode)
This method finds for the given
composedtypecode the root ComposedType which contains/declares the
same unique attributes as the given ComposedType. |
Set<String> |
getWritablePartOfAttributes(String composedTypeCode)
Deprecated.
|
boolean |
hasAttribute(ComposedTypeModel type,
String qualifier)
Checks if type has attribute.
|
boolean |
isAssignableFrom(String superModelTypeCode,
String subModelTypeCode)
Returns
true if the model type, given by the parameter superModelTypeCode, is a super
type of the type of the model OR the same type as the type of the model, given by the parameter
subModelTypeCode. |
boolean |
isAssignableFrom(TypeModel target,
TypeModel source)
|
boolean |
isInstance(TypeModel typemodel,
Object obj)
Tests if the given object is an item instance of Type type.
|
void |
setConverterRegistry(ConverterRegistry converterRegistry) |
void |
setEnumerationManager(EnumerationManager enumerationManager) |
void |
setTypeDao(TypeDao typeDao) |
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, setTenantScope, writeReplace@Deprecated public AtomicTypeModel getAtomicType(String typeCode)
TypeServicegetAtomicType in interface TypeServicetypeCode - the unique code of this typepublic AtomicTypeModel getAtomicTypeForCode(String code)
TypeServicegetAtomicTypeForCode in interface TypeServicecode - the codepublic AtomicTypeModel getAtomicTypeForJavaClass(Class javaClass)
TypeServicegetAtomicTypeForJavaClass in interface TypeServicejavaClass - the java class that we are looking atomic type for@Deprecated public ComposedTypeModel getComposedType(String typeCode)
TypeServicegetComposedType in interface TypeServicetypeCode - the unique code of this typepublic ComposedTypeModel getComposedTypeForCode(String code)
TypeServicegetComposedTypeForCode in interface TypeServicecode - the unique code of this type code@Deprecated public ComposedTypeModel getComposedType(Class modelClass)
TypeServicegetComposedType in interface TypeServicemodelClass - the model classpublic ComposedTypeModel getComposedTypeForClass(Class modelClass)
TypeServicegetComposedTypeForClass in interface TypeServicemodelClass - the model class we are looking composed type for@Deprecated public TypeModel getType(String typeCode)
TypeServicegetType in interface TypeServicetypeCode - the unique code of this typepublic TypeModel getTypeForCode(String code)
TypeServicegetTypeForCode in interface TypeServicecode - the code for the required typepublic AttributeDescriptorModel getAttributeDescriptor(ComposedTypeModel composedType, String qualifier)
TypeServicegetAttributeDescriptor in interface TypeServicecomposedType - the composed type to get attribute descriptor forqualifier - the attribute qualifierpublic AttributeDescriptorModel getAttributeDescriptor(String composedType, String qualifier)
TypeServicegetAttributeDescriptor in interface TypeServicecomposedType - the code of the composed type to get attribute descriptor forqualifier - the attribute qualifier@Deprecated public Set<AttributeDescriptorModel> getAttributeDescriptors(ComposedTypeModel composedType)
TypeServicegetAttributeDescriptors in interface TypeServicecomposedType - the composed type to get attribute descriptors frompublic Set<AttributeDescriptorModel> getAttributeDescriptorsForType(ComposedTypeModel composedType)
getAttributeDescriptorsForType in interface TypeServicecomposedType - the composed type@Deprecated public Set<AttributeDescriptorModel> getAttributeDescriptors(String composedTypeCode)
TypeServiceAttributeDescriptorModel) of a single composed type. This includes
declared and inherited ones. This also includes attributes which are not generated in the model layer.getAttributeDescriptors in interface TypeServicecomposedTypeCode - the code of the composed type to get attribute descriptors frompublic Set<AttributeDescriptorModel> getInitialAttributeDescriptorsForType(ComposedTypeModel composedTypeModel)
TypeServiceInitial 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.
getInitialAttributeDescriptorsForType in interface TypeServicecomposedTypeModel - the composed type model we look initial attribute descriptors for@Deprecated public EnumerationMetaTypeModel getEnumerationType(String code)
TypeServicegetEnumerationType in interface TypeServicecode - the unique code of this typepublic EnumerationMetaTypeModel getEnumerationTypeForCode(String code)
TypeServicegetEnumerationTypeForCode in interface TypeServicecode - the code for the required typepublic EnumerationValueModel getEnumerationValue(String type, String code)
TypeServicegetEnumerationValue in interface TypeServicetype - the enumeration type codecode - the value codepublic EnumerationValueModel getEnumerationValue(HybrisEnumValue plainEnum)
TypeServicegetEnumerationValue in interface TypeServiceplainEnum - the enum constantpublic Set<String> getMandatoryAttributes(String type, boolean forCreation)
TypeServicegetMandatoryAttributes in interface TypeServicetype - the type to get attributes forforCreation - creation or updatepublic Set<String> getUniqueAttributes(String type)
TypeServicegetUniqueAttributes in interface TypeServicetype - the type to get unique attributes forpublic String getUniqueModelRootType(String composedTypeCode)
TypeServicecomposedtypecode the 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.getUniqueModelRootType in interface TypeServicecomposedTypeCode - any composed type code of the platformnull if the given ComposedType contains no unique attributes.public Map<String,Object> getDefaultValues(String type)
TypeServicegetDefaultValues in interface TypeServicetype - the type to get default values forpublic Map<String,Object> getDefaultValues(String type, Collection<String> attributes)
TypeServicegetDefaultValues in interface TypeServicetype - the type to get default values forattributes - the attributes to considerpublic boolean isAssignableFrom(TypeModel target, TypeModel source)
TypeServicetrue if the TypeModel, given by the parameter superModelType, is a super
type of the TypeModel OR the same type as the TypeModel, given by the parameter
subModelTypeCode.isAssignableFrom in interface TypeServicetrue if source type can be assigned to target typepublic boolean isInstance(TypeModel typemodel, Object obj)
TypeServiceisInstance in interface TypeServicetrue if given object is an item instance of Type typepublic boolean isAssignableFrom(String superModelTypeCode, String subModelTypeCode)
TypeServicetrue if the model type, given by the parameter superModelTypeCode, is a super
type of the type of the model OR the same type as the type of the model, given by the parameter
subModelTypeCode.isAssignableFrom in interface TypeServicesuperModelTypeCode - - the type code (TypeModel) of the super typesubModelTypeCode - - the type code (TypeModel) of the sub typefalse if the sub model type is not addignable from the super model type or if any parameter
is null@Deprecated public Set<String> getWritablePartOfAttributes(String composedTypeCode)
TypeServicegetWritablePartOfAttributes in interface TypeServicecomposedTypeCode - the composedType code to get part-of attributes forpublic void setConverterRegistry(ConverterRegistry converterRegistry)
public TypeDao getTypeDao()
public void setTypeDao(TypeDao typeDao)
@Deprecated public EnumerationManager getEnumerationManager()
public void setEnumerationManager(EnumerationManager enumerationManager)
public boolean hasAttribute(ComposedTypeModel type, String qualifier)
TypeServicehasAttribute in interface TypeServicetype - typequalifier - qualifier to checkpublic <T extends ItemModel> Class<T> getModelClass(ComposedTypeModel type)
TypeServicegetModelClass in interface TypeServicetype - typepublic <T extends ItemModel> Class<T> getModelClass(String typeCode)
TypeServicegetModelClass in interface TypeServicetypeCode - code of a typepublic Set<AttributeDescriptorModel> getAttributesForModifiers(String composedTypeCode, AttributeModifierCriteria criteria)
TypeServiceAttributeModifiers.getAttributesForModifiers in interface TypeServicecomposedTypeCode - the composed type codecriteria - the criteriaCopyright © 2017 SAP SE. All Rights Reserved.