public class AttributeDescriptor extends Descriptor
ComposedType
exclusively.| Type | Property and Description |
|---|---|
boolean |
is
Gets the value of the property property.
|
| Modifier and Type | Class and Description |
|---|---|
static interface |
AttributeDescriptor.AttributeDescriptorImpl
The persistence layer interface.
|
Descriptor.DescriptorImplTypeManagerManaged.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 |
ALL
All flags combined.
|
static int |
ALL_PUBLIC
All publicly changeable flags combined.
|
static String |
ATTRIBUTE_HANDLER
The attributeHandler string attribute constant.
|
static String |
DATABASECOLUMN
The database column name string attribute constant.
|
static String |
DECLARING_ENCLOSING_TYPE
The declaring enclosing type string attribute constant.
|
static String |
DEFAULTVALUE
The default value attribute constant.
|
static String |
DEFAULTVALUE_DEFINITIONSTRING
The default value definiton string attribute constant.
|
static String |
DESCRIPTION
The description string attribute constant.
|
static String |
ENCLOSING_TYPE
The enclosing type string attribute constant.
|
static String |
ENCRYPTED
The encrypted string attribute constant.
|
static int |
ENCRYPTED_FLAG
The encrypted -Flag used by
getModifiers(). |
static String |
INHERITED
The inherited string attribute constant.
|
static int |
INHERITED_FLAG
The inherited -Flag used by
getModifiers(). |
static String |
INITIAL
The initial string attribute constant.
|
static int |
INITIAL_FLAG
The initial -Flag used by
getModifiers(). |
static String |
LOCALIZED
The localized string attribute constant.
|
static int |
LOCALIZED_FLAG
The localized -Flag used by
getModifiers(). |
static String |
MODIFIERS
The modifiers string attribute constant.
|
static String |
OPTIONAL
The optional string attribute constant.
|
static int |
OPTIONAL_FLAG
The optional -Flag used by
getModifiers(). |
static String |
PARTOF
The part of string attribute constant.
|
static int |
PARTOF_FLAG
The partOf -Flag used by
getModifiers(). |
static String |
PERSISTENCE_CLASS
The persistence class string attribute constant.
|
static String |
PERSISTENCETYPE
The persistence type string attribute constant.
|
static String |
PRIMITIVE
The primitive string attribute constant.
|
static int |
PRIMITIVE_FLAG
The primitive-Flag used by
getModifiers(). |
static String |
PRIVATE
The private string attribute constant.
|
static int |
PRIVATE_FLAG
The private -Flag used by
getModifiers(). |
static String |
PROPERTY
The property string attribute constant.
|
static int |
PROPERTY_FLAG
The property -Flag used by
getModifiers(). |
static String |
PROPOSED_DATABASE_COLUMN
The proposed database column name string attribute constant.
|
static String |
READ
Deprecated.
please use
READABLEinstead |
static int |
READ_FLAG
The read -Flag used by
getModifiers(). |
static String |
READABLE
The readable string attribute constant.
|
static String |
REMOVABLE
The removable string attribute constant.
|
static String |
REMOVE
Deprecated.
please use
REMOVABLEinstead |
static int |
REMOVE_FLAG
The remove -Flag used by
getModifiers(). |
static String |
SEARCH
The search string attribute constant.
|
static int |
SEARCH_FLAG
The search -Flag used by
getModifiers(). |
static String |
TIM_IGNORE
The do not optimize string attribute constant.
|
static int |
TIM_IGNORE_FLAG
The dontOptimize -Flag used by
getModifiers(). |
static String |
UNIQUE
The unique string attribute constant.
|
static String |
WRITABLE
The writable string attribute constant.
|
static String |
WRITE
Deprecated.
please use
WRITABLEinstead |
static int |
WRITE_FLAG
The write -Flag used by
getModifiers(). |
ATTRIBUTETYPE, QUALIFIERAUTOCREATE, 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 |
|---|
AttributeDescriptor() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkDefaultValueAssignability(SessionContext ctx,
Object newVal)
Internal - checks compatibility of default value with attribute value type.
|
protected void |
checkLocalizedChange(boolean newLoc)
Internal localization flag change check.
|
protected void |
checkPartOfChange(boolean newPartOf)
Internal: checks partOf flag change.
|
protected void |
checkPropertyChange(boolean newProp)
Internal property flag change check.
|
protected void |
checkSearchableChange(boolean newSearchable)
Internal - for checking whether an attribute can be made searchable or not.
|
protected void |
checkSelectionOfDescriptor(AttributeDescriptor newSelect)
Internal - compatibility check for selection of sttributes.
|
protected void |
checkTypeChange(Type newType)
Internal - do not use.
|
boolean |
checkTypePermission(Principal p,
UserRight right)
Checks the type permission upon this attribute of the given principal.
|
boolean |
checkTypePermission(UserRight right)
Checks the type permission upon this attribute of the current session user.
|
protected Item |
createItem(SessionContext ctx,
ComposedType type,
Item.ItemAttributeMap allAttributes)
Creator method for generic creation of attribute descriptor.
|
String |
exportXMLDefinition(XMLOutputter xout) |
protected void |
exportXMLDefinitionDefaultValue(XMLOutputter xout) |
Map |
getAllDescriptions() |
Map |
getAllDescriptions(SessionContext ctx) |
Map |
getAllNames()
Returns all names of this attribute descriptor as map.
|
Set<AttributeDescriptor> |
getAllSubAttributeDescriptors()
Returns all sub attribute descriptors of this attribute.
|
protected AttributeDescriptor.AttributeDescriptorImpl |
getAttributeDescriptorImpl()
Internal - access to persistence layer implementation.
|
String |
getAttributeHandler() |
String |
getDatabaseColumn() |
ComposedType |
getDeclaringEnclosingType()
If the attribute has been inherited this returns the type which originally declared this attribute.
|
Object |
getDefaultValue()
Returns the default value of this attribute descriptor or
null if no value was set and there is no
default value defined for the attribute value type. |
Object |
getDefaultValue(SessionContext ctx)
Returns the default value of this attribute descriptor or
null if no value was set and there is no
default value defined for the attribute value type. |
String |
getDefaultValueDefinitionString()
Returns the defaul value definition from
items.xml in case this attribute was declared there having a
<defaultvalue> tag. |
String |
getDescription() |
String |
getDescription(SessionContext ctx) |
boolean |
getDontOptimize()
Tells whether this attribute descriptor has an "optimized" database layout or is stored in the dump table
(dontOptimize=true).
|
ComposedType |
getEnclosingType()
The composed type which owns this attribute descriptor.
|
protected int |
getIntModifiersFromMap(Map allAttributes)
Internal - converts single flag attributes into int constants combinations for generic creation process.
|
int |
getModifiers()
Returns the attribute settings as combination of:
READ_FLAG
WRITE_FLAG
OPTIONAL_FLAG
REMOVE_FLAG
PARTOF_FLAG
INITIAL_FLAG
PRIVATE_FLAG
PROPERTY_FLAG
SEARCH_FLAG
TIM_IGNORE_FLAG
ENCRYPTED_FLAG
|
String |
getName(SessionContext ctx)
Returns the name of this attribute descriptor.
|
protected Item.ItemAttributeMap |
getNonInitialAttributes(SessionContext ctx,
Item.ItemAttributeMap allAttributes)
Cuts the following attributes from value map since these values have been set during creation:
ENCLOSING_TYPE
Descriptor.QUALIFIER
Descriptor.ATTRIBUTETYPE
|
Class |
getPersistenceClass() |
String |
getPersistenceQualifier()
If the attribute is backed by a EJB CMP field this method returns the CMP field name.
|
AtomicType |
getPersistenceType() |
String |
getProposedDatabaseColumn()
Since all attributes created after initialization are not mapped to a own database column this method provides a
column name proposal.
|
AttributeDescriptor |
getSelectionOf()
Returns the selection-of attribute descriptor.
|
Set<AttributeDescriptor> |
getSubAttributeDescriptors()
Returns direct sub attribute descriptors of this attribute.
|
protected Map |
getXMLCustomProperties()
Override to add custom properties to this type's xml definition.
|
String |
getXMLDefinition()
Assembles the attribute descriptors XML definition required for
items.xml. |
protected Object |
interpretAndReplaceDefaultValue(Object current) |
boolean |
isEncrypted()
Tells whether this attribute should be stored in an encrypted way
|
boolean |
isInherited()
Tells whether an attribute descriptor was inherited or not.
|
boolean |
isInitial()
Tells whether an attribute is initial or not.
|
boolean |
isLocalized()
Tells whether an attribute is localized or not.
|
boolean |
isOptional()
Tells whether or not the described attribute has to be provided with a non-null value when creating a new item
instance via
ComposedType.newInstance(Map). |
boolean |
isPartOf()
Tells whether this attribute descriptor describes a part-of relation or not.
|
boolean |
isPrimitive()
Tells whether this attribute represents a java primitive type.
|
boolean |
isPrivate()
Tells whether an attribute is private or not.
|
boolean |
isProperty()
Gets the value of the property property.
|
boolean |
isReadable() |
boolean |
isRedeclared()
Tells whether a inherited attribute descriptor has different modifiers and/or a different value type than its
super attribute descriptor.
|
boolean |
isRemovable()
Tells whether or not this attribute is is allowed to be removed.
|
boolean |
isSearchable()
Tells whether a attribute is searchable or not.
|
boolean |
isUnique()
Tells whether this attribute is unique.
|
boolean |
isWritable()
Returns
true if the attribute is writable. |
boolean |
isWriteable()
Deprecated.
use
isWritable() |
void |
redeclareAttributeType(Type type,
int modifiers)
Deprecated.
please use
setAttributeType(Type) instead |
Object |
removeLocalizedProperty(SessionContext ctx,
String name)
Removes a localized property.
|
protected Object |
removeLocalizedPropertyNonRecursively(SessionContext ctx,
String name)
Removes a localized property without removing it from sub attributes too.
|
Object |
removeProperty(SessionContext ctx,
String name)
Removes a property.
|
protected Object |
removePropertyNonRecursively(SessionContext ctx,
String name)
Removes a property without removing it from sub attributes too.
|
void |
setAllDescriptions(Map descriptions)
Changes all localized attribute descriptions by providing a language-to-description map.
|
void |
setAllDescriptions(SessionContext ctx,
Map descriptions)
Changes all localized attribute descriptions by providing a language-to-description map.
|
void |
setAttributeHandler(String attributeHandler) |
void |
setAttributeType(Type type)
Changes the value type of this attribute descriptor.
|
void |
setDatabaseColumn(String col)
Changes the database column of this attribute.
|
void |
setDefaultValue(Object value)
Changes the default value of this attribute.
|
void |
setDefaultValue(SessionContext ctx,
Object value)
Changes the default value of this attribute.
|
void |
setDescription(SessionContext ctx,
String description)
Changes the attribute description text for the specified languag.
|
void |
setDescription(String description)
Changes the attribute description text for the current session languag.
|
void |
setDontOptimize(boolean dontopt)
Changes the optimize flag of this attribute descriptor.
|
void |
setEncrypted(boolean encrypt)
Changes the encrypted flag of this attribute descriptor.
|
void |
setInitial(boolean initial)
Changes the initial flag of this attribute descriptor.
|
void |
setLocalized(boolean localized)
Changes localized flag of this attribute descriptor.
|
Object |
setLocalizedProperty(SessionContext ctx,
String name,
Object value)
Sets a localized property and copies the new value down to all sub attribute descriptors.
|
protected Object |
setLocalizedPropertyNonRecursively(SessionContext ctx,
String name,
Object value)
Sets a localized property without copying it down to all sub attribute descriptors.
|
void |
setModifiers(int modifiers) |
void |
setOptional(boolean optional)
Changes whether or not the described attribute has to be provided with a non-null value when creating a new item
instance via
ComposedType.newInstance(Map). |
void |
setPartOf(boolean partOf)
Changes the partOf flag of this attribute descriptor.
|
void |
setPrimitive(boolean primitive)
Changes the primitive flag of this attribute descriptor.
|
void |
setPrivate(boolean priv)
Changes the private flag of this attribute descriptor.
|
void |
setProperty(boolean isProperty)
Changes the property flag of this attribute descriptor.
|
Object |
setProperty(SessionContext ctx,
String name,
Object value)
Sets a property and copies the new value down to all sub attribute descriptors.
|
protected Object |
setPropertyNonRecursively(SessionContext ctx,
String name,
Object value)
Sets a property without copying it down to all sub attribute descriptors.
|
void |
setReadable(boolean readable)
Changes the attribute describtor's readable status.
|
void |
setRemovable(boolean removable)
Changes whether or not this attribute is is allowed to be removed.
|
void |
setSearchable(boolean searchable)
Changes the searchable flag of this attribute descriptor.
|
void |
setSelectionOf(AttributeDescriptor descriptor)
Changes the selection-of attribute.
|
void |
setUnique(boolean unique)
Changes the unique flag of this attribute descriptor.
|
void |
setWritable(boolean writable)
Changes the attribute describtor's writable status.
|
String |
toString()
The string represenation of this attribute descriptor.
|
static String |
toString(int modifiers) |
protected void |
writeDefaultValueTagAtomic(XMLOutputter xout,
String atomictype,
String value) |
compareTo, getAttributeType, getAttributeType, getContextAdjustedAttributeType, getDescriptorImpl, getQualifier, getRealAttributeTypegetAllNames, getExtensionName, getImpl, getName, isAutocreate, isDeprecated, isGenerate, setAllNames, setAllNames, setAutocreate, setExtensionName, setGenerate, setName, setNamegetAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllValuesSessionContext, getLocalizedProperty, getLocalizedProperty, getLocalizedPropertyInternal, getLocalizedPropertyNames, getLocalizedPropertyNames, hasLanguage, isEmptyValue, isFallbackEnabled, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedPropertycreateNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, setAllProperties, setAllProperties, 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 DEFAULTVALUE
public static final String DEFAULTVALUE_DEFINITIONSTRING
public static final String DESCRIPTION
public static final String ENCLOSING_TYPE
public static final String DECLARING_ENCLOSING_TYPE
public static final String WRITABLE
public static final String READABLE
public static final String REMOVABLE
public static final String OPTIONAL
public static final String SEARCH
public static final String PARTOF
public static final String PRIVATE
public static final String PROPERTY
public static final String LOCALIZED
public static final String INHERITED
public static final String UNIQUE
public static final String INITIAL
public static final String TIM_IGNORE
public static final String MODIFIERS
public static final String DATABASECOLUMN
public static final String PERSISTENCETYPE
public static final String ATTRIBUTE_HANDLER
public static final String PROPOSED_DATABASE_COLUMN
public static final String PERSISTENCE_CLASS
public static final String ENCRYPTED
public static final String PRIMITIVE
@Deprecated public static final String READ
READABLEinstead@Deprecated public static final String WRITE
WRITABLEinstead@Deprecated public static final String REMOVE
REMOVABLEinsteadpublic static final int READ_FLAG
getModifiers().public static final int WRITE_FLAG
getModifiers().public static final int REMOVE_FLAG
getModifiers().public static final int OPTIONAL_FLAG
getModifiers().public static final int SEARCH_FLAG
getModifiers().public static final int PARTOF_FLAG
getModifiers().public static final int PRIVATE_FLAG
getModifiers().public static final int PROPERTY_FLAG
getModifiers().public static final int LOCALIZED_FLAG
getModifiers().public static final int INHERITED_FLAG
getModifiers().public static final int INITIAL_FLAG
getModifiers().public static final int TIM_IGNORE_FLAG
getModifiers().public static final int ENCRYPTED_FLAG
getModifiers().public static final int PRIMITIVE_FLAG
getModifiers().public static final int ALL
public static final int ALL_PUBLIC
protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException
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 Object setProperty(SessionContext ctx, String name, Object value)
setProperty in class ExtensibleItemctx - the session contextname - the property namevalue - the new valuesetPropertyNonRecursively(SessionContext, String, Object)protected Object setPropertyNonRecursively(SessionContext ctx, String name, Object value)
ctx - the session contextname - the property namevalue - the new valuesetProperty(SessionContext, String, Object)public Object setLocalizedProperty(SessionContext ctx, String name, Object value)
setLocalizedProperty in class LocalizableItemctx - the session context defining the languagename - the property namevalue - the new valuesetLocalizedPropertyNonRecursively(SessionContext, String, Object)protected Object setLocalizedPropertyNonRecursively(SessionContext ctx, String name, Object value)
ctx - the session context defining the languagename - the property namevalue - the new valuesetLocalizedProperty(SessionContext, String, Object)public Object removeLocalizedProperty(SessionContext ctx, String name)
removeLocalizedProperty in class LocalizableItemctx - the session context defining the languagename - the property nameprotected Object removeLocalizedPropertyNonRecursively(SessionContext ctx, String name)
ctx - the session context defining the languagename - the property namepublic Object removeProperty(SessionContext ctx, String name)
removeProperty in class ExtensibleItemctx - the session contextname - the property namenull if there was no property.protected Object removePropertyNonRecursively(SessionContext ctx, String name)
ctx - the session contextname - the property namepublic Set<AttributeDescriptor> getSubAttributeDescriptors()
public Set<AttributeDescriptor> getAllSubAttributeDescriptors()
public String getName(SessionContext ctx)
getName in class TypeManagerManagedctx - the session context defining the language to get the name forpublic Map getAllNames()
getAllNames in class TypeManagerManagedprotected void checkTypeChange(Type newType) throws JaloInvalidParameterException
newType - JaloInvalidParameterExceptionpublic void setAttributeType(Type type) throws JaloInvalidParameterException
This functionality should be used rarely since attribute type changes may impose different handling of item instances by all applications using this type. Generally attribute type changes should be done during system initialization or similar steps.
type - the new value typeJaloInvalidParameterException - in case the previous type was not assignable from the new one; if the attribute has been inherited
the previous type is taken from the super attribute @Deprecated public void redeclareAttributeType(Type type, int modifiers) throws JaloInvalidParameterException
setAttributeType(Type) insteadJaloInvalidParameterExceptionpublic ComposedType getDeclaringEnclosingType()
public ComposedType getEnclosingType()
public int getModifiers()
public void setModifiers(int modifiers)
public boolean isReadable()
setReadable(boolean)public void setReadable(boolean readable)
throws JaloInvalidParameterException
Please note that changing an attribute descritors readability cannot affect the actual implementation ( see
AttributeAccess). If an implementation does not allow reading the value setting the attribute descriptor
readable doesnt make much sense.
JaloInvalidParameterExceptionisReadable()@Deprecated public boolean isWriteable()
isWritable()setWritable(boolean)public boolean isWritable()
true if the attribute is writable.setWritable(boolean)public void setWritable(boolean writable)
throws JaloInvalidParameterException
Please note that changing an attribute descritors writability cannot affect the actual implementation ( see
AttributeAccess). If an implementation does not allow writing the value setting the attribute descriptor
writable doesnt make much sense.
JaloInvalidParameterExceptionisWritable()public boolean isRemovable()
Item.remove().
The remove flag is intented to provide a certain safety for the type system designer to mark all required attribute as non-removable contrary to attribute descriptors created during system runtime which may be removed again.
setRemovable(boolean)public void setRemovable(boolean removable)
throws JaloInvalidParameterException
Item.remove().
The remove flag is intented to provide a certain safety for the type system designer to mark all required attribute as non-removable contrary to attribute descriptors created during system runtime which may be removed again.
JaloInvalidParameterExceptionisRemovable()public boolean isOptional()
ComposedType.newInstance(Map).
Since the actual item creation logic is coded in
Item.createItem(SessionContext, ComposedType, Item.ItemAttributeMap)it is very likely that some attributes
are always required so setting their attribute descriptors to be optional doesnt make much sense, even if it's
possible.
public void setOptional(boolean optional)
throws JaloInvalidParameterException
ComposedType.newInstance(Map).
Since the actual item creation logic is coded in
Item.createItem(SessionContext, ComposedType, Item.ItemAttributeMap)it is very likely that some attributes
are always required so setting their attribute descriptors to be optional doesnt make much sense, even if it's
possible.
JaloInvalidParameterExceptionpublic boolean isSearchable()
getDatabaseColumn()and getPersistenceClass().public void setSearchable(boolean searchable)
throws JaloInvalidParameterException
Please note that setting an attribute descriptor searchable which does not have persistence informations doesnt make much sense ( unless the FlexibleSearch was replaced by a search engine which is capable of searching such fields ).
JaloInvalidParameterException - in case the persistence information does not allow this attribute to be made searchableprotected void checkSearchableChange(boolean newSearchable)
throws JaloInvalidParameterException
JaloInvalidParameterException - if it cannot become searchablepublic boolean isPartOf()
Part-of attributes describe fields which store references to items which belong to the owner of the attribute.
To name one example: AbstractOrder.entries where the AbstractOrder instance owns a collection of
AbstractOrderEntry instances. Since one entry belongs to this order exclusively the entries attribute
is marked as being part of .
setPartOf(boolean)public boolean getDontOptimize()
setDontOptimize(boolean)public boolean isEncrypted()
setEncrypted(boolean)public boolean isPrimitive()
public void setPartOf(boolean partOf)
throws JaloInvalidParameterException
JaloInvalidParameterException - if the attribute does not hold Items but other objects and it is tried to be set partOfisPartOf()protected void checkPartOfChange(boolean newPartOf)
throws JaloInvalidParameterException
JaloInvalidParameterException - in case change is not allowedpublic boolean isPrivate()
Private attributes are intented for internal use and therefore hidden from general methods like
ComposedType.getAttributeDescriptors()- they may only be found using
ComposedType.getEveryAttributeDescriptor(String).
Apart from that private attributes behave like non-private ones.
setPrivate(boolean)public void setPrivate(boolean priv)
priv - the new private statusisPrivate()public void setDontOptimize(boolean dontopt)
dontopt - the new dont optimize statusgetDontOptimize()public void setEncrypted(boolean encrypt)
encrypt - the new encrypt statusisEncrypted()public void setPrimitive(boolean primitive)
primitive - the new primitive statuspublic boolean isLocalized()
MapTypehaving the language item type as argument
type and the actual attribute value type as return type.
An example:
TypeManager tm = jaloSession.getTypeManager();
// we like to define a new localized attribute holding users
ComposedType userType = tm.getComposedType( User.class );
ComposedType langType = tm.getComposedType( Language.class );
ComposedType myType = ...
myType.createAttributeDescriptor(
"myAttribute",
tm.createMapType("locUserType", langType, userType),
AttributeDescriptor.READ_FLAG + AttributeDescriptor.WRITE_FLAG +
AttributeDescriptor.OPTIONAL_FLAG + AttributeDescriptor.PROPERTY_FLAG
);
Another diference between unlocalized and localized attributes is the result of
Item.getAttribute(SessionContext, String). As long as the specified session context contains a session
language the result will be the value mapped to this language. If no language is specified the result will
contain all values in form of a map containing language-to-value mappings!
The same rule applies to Item.setAttribute(SessionContext, String, Object).
setLocalized(boolean)public void setLocalized(boolean localized)
throws JaloInvalidParameterException
MapTypewith a language
composed type as their argumenttype as attribute value type may become localized.
Generally changing an attribute's localization status should seldom be necessary since during attribute creation the persistence settings have been chosen anyway which defines clearly if the field is localized or not.
localized - the new localized statusJaloInvalidParameterException - in case the attribute value type doesnt allow attribute to be localized.protected void checkLocalizedChange(boolean newLoc)
throws JaloInvalidParameterException
JaloInvalidParameterException - in case localized flag change is allowedpublic boolean isInherited()
public boolean isInitial()
More precisely this flag would be named initially writable which means the attribute value may be written during instance creation. Usually it is used in combination with setting the writable flag to false which describes a field which has to be filled during creation but cannot be changed afterwards.
public void setInitial(boolean initial)
initial - the new initial flagpublic boolean isProperty()
public void setProperty(boolean isProperty)
throws JaloInvalidParameterException
If true the attribute is backed by a property field. Each property attribute owns automatically a
AttributeAccess which redirects to property getter and setter methods. Nevertheless it is possible to
register a own access for this attribute as well.
Please note that setting this flag to false requires that a own AttributeAccessis
registered. Otherwise each access to this attribute will raise an exception from now on.
isProperty - the new property flag statusJaloInvalidParameterException - in case the enclosing type does not describe a subclass of ExtensibleItemisProperty()protected void checkPropertyChange(boolean newProp)
throws JaloInvalidParameterException
JaloInvalidParameterException - in case the enclosing type does not belong to a subclass of extensible itemsetProperty(boolean)public boolean isUnique()
Unique attributes describe the fact that no two instances (of the enclosing type) may hold the same value within this attribute.
Please note that right now there is no automatic check built in hybris platform - each AttributeAccess
will need to implement its own check. This may change in future releases.
public void setUnique(boolean unique)
unique - the new unique status.public void setAttributeHandler(String attributeHandler)
public String getAttributeHandler()
public String getDefaultValueDefinitionString()
items.xml in case this attribute was declared there having a
<defaultvalue> tag. Otherwise null is returned.getXMLDefinition()public Object getDefaultValue()
null if no value was set and there is no
default value defined for the attribute value type. If the value provides a default value this one is taken if the
attribute doesnt provide a own value.
Please note that the default value for the current session context is retrieved: for localized attributes the value belonging to the current session language!
public Object getDefaultValue(SessionContext ctx)
null if no value was set and there is no
default value defined for the attribute value type. If the value provides a default value this one is taken if the
attribute doesnt provide a own value.
Please note that the default value for the specified session context is retrieved: for localized attributes the
value belonging to the current session language! If no language is set or the context is null all
localized values are returned in form of a map holding language-to-value mappings.
ctx - the session context specifying the language ( affect for localized attributes only )setDefaultValue(Object),
setDefaultValue(SessionContext, Object)public void setDefaultValue(Object value) throws JaloInvalidParameterException
Please note that the value is set using the current session context. For localized attributes this means the value belonging to the current session language is changed - all other stay unchanged. Non-localized attributes are not affected by session context.
value - the new default valueJaloInvalidParameterException - in case the new value is not compatible with the attribute value type.getDefaultValue(),
getDefaultValue(SessionContext),
setDefaultValue(SessionContext, Object)public void setDefaultValue(SessionContext ctx, Object value) throws JaloInvalidParameterException
Please note that the value is set using the specified session context. For localized attributes this means the
value belonging to the current session language is changed - all other stay unchanged. If no language is set the
value must be a map containing all localized values as language-to-value mappings.
Unlocalized attributes are not affected by session context.
ctx - the session context specifying the languagevalue - the new default valueJaloInvalidParameterException - in case the new value is not compatible with the attribute value type.getDefaultValue(),
getDefaultValue(SessionContext),
setDefaultValue(Object)protected void checkDefaultValueAssignability(SessionContext ctx, Object newVal) throws JaloInvalidParameterException
newVal - the new valueJaloInvalidParameterException - in case the value is not compatiblesetDefaultValue(SessionContext, Object)public String getDescription()
public String getDescription(SessionContext ctx)
ctx - the session context specifying the language to get the localized description forpublic void setDescription(String description)
description - the new (localized) descriptionpublic void setDescription(SessionContext ctx, String description)
ctx - the session contex specifying the language to change the description fordescription - the new (localized) descriptionpublic Map getAllDescriptions()
public Map getAllDescriptions(SessionContext ctx)
public void setAllDescriptions(Map descriptions)
public void setAllDescriptions(SessionContext ctx, Map descriptions)
public AttributeDescriptor getSelectionOf()
Attributes which own a selection-of attribute descriptor must to choose their values from the values readable from the selecion-of attribute.
Usually selection-of attribute descriptors describe collection attributes so that there are multiple values to chose from.
Of course the attribute value types have to be compatible.
public void setSelectionOf(AttributeDescriptor descriptor) throws JaloInvalidParameterException
descriptor - the new selection-of attributeJaloInvalidParameterException - if
getSelectionOf()protected void checkSelectionOfDescriptor(AttributeDescriptor newSelect) throws JaloInvalidParameterException
JaloInvalidParameterException - if
setSelectionOf(AttributeDescriptor)public String getDatabaseColumn()
null if the attribute has no persistence
representation.public void setDatabaseColumn(String col)
This change will be only effective after server restart ! Also note that you have to make sure the column exists since it is not atomatically created due to some database ALTER TABLE limitations.
col - the new column namepublic String getProposedDatabaseColumn()
Such a property attribute can be mapped to a own column as follows:
setDatabaseColumn(String)ComposedType.getTable()to get item table
name; for localized attributes use table itemtable +'LP' instead)public Class getPersistenceClass()
getPersistenceType()public AtomicType getPersistenceType()
getPersistenceClass()protected AttributeDescriptor.AttributeDescriptorImpl getAttributeDescriptorImpl()
protected int getIntModifiersFromMap(Map allAttributes)
allAttributes - the attribute valuespublic String toString()
toString in class DescriptorString representation of this item.public static String toString(int modifiers)
public String getPersistenceQualifier()
null
is returned.public boolean isRedeclared()
A redeclared attribute will be included in the XML definition of its type even though it was originally declared in one of its supertypes.
protected Map getXMLCustomProperties()
public String getXMLDefinition()
items.xml. This definiton will be
included in the XML definition of its enclosing type if the attribute has been declarded by it or has been
redeclared.public String exportXMLDefinition(XMLOutputter xout)
exportXMLDefinition in class TypeManagerManagedprotected void exportXMLDefinitionDefaultValue(XMLOutputter xout)
throws IOException
IOExceptionprotected void writeDefaultValueTagAtomic(XMLOutputter xout,
String atomictype,
String value)
public boolean checkTypePermission(UserRight right)
Works similar to Item.checkPermission(UserRight)except that the permissions of the enclosing type and
super attribute are evaluated in case no permission is set for this attribute.
The evaluation first checks the enclosing type and in case no permission is defined there too just checks the super attribute recursively.
right - the user right to checkpublic boolean checkTypePermission(Principal p, UserRight right)
Works similar to Item.checkPermission(UserRight)except that the permissions of the enclosing type and
super attribute are evaluated in case no permission is set for this attribute.
The evaluation first checks the enclosing type and in case no permission is defined there too just checks the super attribute recursively.
p - the principal to checkright - the user right to checkCopyright © 2017 SAP SE. All Rights Reserved.