|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.applications.xmlimporter.BasicMerger
public class BasicMerger
This is a basic implementation of ObjectMerger. It applies these rules:
| Constructor Summary | |
|---|---|
BasicMerger()
|
|
| Method Summary | |
|---|---|
boolean |
areDuplicates(TmpObject relation1,
TmpObject relation2)
Tests if two relations should be considered duplicates, indicating that one of them can be disposed of. |
void |
init(HashMap<String,String> params)
Initialize this instance. |
boolean |
isAllowedToAdd(TmpObject tmpObj)
Tests if this object should be added to the persistent cloud when not present already. |
void |
mergeField(TmpObject tmpObj1,
TmpObject tmpObj2,
String name)
Merge a field. |
void |
mergeRelations(TmpObject tmpObj1,
TmpObject tmpObj2,
List<TmpObject> relations1,
List<TmpObject> relations2)
Merge relations. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BasicMerger()
| Method Detail |
|---|
public void init(HashMap<String,String> params)
init in interface ObjectMergerparams - The initialization parameters, provided as
name/value pairs (both String).
public void mergeField(TmpObject tmpObj1,
TmpObject tmpObj2,
String name)
mergeField in interface ObjectMergername - The name of the field.
(Note: "number" and "owner" are not considered fields in this context,
so this method will not be called with these values for name.)tmpObj1 - The first object to be merged. This will hold
the resulting merged object afterwards.tmpObj2 - The second object. this object must be deleted
afterwards.
public void mergeRelations(TmpObject tmpObj1,
TmpObject tmpObj2,
List<TmpObject> relations1,
List<TmpObject> relations2)
mergeRelations in interface ObjectMergertmpObj1 - The first object to be merged. This will hold
the resulting merged object afterwards.tmpObj2 - The second object. this object must be deleted
afterwards.relations1 - List of all relations of the first object.relations2 - List of all relations of the second object.
public boolean areDuplicates(TmpObject relation1,
TmpObject relation2)
areDuplicates in interface ObjectMergerrelation1 - The first relation.relation2 - The second relation.
public boolean isAllowedToAdd(TmpObject tmpObj)
isAllowedToAdd in interface ObjectMergertmpObj - The object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||