Package de.hybris.platform.jalo.type
Class Type
- java.lang.Object
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable
- Direct Known Subclasses:
AtomicType
,CollectionType
,ComposedType
,MapType
public abstract class Type extends TypeManagerManaged
Abstract base class for all types.Types have a unique (case insensitive) code, know their instances and may provide a default value.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Type.TypeImpl
The persistence layer implementation interface.-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.type.TypeManagerManaged
TypeManagerManaged.TypeManagerManagedImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.Item
Item.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationException
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CODE
The code attribute string constant.static java.lang.String
DEFAULTVALUE
The default value attribute string constant.static java.lang.String
DESCRIPTION
The description attribute string constant.static java.lang.String
XMLDEFINITION
The xml definition attribute string constant.-
Fields inherited from class de.hybris.platform.jalo.type.TypeManagerManaged
AUTOCREATE, DEPRECATED, EXTENSION_NAME, GENERATE, NAME
-
Fields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLED
-
Fields inherited from class de.hybris.platform.jalo.Item
_CREATION_TIME_INTERNAL, _MODIFIED_TIME_INTERNAL, accessorLog, CREATION_TIME, DISABLE_ATTRIBUTE_CHECK, DISABLE_ITEMCHECK_BEFORE_REMOVABLE, EVEN, FEATURE_ACCESSMAP_QUALIFIER, HJMPTS, INITIAL_CREATION_FLAG, isJaloOnly, MODIFIED_TIME, NEGATIVE, NOT_FOUND, OWNER, PK, POSITIVE, SAVE_FROM_SERVICE_LAYER, staticTransientObjects, TYPE
-
Fields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant
-
-
Constructor Summary
Constructors Constructor Description Type()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compareTo(java.lang.Object o)
Makes types comparable by their code (case insenesitive).java.util.Map
getAllDescriptions()
java.util.Map
getAllDescriptions(SessionContext ctx)
java.lang.String
getCode()
Returns the unique code of this type.java.lang.Object
getDefaultValue()
Returns the default value of this type.java.lang.Object
getDefaultValue(SessionContext ctx)
Returns the default value of this type.java.lang.String
getDescription()
java.lang.String
getDescription(SessionContext ctx)
protected Type.TypeImpl
getTypeImpl()
Internal access to persistence layer implementation.abstract java.lang.String
getXMLDefinition()
Returns the XML definition string as expected byitems.xml
.abstract boolean
isAssignableFrom(Type type)
Tests if this type is assignable from a given type.abstract boolean
isInstance(java.lang.Object o)
Test whether an object is an instance of this type or not.abstract java.lang.Object
parseValue(SessionContext ctx, java.lang.String value)
void
setAllDescriptions(SessionContext ctx, java.util.Map descriptions)
Changes all descriptions by specifying a language-to-description map.void
setAllDescriptions(java.util.Map descriptions)
Changes all descriptions by specifying a language-to-description map.void
setDefaultValue(SessionContext ctx, java.lang.Object value)
Changes the default value of this type.void
setDefaultValue(java.lang.Object value)
Changes the default value of this type.void
setDescription(SessionContext ctx, java.lang.String description)
Changes the type description for the given session context language.void
setDescription(java.lang.String description)
Changes the type description for the current session language.java.lang.String
toString()
Provides a string representation of this type.abstract java.lang.String
toString(SessionContext ctx, java.lang.Object value)
-
Methods inherited from class de.hybris.platform.jalo.type.TypeManagerManaged
exportXMLDefinition, getAllNames, getAllNames, getExtensionName, getImpl, getName, getName, isAutocreate, isDeprecated, isGenerate, setAllNames, setAllNames, setAutocreate, setExtensionName, setGenerate, setName, setName
-
Methods inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllValuesSessionContext, getLocalizedProperty, getLocalizedProperty, getLocalizedPropertyInternal, getLocalizedPropertyNames, getLocalizedPropertyNames, hasLanguage, isEmptyValue, isFallbackEnabled, removeLocalizedProperty, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedProperty, setLocalizedProperty
-
Methods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getImplementation, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setProperty
-
Methods inherited from class de.hybris.platform.jalo.Item
addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addNegativePermission, addPermission, addPositivePermission, assureExtensionsLoaded, changeTypeAfterCreation, checkConstraint, checkItemPermission, checkMandatoryAttribute, checkMandatoryAttribute, checkPermission, checkPermission, checkRemovable, clearPermission, createItem, ctx, doAfterRemove, doBeforeRemove, equals, getAccessorFor, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributesInternal, getAllLinkedItems, getAndCheckCacheBoundItem, getAttribute, getAttribute, getCacheBoundItem, getComposedType, getComposedTypePK, getCreationTime, getCurrentlyRemovingCount, getDefaultAttributeModes, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItemsCount, getLinkedItemsCount, getLinkedItemsCount, getModificationTime, getNegativePermissions, getNonInitialAttributes, getOwner, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, getRelatedItems, getRestrictedPrincipals, getSession, getSyncObject, getTenant, getTransientObject, getTransientObjectMap, hashCode, hasRegisteredClassAccessorFor, internal_registerClassAccessorFor, internal_registerNonClassAccessorFor, invalidateLocalCaches, isAlive, isCacheBound, isCurrentlyRemoving, isCurrentlyRemoving, isEmptyRelationValue, isInCreate, isInstanceOf, isItemCheckBeforeRemoveableDisabled, isMarkModifiedDisabled, isRelationLocalizationFallbackEnabled, newInstance, notifyExtensionsAfterItemCreation, notifyExtensionsBeforeItemCreation, notifyItemRemoval, notifyManagerAboutItemRemoval, readResolve, registerAccessFor, registerAccessFor, registerJaloInvalidationListeners, remove, remove, removeItemCollection, removeItemCollection, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinks, removePartOfItems, removePartOfItems, setAllAttributes, setAllAttributes, setAllAttributesInternal, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAttribute, setAttribute, setAttributeFromString, setAttributeFromString, setCacheBound, setComposedType, setCreationTime, setImplementation, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setModificationTime, setNonInitialAttributes, setOwner, setPermissionsByMap, setRelatedItems, setTransientObject, setUseTA, useTA, writeReplace
-
Methods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
-
-
-
Field Detail
-
DEFAULTVALUE
public static final java.lang.String DEFAULTVALUE
The default value attribute string constant.
-
DESCRIPTION
public static final java.lang.String DESCRIPTION
The description attribute string constant.
-
CODE
public static final java.lang.String CODE
The code attribute string constant.
-
XMLDEFINITION
public static final java.lang.String XMLDEFINITION
The xml definition attribute string constant.
-
-
Method Detail
-
getCode
public java.lang.String getCode()
Returns the unique code of this type.
-
getDefaultValue
public java.lang.Object getDefaultValue()
Returns the default value of this type.
-
getDefaultValue
public java.lang.Object getDefaultValue(SessionContext ctx)
Returns the default value of this type.
-
setDefaultValue
public void setDefaultValue(java.lang.Object value) throws JaloInvalidParameterException
Changes the default value of this type.- Throws:
JaloInvalidParameterException
-
setDefaultValue
public void setDefaultValue(SessionContext ctx, java.lang.Object value) throws JaloInvalidParameterException
Changes the default value of this type.- Throws:
JaloInvalidParameterException
-
toString
public abstract java.lang.String toString(SessionContext ctx, java.lang.Object value) throws JaloInvalidParameterException
- Throws:
JaloInvalidParameterException
- Since:
- 2.10
-
parseValue
public abstract java.lang.Object parseValue(SessionContext ctx, java.lang.String value) throws JaloInvalidParameterException
- Throws:
JaloInvalidParameterException
- Since:
- 2.10
-
isAssignableFrom
public abstract boolean isAssignableFrom(Type type)
Tests if this type is assignable from a given type.This is
true
if this type equals or is supertype of the given type.- Parameters:
type
- the type to be checked.
-
isInstance
public abstract boolean isInstance(java.lang.Object o)
Test whether an object is an instance of this type or not.This is
true
if this type is type of this object or is supertype of the object's type.- Parameters:
o
- the object to be checked.
-
getDescription
public java.lang.String getDescription()
- Returns:
- the description of this type localized for the current session language.
-
getDescription
public java.lang.String getDescription(SessionContext ctx)
- Returns:
- the description of this type localized by the given session context.
-
setDescription
public void setDescription(java.lang.String description)
Changes the type description for the current session language.- Parameters:
description
- the new description.
-
setDescription
public void setDescription(SessionContext ctx, java.lang.String description)
Changes the type description for the given session context language.- Parameters:
ctx
- the session context defining the language to set the description fordescription
- the new description.
-
getAllDescriptions
public java.util.Map getAllDescriptions()
- Returns:
- all descriptions at once in form of a language-to-description map.
-
getAllDescriptions
public java.util.Map getAllDescriptions(SessionContext ctx)
- Returns:
- all descriptions at once in form of a language-to-description map.
-
setAllDescriptions
public void setAllDescriptions(java.util.Map descriptions)
Changes all descriptions by specifying a language-to-description map. All previous descriptions are removed.- Parameters:
descriptions
- all new names as language-to-description map
-
setAllDescriptions
public void setAllDescriptions(SessionContext ctx, java.util.Map descriptions)
Changes all descriptions by specifying a language-to-description map. All previous descriptions are removed.- Parameters:
descriptions
- all new descriptions as language-to-description map
-
toString
public java.lang.String toString()
Provides a string representation of this type.
-
getXMLDefinition
public abstract java.lang.String getXMLDefinition()
Returns the XML definition string as expected byitems.xml
.
-
getTypeImpl
protected Type.TypeImpl getTypeImpl()
Internal access to persistence layer implementation.
-
compareTo
public int compareTo(java.lang.Object o)
Makes types comparable by their code (case insenesitive).- Specified by:
compareTo
in interfacejava.lang.Comparable
- Overrides:
compareTo
in classItem
- Parameters:
o
- which will be compared to this item.- Returns:
- the value 0 if the argument item pk is equal to this item pk; a value less than 0 if this item pk is lexicographically less than the argument item pk; and a value greater than 0 if this item pk is lexicographically greater than the argument item pk.
-
-