public interface TypeService
TypeModel, DescriptorModel
and related objects.| Modifier and Type | Method and Description |
|---|---|
AtomicTypeModel |
getAtomicType(String code)
Deprecated.
use
getAtomicTypeForCode(String) instead. |
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 composedTypeCode,
String qualifier)
Returns a specific attribute descriptor for a given composed type.
|
Set<AttributeDescriptorModel> |
getAttributeDescriptors(ComposedTypeModel composedType)
Deprecated.
- use
getAttributeDescriptorsForType(ComposedTypeModel) instead. |
Set<AttributeDescriptorModel> |
getAttributeDescriptors(String composedTypeCode)
Deprecated.
use
getAttributeDescriptorsForType(ComposedTypeModel) instead. |
Set<AttributeDescriptorModel> |
getAttributeDescriptorsForType(ComposedTypeModel composedType)
Gets the attribute descriptors for type.
|
Set<AttributeDescriptorModel> |
getAttributesForModifiers(String composedTypeCode,
AttributeModifierCriteria criteria)
Gets the attributes for modifiers for given composed type and criteria container.
|
ComposedTypeModel |
getComposedType(Class modelClass)
Deprecated.
use
getComposedTypeForClass(Class) instead. |
ComposedTypeModel |
getComposedType(String code)
Deprecated.
use
getComposedTypeForCode(String) instead. |
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.
|
EnumerationMetaTypeModel |
getEnumerationType(String code)
Deprecated.
use
getEnumerationTypeForCode(String) instead. |
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 code)
Deprecated.
use
getTypeForCode(String) instead. |
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.
- this is not much used functionality, include it in required place
|
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 superModelType,
TypeModel subModelType)
|
boolean |
isInstance(TypeModel type,
Object obj)
Tests if the given object is an item instance of Type type.
|
@Deprecated ComposedTypeModel getComposedType(String code)
getComposedTypeForCode(String) instead.code - the unique code of this typeUnknownIdentifierException - if no type exist for this codeComposedTypeModel getComposedTypeForCode(String code)
code - the unique code of this type codeIllegalArgumentException - thrown when given code is nullAmbiguousIdentifierException - the ambiguous identifier exception when more than one composed type for given code is foundUnknownIdentifierException - the unknown identifier exception when no composed type for given code is found@Deprecated ComposedTypeModel getComposedType(Class modelClass)
getComposedTypeForClass(Class) instead.modelClass - the model classIllegalArgumentException - if no type is mapped to this modelComposedTypeModel getComposedTypeForClass(Class modelClass)
modelClass - the model class we are looking composed type forIllegalArgumentException - thrown when given modelClass is nullUnknownIdentifierException - the unknown identifier exception when no composed type for given modelClass is foundAttributeDescriptorModel getAttributeDescriptor(ComposedTypeModel composedType, String qualifier)
composedType - the composed type to get attribute descriptor forqualifier - the attribute qualifierUnknownIdentifierException - if the composed type does not own a matching attributeAttributeDescriptorModel getAttributeDescriptor(String composedTypeCode, String qualifier)
composedTypeCode - the code of the composed type to get attribute descriptor forqualifier - the attribute qualifierUnknownIdentifierException - if the composed type does not own a matching attribute@Deprecated Set<AttributeDescriptorModel> getAttributeDescriptors(ComposedTypeModel composedType)
getAttributeDescriptorsForType(ComposedTypeModel) instead.composedType - the composed type to get attribute descriptors fromSet<AttributeDescriptorModel> getAttributeDescriptorsForType(ComposedTypeModel composedType)
composedType - the composed typeIllegalArgumentException - thrown when given type is null@Deprecated Set<AttributeDescriptorModel> getAttributeDescriptors(String composedTypeCode)
getAttributeDescriptorsForType(ComposedTypeModel) instead.AttributeDescriptorModel) of a single composed type. This includes
declared and inherited ones. This also includes attributes which are not generated in the model layer.composedTypeCode - the code of the composed type to get attribute descriptors fromUnknownIdentifierException - if no matching composed type existsSet<AttributeDescriptorModel> getInitialAttributeDescriptorsForType(ComposedTypeModel composedTypeModel)
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.
composedTypeModel - the composed type model we look initial attribute descriptors for@Deprecated AtomicTypeModel getAtomicType(String code)
getAtomicTypeForCode(String) instead.code - the unique code of this typeUnknownIdentifierException - if no type exist for this codeAtomicTypeModel getAtomicTypeForCode(String code)
code - the codeIllegalArgumentException - thrown when given code is nullUnknownIdentifierException - if no type exist for this codeAtomicTypeModel getAtomicTypeForJavaClass(Class javaClass)
javaClass - the java class that we are looking atomic type forIllegalArgumentException - thrown when given class is nullUnknownIdentifierException - if no type exist for this class@Deprecated TypeModel getType(String code)
getTypeForCode(String) instead.code - the unique code of this typeUnknownIdentifierException - if no type exist for this codeTypeModel getTypeForCode(String code)
code - the code for the required typeUnknownIdentifierException - if no type exist for this codeIllegalArgumentException - thrown when given code is null@Deprecated EnumerationMetaTypeModel getEnumerationType(String code)
getEnumerationTypeForCode(String) instead.code - the unique code of this typeUnknownIdentifierException - if no type exist for this codeEnumerationMetaTypeModel getEnumerationTypeForCode(String code)
code - the code for the required typeUnknownIdentifierException - if no type exist for this codeIllegalArgumentException - thrown when given code is nullEnumerationValueModel getEnumerationValue(String type, String code)
type - the enumeration type codecode - the value codeUnknownIdentifierException - if either no matching enumeration type exists or no value with matching codeIllegalArgumentException - thrown when given type or code is nullEnumerationValueModel getEnumerationValue(HybrisEnumValue plainEnum)
plainEnum - the enum constantIllegalArgumentException - thrown when given enum is nullSet<String> getMandatoryAttributes(String type, boolean forCreation)
type - the type to get attributes forforCreation - creation or updateSet<String> getUniqueAttributes(String type)
type - the type to get unique attributes forString getUniqueModelRootType(String composedtypecode)
composedtypecode 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.composedtypecode - any composed type code of the platformnull if the given ComposedType contains no unique attributes.IllegalArgumentException - if no such ComposedType by the given typecode existsMap<String,Object> getDefaultValues(String type)
type - the type to get default values forMap<String,Object> getDefaultValues(String type, Collection<String> attributes)
type - the type to get default values forattributes - the attributes to considerboolean isAssignableFrom(TypeModel superModelType, TypeModel subModelType)
true 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.superModelType - subModelType - true if source type can be assigned to target typeboolean isAssignableFrom(String superModelTypeCode, String subModelTypeCode)
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 isInstance(TypeModel type, Object obj)
type - obj - true if given object is an item instance of Type type@Deprecated Set<String> getWritablePartOfAttributes(String composedTypeCode)
composedTypeCode - the composedType code to get part-of attributes forboolean hasAttribute(ComposedTypeModel type, String qualifier)
type - typequalifier - qualifier to check<T extends ItemModel> Class<T> getModelClass(ComposedTypeModel type)
type - type<T extends ItemModel> Class<T> getModelClass(String typeCode)
typeCode - code of a typeSet<AttributeDescriptorModel> getAttributesForModifiers(String composedTypeCode, AttributeModifierCriteria criteria)
AttributeModifiers.composedTypeCode - the composed type codecriteria - the criteriaCopyright © 2017 SAP SE. All Rights Reserved.