Package de.hybris.platform.jalo.type
Class AtomicType
- java.lang.Object
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable
public class AtomicType extends Type
Type representing simple java value objects.Atomic types support inheritance and may be abstract.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AtomicType.AtomicTypeImpl
The persistence layer implementation interface.-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.type.Type
Type.TypeImpl
-
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
JAVA_CLASS
The java class attribute string constant.static java.lang.String
NULL_TOKEN
static java.lang.String
SUBTYPES
The subtypes attribute string constant.static java.lang.String
SUPER_TYPE
The supertype attribute string constant.-
Fields inherited from class de.hybris.platform.jalo.type.Type
CODE, DEFAULTVALUE, DESCRIPTION, XMLDEFINITION
-
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 AtomicType()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Item
createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes)
The generic creation implementation.static java.lang.String
escape(java.lang.String raw, char escapedChar)
Escapes all & by placing a \ in front.java.lang.String
exportXMLDefinition(org.znerd.xmlenc.XMLOutputter xout)
protected AtomicType.AtomicTypeImpl
getAtomicTypeImpl()
Internal access to the persistence layer implementation.static int[]
getEscapedStringPositions(java.lang.String escaped, char escapedChar, int startFrom)
java.lang.Class
getJavaClass()
Returns the java-class of this type.protected Item.ItemAttributeMap
getNonInitialAttributes(SessionContext ctx, Item.ItemAttributeMap allAttributes)
RemovesType.CODE
,SUPER_TYPE
andJAVA_CLASS
from the attribute value map since these values are only needed forcreateItem(SessionContext, ComposedType, Item.ItemAttributeMap)
.java.util.Set
getSubTypes()
Returns all subtypes for this type.AtomicType
getSuperType()
Returns the super type of this type.java.lang.String
getXMLDefinition()
Provides the XML definiton to put inside aitems.xml
boolean
isAssignableFrom(Type type)
Test assignability between atomic types.boolean
isInstance(java.lang.Object o)
Test whether a object is instance of this atomic type.java.lang.Object
parseValue(SessionContext ctx, java.lang.String value)
Parses a atomic value which matches the following pattern: '&' + escaped string value + '&'.java.lang.String
toString(SessionContext ctx, java.lang.Object value)
Writes a atomic value as '&' + escaped string value + '&'.static java.lang.String
unescape(java.lang.String escaped, char escapeChar)
-
Methods inherited from class de.hybris.platform.jalo.type.Type
compareTo, getAllDescriptions, getAllDescriptions, getCode, getDefaultValue, getDefaultValue, getDescription, getDescription, getTypeImpl, setAllDescriptions, setAllDescriptions, setDefaultValue, setDefaultValue, setDescription, setDescription, toString
-
Methods inherited from class de.hybris.platform.jalo.type.TypeManagerManaged
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, 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, 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
-
NULL_TOKEN
public static final java.lang.String NULL_TOKEN
- Since:
- 2.10
- See Also:
- Constant Field Values
-
SUPER_TYPE
public static final java.lang.String SUPER_TYPE
The supertype attribute string constant.- See Also:
- Constant Field Values
-
SUBTYPES
public static final java.lang.String SUBTYPES
The subtypes attribute string constant.- See Also:
- Constant Field Values
-
JAVA_CLASS
public static final java.lang.String JAVA_CLASS
The java class attribute string constant.- See Also:
- Constant Field Values
-
-
Method Detail
-
createItem
protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException
The generic creation implementation.The following required attribute combinations are legal:
-
JAVA_CLASS
and optionallySUPER_TYPE
or -
SUPER_TYPE
andType.CODE
- Specified by:
createItem
in classItem
- Parameters:
ctx
- the current session context which this item is created withintype
- the actual item type ( since subtypes may not provide a own jalo class this may be different from the type which this method was implemented for )- Returns:
- the new item instance
- Throws:
JaloBusinessException
- indicates an error during creation - any changes will be rollbacked
-
-
getNonInitialAttributes
protected Item.ItemAttributeMap getNonInitialAttributes(SessionContext ctx, Item.ItemAttributeMap allAttributes)
RemovesType.CODE
,SUPER_TYPE
andJAVA_CLASS
from the attribute value map since these values are only needed forcreateItem(SessionContext, ComposedType, Item.ItemAttributeMap)
.- Overrides:
getNonInitialAttributes
in classItem
- Parameters:
ctx
- session context with language = NULLallAttributes
- aItemAttributeMap
contaning attribute values.- Returns:
- a
ItemAttributeMap
containing all attribute values, which belong to non-initial attributes.
-
escape
public static java.lang.String escape(java.lang.String raw, char escapedChar)
Escapes all & by placing a \ in front.- Since:
- 2.10
-
getEscapedStringPositions
public static int[] getEscapedStringPositions(java.lang.String escaped, char escapedChar, int startFrom)
- Since:
- 2.10
-
unescape
public static java.lang.String unescape(java.lang.String escaped, char escapeChar)
- Since:
- 2.10
-
toString
public java.lang.String toString(SessionContext ctx, java.lang.Object value) throws JaloInvalidParameterException
Writes a atomic value as '&' + escaped string value + '&'. The escaped string value is the string representation of the actual value except that each occurence of '&:' is replaced by '\&'.Currently supported value types:
-
String
-
Number
and its subclasses -
Boolean
-
Date
-
Class
-
Character
- and
Serializable
asBase64
encoded stream
- Specified by:
toString
in classType
- Throws:
JaloInvalidParameterException
- Since:
- 2.10
-
-
parseValue
public java.lang.Object parseValue(SessionContext ctx, java.lang.String value) throws JaloInvalidParameterException
Parses a atomic value which matches the following pattern: '&' + escaped string value + '&'.- Specified by:
parseValue
in classType
- Throws:
JaloInvalidParameterException
- Since:
- 2.10
- See Also:
escape(String, char)
-
getSuperType
public AtomicType getSuperType()
Returns the super type of this type.
-
getSubTypes
public java.util.Set getSubTypes()
Returns all subtypes for this type.
-
getJavaClass
public java.lang.Class getJavaClass()
Returns the java-class of this type.
-
getXMLDefinition
public java.lang.String getXMLDefinition()
Provides the XML definiton to put inside aitems.xml
- Specified by:
getXMLDefinition
in classType
-
exportXMLDefinition
public java.lang.String exportXMLDefinition(org.znerd.xmlenc.XMLOutputter xout)
- Specified by:
exportXMLDefinition
in classTypeManagerManaged
-
getAtomicTypeImpl
protected AtomicType.AtomicTypeImpl getAtomicTypeImpl()
Internal access to the persistence layer implementation.
-
isAssignableFrom
public boolean isAssignableFrom(Type type)
Test assignability between atomic types. This type is assignable from another type if its java class is assiganble from the other type's java class.- Specified by:
isAssignableFrom
in classType
- Parameters:
type
- the type to be checked.
-
isInstance
public boolean isInstance(java.lang.Object o)
Test whether a object is instance of this atomic type. This is true if the object is instance of this type's java class.- Specified by:
isInstance
in classType
- Parameters:
o
- the object to be checked.
-
-