|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--org.writersforge.catalan.transform.rule.QueryRule
|
+--org.writersforge.catalan.transform.rule.CopyRule
A query-based Rule for duplicating elements or attributes to other parts of a Datum tree. The CopyRule can also be used to delete content by not providing a destination, or move content by instructing the Rule to remove the original.
| Method Summary | |
java.lang.String |
getDestination()
Getter for property destination, the Bellows query defining where to move to. |
boolean |
isMove()
Getter for property move, whether or not to keep the original selection. |
static CopyRule |
newCopyDatumRule(java.lang.String query,
java.lang.String destination)
Creates a new instance of CopyRule for copying Datum objects. |
static CopyRule |
newCopyPropertyRule(java.lang.String query,
java.lang.String destination,
java.lang.String propertyName)
Creates a new instance of CopyRule for copying Datum properties. |
static CopyRule |
newDeleteDatumRule(java.lang.String query)
Creates a new instance of CopyRule for deleting Datum objects. |
static CopyRule |
newDeletePropertyRule(java.lang.String query,
java.lang.String propertyName)
Creates a new instance of CopyRule for deleting Datum properties. |
static CopyRule |
newMoveDatumRule(java.lang.String query,
java.lang.String destination)
Creates a new instance of CopyRule for moving Datum objects. |
static CopyRule |
newMovePropertyRule(java.lang.String query,
java.lang.String destination,
java.lang.String propertyName)
Creates a new instance of CopyRule for moving Datum properties. |
protected void |
postProcessTargets(org.writersforge.bellows.Datum[] targets)
Performs any cleanup or deletion on the source Datum objects after all normal processing is finished. |
protected org.writersforge.bellows.Datum |
processDatum(org.writersforge.bellows.Datum content,
org.writersforge.bellows.Datum target)
Applies changes to Datum objects in the supplied content. |
protected org.writersforge.bellows.Datum |
processProperty(org.writersforge.bellows.Datum content,
org.writersforge.bellows.Datum target)
Applies changes to Datum properties in the supplied content. |
| Methods inherited from class org.writersforge.catalan.transform.rule.QueryRule |
getPropertyName, getQuery, isPropertyRule, process |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static CopyRule newCopyDatumRule(java.lang.String query,
java.lang.String destination)
query - the Bellows query to select target contentdestination - the Bellows query to copy Datum objects to
public static CopyRule newCopyPropertyRule(java.lang.String query,
java.lang.String destination,
java.lang.String propertyName)
If a Datum property already exists in a destination Datum, the Rule will implicitly rename the attribute with an appended number. This might happen if the property existed in the destination before the transform, or if the selection query hit more than one source Datum. Thus, an attempt to copy the 'attr' property from three source Datum objects into a destination Datum with the 'attr' property already defined would result in the following properties in the destination: 'attr', 'attr1', 'attr2', and 'attr3'. The copy Rule will do its best to not overwrite any existing properties, so if the destintation already has an 'attr2', the Rule will create a 1, 3, and 4 copy.
query - the Bellows query to select target contentdestination - the Bellows query to copy Datum properties topropertyName - the name of the Datum property to transform
public static CopyRule newMoveDatumRule(java.lang.String query,
java.lang.String destination)
query - the Bellows query to select target contentdestination - the Bellows query to move Datum objects to
public static CopyRule newMovePropertyRule(java.lang.String query,
java.lang.String destination,
java.lang.String propertyName)
newCopyPropertyRule(java.lang.String, java.lang.String, java.lang.String) for semantics
on property copying.
query - the Bellows query to select target contentdestination - the Bellows query to move Datum objects topropertyName - the name of the Datum property to transform
public static CopyRule newDeleteDatumRule(java.lang.String query)
query - the Bellows query to select target content
public static CopyRule newDeletePropertyRule(java.lang.String query,
java.lang.String propertyName)
query - the Bellows query to select target contentpropertyName - the name of the Datum property to delete
public java.lang.String getDestination()
public boolean isMove()
protected org.writersforge.bellows.Datum processDatum(org.writersforge.bellows.Datum content,
org.writersforge.bellows.Datum target)
processDatum in class QueryRulecontent - the root of the processing treetarget - a Datum object to apply the Rule to
protected org.writersforge.bellows.Datum processProperty(org.writersforge.bellows.Datum content,
org.writersforge.bellows.Datum target)
processProperty in class QueryRulecontent - the root of the processing treetarget - a Datum object to apply the Rule to
protected void postProcessTargets(org.writersforge.bellows.Datum[] targets)
postProcessTargets in class QueryRuletargets - an array of individual Datum objects to
post-process
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||