@Component(value="cuba_EntityDiffManager")
public class EntityDiffManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected DynamicAttributesManagerAPI |
dynamicAttributesManagerAPI |
protected ExtendedEntities |
extendedEntities |
protected Metadata |
metadata |
protected MetadataTools |
metadataTools |
protected EntitySnapshotAPI |
snapshotAPI |
Constructor and Description |
---|
EntityDiffManager() |
Modifier and Type | Method and Description |
---|---|
protected EntityPropertyDiff |
generateClassDiffFor(java.lang.Object diffObject,
java.lang.Object firstValue,
java.lang.Object secondValue,
ViewProperty viewProperty,
MetaProperty metaProperty,
java.util.Stack<java.lang.Object> diffBranch)
Generate class difference for selected not null object
|
protected EntityPropertyDiff |
getClassDiff(java.lang.Object firstValue,
java.lang.Object secondValue,
ViewProperty viewProperty,
MetaProperty metaProperty,
java.util.Stack<java.lang.Object> diffBranch) |
protected EntityPropertyDiff |
getCollectionDiff(java.lang.Object firstValue,
java.lang.Object secondValue,
ViewProperty viewProperty,
MetaProperty metaProperty,
java.util.Stack<java.lang.Object> diffBranch) |
EntityDiff |
getDifference(EntitySnapshot first,
EntitySnapshot second) |
protected EntityDiff |
getDifferenceByView(EntitySnapshot first,
EntitySnapshot second,
View diffView) |
protected EntityPropertyDiff |
getDynamicAttributeCollectionDiff(java.lang.Object firstValue,
java.lang.Object secondValue,
MetaProperty metaProperty) |
protected EntityPropertyDiff |
getDynamicAttributeDifference(java.lang.Object firstValue,
java.lang.Object secondValue,
MetaProperty metaProperty,
CategoryAttribute categoryAttribute) |
protected EntityPropertyDiff |
getPropertyDifference(java.lang.Object firstValue,
java.lang.Object secondValue,
MetaProperty metaProperty,
ViewProperty viewProperty,
java.util.Stack<java.lang.Object> diffBranch)
Return difference between property values
|
protected java.util.List<EntityPropertyDiff> |
getPropertyDiffs(View diffView,
Entity firstEntity,
Entity secondEntity,
java.util.Stack<java.lang.Object> diffBranch)
Get diffs for entity properties
|
protected java.lang.Object |
getPropertyValue(Entity entity,
MetaPropertyPath propertyPath) |
protected Entity |
getRelatedItem(java.util.Collection collection,
Entity entity) |
@Inject protected EntitySnapshotAPI snapshotAPI
@Inject protected MetadataTools metadataTools
@Inject protected ExtendedEntities extendedEntities
@Inject protected Metadata metadata
@Inject protected DynamicAttributesManagerAPI dynamicAttributesManagerAPI
public EntityDiff getDifference(@Nullable EntitySnapshot first, EntitySnapshot second)
protected EntityDiff getDifferenceByView(EntitySnapshot first, EntitySnapshot second, View diffView)
protected java.util.List<EntityPropertyDiff> getPropertyDiffs(View diffView, Entity firstEntity, Entity secondEntity, java.util.Stack<java.lang.Object> diffBranch)
diffView
- ViewfirstEntity
- First entitysecondEntity
- Second entitydiffBranch
- Diff branchprotected EntityPropertyDiff getPropertyDifference(java.lang.Object firstValue, java.lang.Object secondValue, MetaProperty metaProperty, ViewProperty viewProperty, java.util.Stack<java.lang.Object> diffBranch)
firstValue
- First valuesecondValue
- Second valuemetaProperty
- Meta PropertyviewProperty
- View propertydiffBranch
- Branch with passed diffsprotected EntityPropertyDiff getClassDiff(@Nullable java.lang.Object firstValue, @Nullable java.lang.Object secondValue, ViewProperty viewProperty, MetaProperty metaProperty, java.util.Stack<java.lang.Object> diffBranch)
protected EntityPropertyDiff generateClassDiffFor(java.lang.Object diffObject, @Nullable java.lang.Object firstValue, @Nullable java.lang.Object secondValue, ViewProperty viewProperty, MetaProperty metaProperty, java.util.Stack<java.lang.Object> diffBranch)
diffObject
- ObjectfirstValue
- First valuesecondValue
- Second valueviewProperty
- View propertymetaProperty
- Meta propertydiffBranch
- Diff branchprotected EntityPropertyDiff getCollectionDiff(java.lang.Object firstValue, java.lang.Object secondValue, ViewProperty viewProperty, MetaProperty metaProperty, java.util.Stack<java.lang.Object> diffBranch)
protected EntityPropertyDiff getDynamicAttributeDifference(java.lang.Object firstValue, java.lang.Object secondValue, MetaProperty metaProperty, CategoryAttribute categoryAttribute)
protected EntityPropertyDiff getDynamicAttributeCollectionDiff(java.lang.Object firstValue, java.lang.Object secondValue, MetaProperty metaProperty)
protected java.lang.Object getPropertyValue(Entity entity, MetaPropertyPath propertyPath)