public class ItemModelContextImpl extends java.lang.Object implements ItemModelInternalContext, java.io.Serializable
ItemModelContext.| Modifier and Type | Method and Description |
|---|---|
void |
afterCreate(LocaleProvider locProvider,
AttributeProvider attrProvider,
DynamicAttributesProvider dynProvider,
PK pk,
long persistenceVersion,
java.lang.String typeCode) |
void |
afterReload(long persistenceVersion) |
void |
afterUpdate(long persistenceVersion) |
void |
beforeAttach(LocaleProvider localeProvider) |
boolean |
equals(java.lang.Object obj) |
boolean |
exists()
Checks if the model is still valid.
|
PK |
generateNewPK()
Generate the new PK and assigns it to the current model.
|
AttributeProvider |
getAttributeProvider() |
java.util.Map<java.lang.String,LocMap<java.util.Locale,java.lang.Object>> |
getCombinedLocalizedValuesMap() |
protected java.util.Locale |
getCurrentLocale() |
java.util.Set<java.lang.String> |
getDirtyAttributes()
Returns all changed attributes.
|
java.util.Map<java.util.Locale,java.util.Set<java.lang.String>> |
getDirtyLocalizedAttributes()
Returns all changed localized attributes with the locale.
|
DynamicAttributesProvider |
getDynamicAttributesProvider() |
<T> T |
getDynamicValue(AbstractItemModel model,
java.lang.String attribute)
Retrieves the dynamic value of the attribute.
|
protected FetchStrategy |
getFetchStrategy() |
java.lang.String |
getItemType()
Retrieves the item type of the model.
|
LocaleProvider |
getLocaleProvider(boolean required) |
<T> T |
getLocalizedDynamicValue(AbstractItemModel model,
java.lang.String attribute,
java.util.Locale loc)
Retrieves the dynamic value of the attribute with the local.
|
<T> T |
getLocalizedRelationValue(java.lang.String key,
java.util.Locale locale)
Retrieves the current value of the specific attribute with the locale.
|
<T> T |
getLocalizedValue(java.lang.String key,
java.util.Locale locale)
Retrieves the localized value of the key.
|
protected java.lang.Object |
getLocalizedWithFallback(java.util.Map<java.util.Locale,java.lang.Object> attrLocMap,
java.lang.String qualifier,
java.util.Locale dataLocale,
boolean keepOriginals,
boolean isRelationAttribute) |
PK |
getNewPK()
Returns the newPK assigned to the current model
|
<T> T |
getOriginalValue(java.lang.String key)
Retrieves the original loaded value of the attribute.
|
<T> T |
getOriginalValue(java.lang.String key,
java.util.Locale loc)
Retrieves the original loaded value of the localized attribute with the locale.
|
protected <T> T |
getOrLoadLocalized(java.util.Map<java.util.Locale,java.lang.Object> locMap,
java.lang.String qualifier,
java.util.Locale dataLoc,
boolean keepAsOriginal) |
PersistenceObject |
getPersistenceSource() |
long |
getPersistenceVersion()
Retrieves the persistence version of the model.
|
PK |
getPK()
Retrieves the pk of the model.
|
<T> T |
getPropertyValue(java.lang.String attribute)
Returns a value of a property with given name.
|
java.lang.Object |
getRawPropertyValue(java.lang.String qualifier) |
SerializationStrategy |
getSerializationStrategy() |
java.lang.Object |
getSource()
Retrieves the item of the model.
|
java.lang.String |
getTenantId()
Retrieves the tenant id of the model.
|
<T> T |
getValue(java.lang.String key,
T currentValue)
Retrieves the value of the key.
|
ModelValueHistory |
getValueHistory() |
int |
hashCode() |
int |
hashCode(AbstractItemModel itemModel)
Calculates the hash code of the model.
|
boolean |
isDirty()
Checks if the model has been modified.
|
boolean |
isDirty(java.lang.String attribute)
Checks if the specific attribute has been changed.
|
boolean |
isDirty(java.lang.String attribute,
java.util.Locale loc)
Checks if the specific localized attribute has been changed with the locale.
|
boolean |
isDynamicAttribute(java.lang.String attributeName)
Returns information whether given attribute is dynamic or not
|
boolean |
isLoaded(java.lang.String attribute)
Checks if the specific attribute has been loaded from the database.
|
boolean |
isLoaded(java.lang.String attribute,
java.util.Locale loc)
Checks if the specific localized attribute has been loaded with the locale from the database.
|
boolean |
isNew()
Checks if the model is a new model.
|
boolean |
isRemoved()
Checks if the model has been removed from the database.
|
boolean |
isUpToDate()
Checks if the model is still up to date with.
|
protected <T> T |
loadLocalized(java.util.Map<java.util.Locale,java.lang.Object> locMap,
java.lang.String qualifier,
java.util.Locale dataLoc,
boolean keepAsOriginal) |
protected <T> T |
loadLocalized(java.util.Map<java.util.Locale,java.lang.Object> locMap,
java.lang.String qualifier,
java.util.Locale dataLoc,
boolean keepAsOriginal,
boolean resetDirty) |
java.lang.Object |
loadOriginalValue(java.lang.String attribute)
Returns the original value for the given attribute
|
java.lang.Object |
loadOriginalValue(java.lang.String attribute,
java.util.Locale locale)
Returns the original localized value for the given attribute
|
protected java.lang.Object |
loadUnlocalizedAttribute(java.lang.String key,
boolean keepAsOriginalValue,
boolean resetDirty) |
protected void |
markDirty(java.lang.String attribute) |
protected void |
markDirty(java.lang.String attribute,
java.util.Locale dataLocale) |
void |
setAttributeProvider(AttributeProvider attributeProvider) |
void |
setDynamicAttributesProvider(DynamicAttributesProvider attributeProvider) |
<T> void |
setDynamicValue(AbstractItemModel model,
java.lang.String attribute,
T value)
Sets the dynamic value of the attribute.
|
void |
setFetchStrategy(FetchStrategy fetchStrategy) |
void |
setLocaleProvider(LocaleProvider localeProvider) |
<T> void |
setLocalizedDynamicValue(AbstractItemModel model,
java.lang.String attribute,
java.util.Locale loc,
T value)
Sets the dynamic value of the attribute under the locale.
|
<T> void |
setLocalizedValue(java.lang.String qualifier,
java.util.Locale locale,
T value)
Sets the new value for the specific attribute with the locale.
|
<T> void |
setPropertyValue(java.lang.String attribute,
T value)
Allows to set a value of a property with given name.
|
void |
setRawPropertyValue(java.lang.String qualifier,
java.lang.Object value) |
void |
setSerializationStrategy(SerializationStrategy strategy) |
<T> T |
setValue(java.lang.String key,
T newValue)
Sets the new value for the specific attribute.
|
protected void |
throwLoadingError(java.lang.String qualifier) |
protected void |
throwLoadingError(java.lang.String qualifier,
java.util.Locale dataLocale) |
protected java.util.Locale |
toDataLocale(java.util.Locale locale) |
java.lang.Object |
writeReplace(java.lang.Object model)
YXX
|
public int hashCode(AbstractItemModel itemModel)
ItemModelInternalContexthashCode in interface ItemModelInternalContextpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic ModelValueHistory getValueHistory()
public boolean isDynamicAttribute(java.lang.String attributeName)
ItemModelInternalContextisDynamicAttribute in interface ItemModelInternalContextattributeName - attribute namepublic java.lang.Object writeReplace(java.lang.Object model)
throws java.io.ObjectStreamException
ItemModelInternalContextwriteReplace in interface ItemModelInternalContextjava.io.ObjectStreamExceptionpublic PK getPK()
ItemModelContextgetPK in interface ItemModelContextpublic java.lang.String getItemType()
ItemModelContextgetItemType in interface ItemModelContextpublic long getPersistenceVersion()
ItemModelContextgetPersistenceVersion in interface ItemModelContextpublic java.lang.Object getSource()
ItemModelContextgetSource in interface ItemModelContextpublic PersistenceObject getPersistenceSource()
public boolean isDirty()
ItemModelContextisDirty in interface ItemModelContextpublic boolean exists()
ItemModelContextexists in interface ItemModelContextpublic boolean isRemoved()
ItemModelContextisRemoved in interface ItemModelContextpublic boolean isUpToDate()
ItemModelContextisUpToDate in interface ItemModelContextpublic boolean isNew()
ItemModelContextisNew in interface ItemModelContextpublic <T> T getValue(java.lang.String key,
T currentValue)
getValue in interface ItemModelInternalContextpublic <T> T getPropertyValue(java.lang.String attribute)
ItemModelInternalContextgetPropertyValue in interface ItemModelInternalContextattribute - namepublic <T> void setPropertyValue(java.lang.String attribute,
T value)
ItemModelInternalContextsetPropertyValue in interface ItemModelInternalContextattribute - namevalue - value to setpublic java.lang.Object getRawPropertyValue(java.lang.String qualifier)
public void setRawPropertyValue(java.lang.String qualifier,
java.lang.Object value)
protected java.lang.Object loadUnlocalizedAttribute(java.lang.String key,
boolean keepAsOriginalValue,
boolean resetDirty)
public <T> T setValue(java.lang.String key,
T newValue)
ItemModelInternalContextsetValue in interface ItemModelInternalContextpublic java.util.Set<java.lang.String> getDirtyAttributes()
ItemModelContextgetDirtyAttributes in interface ItemModelContextpublic boolean isDirty(java.lang.String attribute)
ItemModelContextisDirty in interface ItemModelContextpublic boolean isLoaded(java.lang.String attribute)
ItemModelContextisLoaded in interface ItemModelContextpublic <T> T getOriginalValue(java.lang.String key)
ItemModelContextgetOriginalValue in interface ItemModelContextpublic java.lang.Object loadOriginalValue(java.lang.String attribute)
ItemModelInternalContextloadOriginalValue in interface ItemModelInternalContextattribute - attribute namepublic java.lang.Object loadOriginalValue(java.lang.String attribute,
java.util.Locale locale)
ItemModelInternalContextloadOriginalValue in interface ItemModelInternalContextattribute - attribute namelocale - locale namepublic <T> T getDynamicValue(AbstractItemModel model, java.lang.String attribute)
ItemModelInternalContextgetDynamicValue in interface ItemModelInternalContextmodel - YTODOpublic <T> void setDynamicValue(AbstractItemModel model, java.lang.String attribute, T value)
ItemModelInternalContextsetDynamicValue in interface ItemModelInternalContextmodel - YTODOpublic <T> T getLocalizedDynamicValue(AbstractItemModel model, java.lang.String attribute, java.util.Locale loc)
ItemModelInternalContextgetLocalizedDynamicValue in interface ItemModelInternalContextmodel - YTODOpublic <T> void setLocalizedDynamicValue(AbstractItemModel model, java.lang.String attribute, java.util.Locale loc, T value)
ItemModelInternalContextsetLocalizedDynamicValue in interface ItemModelInternalContextmodel - YTODOpublic <T> T getLocalizedValue(java.lang.String key,
java.util.Locale locale)
getLocalizedValue in interface ItemModelInternalContextpublic <T> T getLocalizedRelationValue(java.lang.String key,
java.util.Locale locale)
ItemModelInternalContextgetLocalizedRelationValue in interface ItemModelInternalContextprotected java.lang.Object getLocalizedWithFallback(java.util.Map<java.util.Locale,java.lang.Object> attrLocMap,
java.lang.String qualifier,
java.util.Locale dataLocale,
boolean keepOriginals,
boolean isRelationAttribute)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionprotected <T> T getOrLoadLocalized(java.util.Map<java.util.Locale,java.lang.Object> locMap,
java.lang.String qualifier,
java.util.Locale dataLoc,
boolean keepAsOriginal)
protected <T> T loadLocalized(java.util.Map<java.util.Locale,java.lang.Object> locMap,
java.lang.String qualifier,
java.util.Locale dataLoc,
boolean keepAsOriginal)
protected <T> T loadLocalized(java.util.Map<java.util.Locale,java.lang.Object> locMap,
java.lang.String qualifier,
java.util.Locale dataLoc,
boolean keepAsOriginal,
boolean resetDirty)
protected java.util.Locale toDataLocale(java.util.Locale locale)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic <T> void setLocalizedValue(java.lang.String qualifier,
java.util.Locale locale,
T value)
ItemModelInternalContextsetLocalizedValue in interface ItemModelInternalContextpublic boolean isDirty(java.lang.String attribute,
java.util.Locale loc)
ItemModelContextisDirty in interface ItemModelContextpublic boolean isLoaded(java.lang.String attribute,
java.util.Locale loc)
ItemModelContextisLoaded in interface ItemModelContextpublic <T> T getOriginalValue(java.lang.String key,
java.util.Locale loc)
ItemModelContextgetOriginalValue in interface ItemModelContextpublic java.util.Map<java.util.Locale,java.util.Set<java.lang.String>> getDirtyLocalizedAttributes()
ItemModelContextgetDirtyLocalizedAttributes in interface ItemModelContextprotected void throwLoadingError(java.lang.String qualifier)
protected void throwLoadingError(java.lang.String qualifier,
java.util.Locale dataLocale)
protected void markDirty(java.lang.String attribute)
protected void markDirty(java.lang.String attribute,
java.util.Locale dataLocale)
protected java.util.Locale getCurrentLocale()
throws java.lang.IllegalStateException
java.lang.IllegalStateExceptionpublic SerializationStrategy getSerializationStrategy()
public LocaleProvider getLocaleProvider(boolean required)
public void setLocaleProvider(LocaleProvider localeProvider)
public DynamicAttributesProvider getDynamicAttributesProvider()
protected FetchStrategy getFetchStrategy()
public java.lang.String getTenantId()
ItemModelContextgetTenantId in interface ItemModelContextpublic java.util.Map<java.lang.String,LocMap<java.util.Locale,java.lang.Object>> getCombinedLocalizedValuesMap()
public void beforeAttach(LocaleProvider localeProvider)
public void setAttributeProvider(AttributeProvider attributeProvider)
public AttributeProvider getAttributeProvider()
public void setDynamicAttributesProvider(DynamicAttributesProvider attributeProvider)
public void afterCreate(LocaleProvider locProvider, AttributeProvider attrProvider, DynamicAttributesProvider dynProvider, PK pk, long persistenceVersion, java.lang.String typeCode)
public void afterUpdate(long persistenceVersion)
public void afterReload(long persistenceVersion)
public void setFetchStrategy(FetchStrategy fetchStrategy)
public void setSerializationStrategy(SerializationStrategy strategy)
public PK getNewPK()
ItemModelInternalContextgetNewPK in interface ItemModelInternalContextpublic PK generateNewPK()
ItemModelInternalContextgenerateNewPK in interface ItemModelInternalContextCopyright © 2018 SAP SE. All Rights Reserved.