Class ItemType
java.lang.Object
de.hybris.platform.integrationservices.util.files.ItemType
Representation of an item type in the type system. This representation is generic and does not distinguish between types of an
item, e.g. a collection item type, a composed item type, an enum type, etc.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsAttribute(String name) Checks whether this item type contains an attribute with the specified name.static ItemTypeCreates an item type other thanComposedType, such as an enum or a map.static ItemTypecreate(@NotNull Element el, TypeService service) Creates an instance of aComposedTypeitem.booleanRetrieves attributes explicitly defined in this item type within the context items.xml file.Retrieves a collection of all item types this type inherits from in the type system.Retrieves type code of this item type.inthashCode()booleanDetermines whether this item type is created by the context items.xml or it was created in a different file and simply acquired more attributes or relations in the context items.xml.withAttribute(String attribute) Adds an attribute to this item type.withAttributes(Collection<String> attributes) Adds attributes to this item type.
-
Method Details
-
create
Creates an item type other thanComposedType, such as an enum or a map.- Parameters:
el- XML element containing the item type configuration
-
create
Creates an instance of aComposedTypeitem.- Parameters:
el- XML element containing the item type configurationservice- instance of the type service to query about the item type hierarchy.
-
getTypeCode
Retrieves type code of this item type.- Returns:
- a code that identifies this item type.
-
isCreated
public boolean isCreated()Determines whether this item type is created by the context items.xml or it was created in a different file and simply acquired more attributes or relations in the context items.xml. The implementation assumes that, if the item type definition does not contain"autocreate"attribute then it's by default istrueor, otherwise, it takes the attribute value to determine whether the file creates this type or not.- Returns:
trueif this item type is created in the context items.xml;falseotherwise.
-
withAttributes
Adds attributes to this item type.- Parameters:
attributes- a collection of attribute names present in this item type- Returns:
- an item type with the attributes added.
-
withAttribute
Adds an attribute to this item type.- Parameters:
attribute- name of an attribute present in this item type- Returns:
- an item type with the attribute added.
-
getAttributes
Retrieves attributes explicitly defined in this item type within the context items.xml file.- Returns:
- attributes for this item type defined in items.xml file, from which this item type was derived. Inherited attributes defined in other items.xml files are excluded. If this item type does not contain attributes, then an empty collection is returned.
- See Also:
-
getInheritedItems
Retrieves a collection of all item types this type inherits from in the type system.- Returns:
- a collection of all supertypes for this item type or an empty collection, if this item type does not extend any
other type or, if this type does not represent the
ComposedTypein the type system.
-
containsAttribute
Checks whether this item type contains an attribute with the specified name. The name is case-insensitive.- Parameters:
name- name of the attribute to check for presence in this item type.- Returns:
true, if this item type contains the specified attribute regardless of the letter case match;falseotherwise.
-
hashCode
public int hashCode() -
equals
-