|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.alfresco.util.schemacomp.model.AbstractDbObject
public abstract class AbstractDbObject
Useful base class for many, if not all the DbObject implementations.
| Field Summary | |
|---|---|
protected ComparisonUtils |
comparisonUtils
|
| Constructor Summary | |
|---|---|
AbstractDbObject(DbObject parent,
java.lang.String name)
Instantiate, giving the object a parent and a name. |
|
| Method Summary | |
|---|---|
void |
diff(DbObject right,
DiffContext ctx,
Result.Strength strength)
Provides an implementation of DbObject#diff(DbObject, Results). |
protected void |
doDiff(DbObject right,
DiffContext ctx,
Result.Strength strength)
Override this method to provide subclass specific diffing logic. |
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getName()
All items can be asked for their name, but it may be null. |
Result.Strength |
getNameStrength()
|
DbObject |
getParent()
Get the parent object for which this object is a child. |
java.lang.String |
getTypeName()
Type name, e.g. |
java.util.List |
getValidators()
Retrieve the list of validators associated with this database object. |
int |
hashCode()
|
boolean |
sameAs(DbObject other)
Are the two DbObjects logically the same? For example two Index objects may have
different names, but are the same index as they both index the same columns for the same table. |
void |
setComparisonUtils(ComparisonUtils comparisonUtils)
If a ComparisonUtils other than the default is required, then this setter can be used. |
void |
setName(java.lang.String name)
|
void |
setNameStrength(Result.Strength nameStrength)
|
void |
setParent(DbObject parent)
Sets the parent object. |
void |
setValidators(java.util.List validators)
Set/override the validators associated with this database object. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.alfresco.util.schemacomp.model.DbObject |
|---|
accept |
| Field Detail |
|---|
protected ComparisonUtils comparisonUtils
| Constructor Detail |
|---|
public AbstractDbObject(DbObject parent,
java.lang.String name)
parent - name - | Method Detail |
|---|
public java.lang.String getName()
DbObject
getName in interface DbObjectpublic void setName(java.lang.String name)
name - the name to setpublic Result.Strength getNameStrength()
public void setNameStrength(Result.Strength nameStrength)
nameStrength - the nameStrength to setpublic boolean sameAs(DbObject other)
DbObjectDbObjects logically the same? For example two Index objects may have
different names, but are the same index as they both index the same columns for the same table.
If two objects a and b have the same logical identity, it does not mean that a.equals(b) == true.
The two objects may well have differences and will be flagged as such by the schema comparison tool. When
a.sameAs(b) == true it makes it easier to show the differences as related, i.e. a and b are
different rather than, a is only in the 'left' tree and b is only in the 'right' tree.
sameAs in interface DbObjectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
public void diff(DbObject right,
DiffContext ctx,
Result.Strength strength)
DbObject#diff(DbObject, Results). The template
method #doDiff(DbObject, Results) provides the subclass specific diffing logic,
whilst this method handles the workflow required in most cases: set the path's prefix that will be
used to explain where differences occur; compare the name fields of the two objects; delegate to the
subclass specific diffing (if any); remove the last path addition ready for the next object to perform
its diff correctly.
diff in interface DbObjectright - The object to compare against.ctx - The DiffContextpublic DbObject getParent()
DbObject
getParent in interface DbObjectpublic void setParent(DbObject parent)
DbObject
setParent in interface DbObjectDbObject.getParent()
protected void doDiff(DbObject right,
DiffContext ctx,
Result.Strength strength)
right - differences - strength - public void setComparisonUtils(ComparisonUtils comparisonUtils)
comparisonUtils - the comparisonUtils to setpublic java.util.List getValidators()
DbObject
getValidators in interface DbObjectDbValidatorpublic void setValidators(java.util.List validators)
DbObject
setValidators in interface DbObjectvalidators - the validators to setpublic java.lang.String getTypeName()
DbObject
getTypeName in interface DbObject
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||