public class CollectionType extends Type
The actual type of the collection may be one of the following:
COLLECTION )SET ) which contains unique elementsLIST ) which is ordered| Modifier and Type | Class and Description |
|---|---|
static interface |
CollectionType.CollectionTypeImpl
The presistence layer implementation interface.
|
Type.TypeImplTypeManagerManaged.TypeManagerManagedImplLocalizableItem.LocalizableItemImplExtensibleItem.ExtensibleItemImplItem.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationException| Modifier and Type | Field and Description |
|---|---|
static int |
COLLECTION
The default collection type constants.
|
static String |
COLLECTION_ENUM_CODE
The default collection enum code .
|
static String |
ELEMENT_TYPE
The collection element type attribute string constant.
|
static int |
LIST
The list collection type constants.
|
static String |
LIST_ENUM_CODE
The list collection enum code.
|
static int |
SET
The set collection type constants.
|
static String |
SET_ENUM_CODE
The set collection enum code.
|
static int |
SORTED_SET
Deprecated.
|
static String |
SORTED_SET_ENUM_CODE
Deprecated.
|
static String |
TYPE_OF_COLLECTION
The type of collection attribute string constant.
|
static String |
TYPE_OF_COLLECTION_ENUM_CODE
The code of the typeOfCollection enumeration type.
|
static String |
TYPE_OF_COLLECTION_INTERNAL
The internal type of collection attribute string constant.
|
CODE, DEFAULTVALUE, DESCRIPTION, XMLDEFINITIONAUTOCREATE, DEPRECATED, EXTENSION_NAME, GENERATE, NAMELANGUAGE_FALLBACK_ENABLED_CREATION_TIME_INTERNAL, _MODIFIED_TIME_INTERNAL, accessorLog, CREATION_TIME, DISABLE_ATTRIBUTE_CHECK, DISABLE_ITEMCHECK_BEFORE_REMOVABLE, EVEN, FEATURE_ACCESSMAP_QUALIFIER, INITIAL_CREATION_FLAG, isJaloOnly, MODIFIED_TIME, NEGATIVE, NOT_FOUND, OWNER, PK, POSITIVE, SAVE_FROM_SERVICE_LAYER, staticTransientObjects, TYPEimpl, tenant| Constructor and Description |
|---|
CollectionType() |
| Modifier and Type | Method and Description |
|---|---|
protected int |
convertTypeOfCollectionEnumToInt(EnumerationValue enumeration)
Converts typeOfCollection enums into intern int codes.
|
protected EnumerationValue |
convertTypeOfCollectionIntToEnum(int type)
Converts typeOfCollection internal int representation int enum values.
|
protected Item |
createItem(SessionContext ctx,
ComposedType type,
Item.ItemAttributeMap allAttributes)
Generic item creation method.
|
protected static String |
escapeForCollection(String raw) |
String |
exportXMLDefinition(XMLOutputter xout) |
protected CollectionType.CollectionTypeImpl |
getCollectionTypeImpl()
Internal access to persistence layer implementation.
|
Type |
getElementType()
Returns the type of the elements of this collection type.
|
Type |
getElementType(SessionContext ctx)
Returns the type of the elements of this collection.
|
static int[] |
getEscapedCollectionPositions(String escaped,
int startFrom) |
protected Item.ItemAttributeMap |
getNonInitialAttributes(SessionContext ctx,
Item.ItemAttributeMap allAttributes)
Cuts the following attribute values which are already set during actual item creation:
Type.CODE
ELEMENT_TYPE
TYPE_OF_COLLECTION
|
int |
getTypeOfCollection() |
EnumerationValue |
getTypeOfCollectionEnum()
Returns the type of this collection as enumeration value.
|
String |
getXMLDefinition()
Assembles the XML definition string to put inside a
items.xml . |
boolean |
isAssignableFrom(Type type)
Tests whether this collection type is assignable from another collection type.
|
boolean |
isInstance(Object o)
Tests if a given object is instance of this collection type.
|
protected boolean |
isTypeAssignableFrom(int type1,
int type2)
Checks assignability between types of collection:
COLLECTION is assignable from all
SET is assignable from SET and SORTED_SET
LIST is assignable from LIST and SORTED_SET
SORTED_SET is assignable from SORTED_SET only
|
Collection |
newInstance()
Returns an empty collection if the specified type (see @link #getTypeOfCollection()}).
|
Object |
parseValue(SessionContext ctx,
String value)
reads a collection of '(' + escaped element string + ')'.
|
String |
toString(SessionContext ctx,
Object value)
Writes a collection as '(' + escaped element string + ')'.
|
protected static String |
unescapeForCollection(String escaped) |
compareTo, getAllDescriptions, getAllDescriptions, getCode, getDefaultValue, getDefaultValue, getDescription, getDescription, getTypeImpl, setAllDescriptions, setAllDescriptions, setDefaultValue, setDefaultValue, setDescription, setDescription, toStringgetAllNames, getAllNames, getExtensionName, getImpl, getName, getName, isAutocreate, isDeprecated, isGenerate, setAllNames, setAllNames, setAutocreate, setExtensionName, setGenerate, setName, setNamegetAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllValuesSessionContext, getLocalizedProperty, getLocalizedProperty, getLocalizedPropertyInternal, getLocalizedPropertyNames, getLocalizedPropertyNames, hasLanguage, isEmptyValue, isFallbackEnabled, removeLocalizedProperty, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedProperty, setLocalizedPropertycreateNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setPropertyaddLinkedItems, 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, getRestrictedPrincipals, getSession, getSyncObject, getTenant, getTransientObject, getTransientObjectMap, hashCode, hasRegisteredClassAccessorFor, internal_registerClassAccessorFor, internal_registerNonClassAccessorFor, invalidateLocalCaches, isAlive, isCacheBound, isCurrentlyRemoving, isCurrentlyRemoving, isEmptyRelationValue, isInCreate, isInstanceOf, isItemCheckBeforeRemoveableDisabled, isRelationLocalizationFallbackEnabled, newInstance, notifyExtensionsAfterItemCreation, notifyExtensionsBeforeItemCreation, notifyItemRemoval, readResolve, refreshRemote, 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, setTransientObject, setUseTA, useTA, writeReplacegetImplementation, setTenantpublic static final String TYPE_OF_COLLECTION_ENUM_CODE
getTypeOfCollectionEnum(),
Constant Field Valuespublic static final int COLLECTION
getTypeOfCollection(),
Constant Field Valuespublic static final String COLLECTION_ENUM_CODE
getTypeOfCollectionEnum(),
Constant Field Valuespublic static final int SET
getTypeOfCollection(),
Constant Field Valuespublic static final String SET_ENUM_CODE
getTypeOfCollectionEnum(),
Constant Field Valuespublic static final int LIST
public static final String LIST_ENUM_CODE
getTypeOfCollectionEnum(),
Constant Field Values@Deprecated public static final int SORTED_SET
getTypeOfCollection(),
Constant Field Values@Deprecated public static final String SORTED_SET_ENUM_CODE
getTypeOfCollectionEnum(),
Constant Field Valuespublic static final String ELEMENT_TYPE
public static final String TYPE_OF_COLLECTION
public static final String TYPE_OF_COLLECTION_INTERNAL
Since this attribute is private is may only be used for FlexibleSearch queries like this example:
"... WHERE {" + CollectionType.TYPE_OF_COLLECTION_INTERNAL + "} = " + CollectionType.SET + " ..."
Its value can be retrieved manually by getTypeOfCollection().
protected int convertTypeOfCollectionEnumToInt(EnumerationValue enumeration) throws JaloInvalidParameterException
JaloInvalidParameterExceptionprotected EnumerationValue convertTypeOfCollectionIntToEnum(int type) throws JaloInvalidParameterException
JaloInvalidParameterExceptionprotected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException
Requires the following attributes:
Optionally the type of collection may be defined byTYPE_OF_COLLECTION.createItem in class Itemctx - 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 )JaloBusinessException - indicates an error during creation - any changes will be rollbackedprotected Item.ItemAttributeMap getNonInitialAttributes(SessionContext ctx, Item.ItemAttributeMap allAttributes)
getNonInitialAttributes in class Itemctx - session context with language = NULLallAttributes - a ItemAttributeMap contaning attribute values.ItemAttributeMap containing all attribute values, which belong to non-initial attributes.public String toString(SessionContext ctx, Object value) throws JaloInvalidParameterException
toString in class TypeJaloInvalidParameterExceptionpublic static int[] getEscapedCollectionPositions(String escaped, int startFrom)
protected static final String unescapeForCollection(String escaped)
public Object parseValue(SessionContext ctx, String value) throws JaloInvalidParameterException
parseValue in class TypeJaloInvalidParameterExceptionpublic Type getElementType()
public Type getElementType(SessionContext ctx)
public int getTypeOfCollection()
SET,LIST,COLLECTION.public EnumerationValue getTypeOfCollectionEnum()
TYPE_OF_COLLECTION_ENUM_CODE. Its values got the codes
public Collection newInstance()
public String getXMLDefinition()
items.xml .getXMLDefinition in class Typepublic String exportXMLDefinition(XMLOutputter xout)
exportXMLDefinition in class TypeManagerManagedprotected CollectionType.CollectionTypeImpl getCollectionTypeImpl()
public boolean isAssignableFrom(Type type)
isAssignableFrom in class Typetype - the type to be checked.isTypeAssignableFrom(int, int)protected boolean isTypeAssignableFrom(int type1,
int type2)
COLLECTION is assignable from allSET is assignable from SET and SORTED_SETLIST is assignable from LIST and SORTED_SETSORTED_SET is assignable from SORTED_SET onlypublic boolean isInstance(Object o)
Since all elements are checked this method is considerably costly so use with care!
isInstance in class Typeo - the object to be checked.Copyright © 2017 SAP SE. All Rights Reserved.