Class ClassTypeAttributeDescriptor
- All Implemented Interfaces:
TypeAttributeDescriptor
DefaultDescriptorFactory
TypeAttributeDescriptor implementation for a IntegrationObjectClassAttributeModel.-
Method Summary
Modifier and TypeMethodDescriptionaccessor()Gets theAttributeValueAccessorfor accessing this attribute's valueGets name of the attribute described by this descriptor.Retrieves type of this attribute value(s).Gets theCollectionDescriptorGets a map descriptor for this attribute.Gets name of this attribute in the platform type system.Retrieves descriptor of the type, this attribute is associated with.booleanDetermines whether the item referenced by this attribute should be persisted when the item with this attribute is persisted.booleanDetermines whether this attribute contains a single value or multiple values (a collection of values).booleanDetermines whether this attribute is a key attributebooleanDetermines whether the value of this descriptor can be localized.booleanisMap()Determines whether the attribute is referring to a map of values.booleanDetermines whether the attribute represented by this descriptor can takenullvalues.booleanisPartOf()Determines whether the item referenced by this attribute should be a part of the attribute's item model or not.booleanDetermines whether the value of this descriptor is a primitive typebooleanDetermines whether this attribute is readablebooleanisSettable(Object item) Indicates whether this attribute's value can be set.reverse()Reverses the relation described by this attribute descriptor and retrieves an attribute descriptor defined in theTypeAttributeDescriptor.getAttributeType()type descriptor withTypeAttributeDescriptor.getTypeDescriptor()attribute type.Methods inherited from class de.hybris.platform.integrationservices.model.impl.AbstractDescriptor
getFactory
-
Method Details
-
getAttributeName
Description copied from interface:TypeAttributeDescriptorGets name of the attribute described by this descriptor.- Specified by:
getAttributeNamein interfaceTypeAttributeDescriptor- Returns:
- name of the attribute as it was defined for the integration object.
-
getQualifier
Gets name of this attribute in the platform type system.- Specified by:
getQualifierin interfaceTypeAttributeDescriptor- Returns:
- always returns an empty string as class types are not persisted in platform.
-
isCollection
public boolean isCollection()Description copied from interface:TypeAttributeDescriptorDetermines whether this attribute contains a single value or multiple values (a collection of values).- Specified by:
isCollectionin interfaceTypeAttributeDescriptor- Returns:
true, if this attribute contains a collection of primitive or complex type values;false, if this attribute contains only a single primitive or complex type value.
-
getAttributeType
Retrieves type of this attribute value(s).- Specified by:
getAttributeTypein interfaceTypeAttributeDescriptor- Returns:
- type of this attribute value
- See Also:
-
getTypeDescriptor
Description copied from interface:TypeAttributeDescriptorRetrieves descriptor of the type, this attribute is associated with.- Specified by:
getTypeDescriptorin interfaceTypeAttributeDescriptor- Returns:
- descriptor of the item type that contains the attribute described by this attribute descriptor.
-
reverse
Description copied from interface:TypeAttributeDescriptorReverses the relation described by this attribute descriptor and retrieves an attribute descriptor defined in the
TypeAttributeDescriptor.getAttributeType()type descriptor withTypeAttributeDescriptor.getTypeDescriptor()attribute type.For example, type
Parenthas attributechildrenthat refers a collection of typeChild; and typeChildhas an attributeparentreferring back toParenttype. Then attribute descriptor forparentattribute is reverse forchildrenattribute descriptor.Another example, type
Organizationhas attributeaddressesthat refers a collection of typeAddress; but typeAddressdoes not refer back to typeOrganization. In this case there is no reverse attribute foraddressesattribute descriptor.- Specified by:
reversein interfaceTypeAttributeDescriptor- Returns:
- an optional containing a descriptor for the attribute in type returned by
TypeAttributeDescriptor.getAttributeType(), which refers back to the type retrieved by callingTypeAttributeDescriptor.getTypeDescriptor()on this attribute descriptor; or an empty optional that attribute type of this descriptor does not refer back to the type containing this attribute descriptor.
-
isNullable
public boolean isNullable()Description copied from interface:TypeAttributeDescriptorDetermines whether the attribute represented by this descriptor can takenullvalues.- Specified by:
isNullablein interfaceTypeAttributeDescriptor- Returns:
true, if the attribute can takenullvalues;false, if the attribute value is required.
-
isPartOf
public boolean isPartOf()Determines whether the item referenced by this attribute should be a part of the attribute's item model or not. This defines in particular whether the nested referenced item will be created whenever the "container" item is persisted (part of) or it can and should exist and persist independently (not a part of). For example, aCarhas an attributeengine, which refers itemEngine. If the business model is interested in cars only and does not care about engines outside the car model, then the attribute should be defined withpartOf == true. If the engine has independent existence, e.g. engine can be sold without a car, then the attribute should be defined withpartOf == false.In other words, this attribute descriptor defines a relation between an owner and the owned item. Thus in the example above
Engineis owned byCaras it does not have independent existence in the model.- Specified by:
isPartOfin interfaceTypeAttributeDescriptor- Returns:
- always
false, as classes can exist independently. - See Also:
-
isAutoCreate
public boolean isAutoCreate()Determines whether the item referenced by this attribute should be persisted when the item with this attribute is persisted. UnlikeTypeAttributeDescriptor.isPartOf()this method does not require the referenced item to be an integral part of the owner item. The referenced item may have its independent existence in the domain model and yet it will be persisted together with the item holding an attribute described by this descriptor.- Specified by:
isAutoCreatein interfaceTypeAttributeDescriptor- Returns:
- always
false, as classes can exist independently. - See Also:
-
isLocalized
public boolean isLocalized()Description copied from interface:TypeAttributeDescriptorDetermines whether the value of this descriptor can be localized. This method may need to be used withTypeAttributeDescriptor.isMap()to determine whether the attribute supports multiple locale specific values. Some attributes may be localized but do not support multi-locale values. For example, a simple Numeric or Boolean attribute can be declared as localized.- Specified by:
isLocalizedin interfaceTypeAttributeDescriptor- Returns:
- true if localized, else false
-
isPrimitive
public boolean isPrimitive()Description copied from interface:TypeAttributeDescriptorDetermines whether the value of this descriptor is a primitive type- Specified by:
isPrimitivein interfaceTypeAttributeDescriptor- Returns:
- true if it's a primitive type, else false
-
isMap
public boolean isMap()Description copied from interface:TypeAttributeDescriptorDetermines whether the attribute is referring to a map of values. Typically, used to determine in conjunction withTypeAttributeDescriptor.isLocalized()to determine whether the attribute can hold multiple locale specific values. However, it can be used by itself.- Specified by:
isMapin interfaceTypeAttributeDescriptor- Returns:
true, if the attribute refers to a map;falseotherwise.
-
isSettable
Indicates whether this attribute's value can be set.- Specified by:
isSettablein interfaceTypeAttributeDescriptor- Returns:
- always returns
false.
-
isKeyAttribute
public boolean isKeyAttribute()Determines whether this attribute is a key attribute- Specified by:
isKeyAttributein interfaceTypeAttributeDescriptor- Returns:
- always
false, as class type cannot have a key.
-
isReadable
public boolean isReadable()Determines whether this attribute is readable- Specified by:
isReadablein interfaceTypeAttributeDescriptor- Returns:
- always
true.
-
getCollectionDescriptor
Gets theCollectionDescriptor- Specified by:
getCollectionDescriptorin interfaceTypeAttributeDescriptor- Returns:
- A collection descriptor
-
getMapDescriptor
Gets a map descriptor for this attribute.- Specified by:
getMapDescriptorin interfaceTypeAttributeDescriptor- Returns:
Optionalcontaining aMapDescriptor, if this attribute is of Map type; otherwise returnsOptional.empty()- See Also:
-
accessor
Description copied from interface:TypeAttributeDescriptorGets theAttributeValueAccessorfor accessing this attribute's value- Specified by:
accessorin interfaceTypeAttributeDescriptor- Returns:
- The AttributeValueAccessor
-