Package org.cip4.jdflib.util
Class JDFMerge
java.lang.Object
org.cip4.jdflib.util.JDFMerge
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanset this to true if you want to update the ProcessRun(s) timestamps for this mergebooleanset this to true if you want to update the stati of the relevant parent nodes based on the new Stati of the merged node -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmerge a previously spawned JDF into a node that is a child of, or this rootmergeJDF(JDFNode _toMerge, String urlMerge, JDFNode.EnumCleanUpMerge cleanPolicy, JDFResource.EnumAmountMerge amountPolicy) merge a previously spawned JDF into a node that is a child of, or this rootprotected voidmergeLocalResourcePool(JDFNode overwriteLocalNode, JDFNode toMergeLocalNode) static JDFResourcemergePartition(JDFResource targetRes, JDFResource toMerge, String spawnID, JDFResource.EnumAmountMerge amountPolicy, boolean bLocalResource) Merges partitioned resources into this resource uses PartIDKey to identify the correct resourcesprotected voidremergeJDF(JDFNode _toMerge) merge a previously spawned and previously merged JDF into a node that is a child of, or this rootvoidsetAmountPolicy(JDFResource.EnumAmountMerge amountPolicy) voidsetCleanPolicy(JDFNode.EnumCleanUpMerge cleanPolicy) toString()
-
Field Details
-
bUpdateStati
public boolean bUpdateStatiset this to true if you want to update the stati of the relevant parent nodes based on the new Stati of the merged node -
bAddMergeToProcessRun
public boolean bAddMergeToProcessRunset this to true if you want to update the ProcessRun(s) timestamps for this merge
-
-
Constructor Details
-
JDFMerge
- Parameters:
parentNode- the parent node to merge into. MAY be the actual node to be replace or any Parent thereof
-
-
Method Details
-
mergeJDF
public JDFNode mergeJDF(JDFNode _toMerge, String urlMerge, JDFNode.EnumCleanUpMerge cleanPolicy, JDFResource.EnumAmountMerge amountPolicy) merge a previously spawned JDF into a node that is a child of, or this rootdefault: mergeJDF(subJDFNode, null, JDFNode.EnumCleanUpMerge.None, JDFResource.EnumAmountMerge.None)
- Parameters:
_toMerge- the previously spawned jdf nodeurlMerge- the url of the ???cleanPolicy- policy how to clean up the spawn and merge audits after mergingamountPolicy- policy how to clean up the Resource amounts after merging- Returns:
- JDFNode - the merged node in the new document
note that the return value used to be boolean. The boolean value is now replaced by exceptions. This corresponds totruealways. - Throws:
JDFException- if subJDFNode has already been mergedJDFException- if subJDFNode was not spawned from thisJDFException- if subJDFNode has no AncestorPool default: mergeJDF(subJDFNode, null, JDFNode.EnumCleanUpMerge.None, JDFResource.EnumAmountMerge.None)
-
mergeJDF
merge a previously spawned JDF into a node that is a child of, or this root- Parameters:
_toMerge- the previously spawned jdf node- Returns:
- JDFNode - the merged node in the new document
note that the return value used to be boolean. The boolean value is now replaced by exceptions. This corresponds totruealways. - Throws:
JDFException- if subJDFNode has already been mergedJDFException- if subJDFNode was not spawned from thisJDFException- if subJDFNode has no AncestorPool
-
remergeJDF
merge a previously spawned and previously merged JDF into a node that is a child of, or this root- Parameters:
_toMerge- the previously spawned jdf node- Returns:
- JDFNode - the merged node in the new document
note that the return value used to be boolean. The boolean value is now replaced by exceptions. This corresponds totruealways. - Throws:
JDFException- if subJDFNode has no AncestorPool
-
remergeAuditPools
protected void remergeAuditPools() -
mergeLocalResourcePool
-
mergePartition
public static JDFResource mergePartition(JDFResource targetRes, JDFResource toMerge, String spawnID, JDFResource.EnumAmountMerge amountPolicy, boolean bLocalResource) Merges partitioned resources into this resource uses PartIDKey to identify the correct resources- Parameters:
targetRes-resToMerge- the resource leaf to merge into thisspawnID- the spawnID of the spawning that will now be mergedamountPolicy- how to clean up the Resource amounts after mergingbLocalResource- must be true for the local resources in a spawned node and its subnodes, which default to RW- Returns:
- Throws:
JDFException- if here is an attempt to merge incompatible resourcesJDFException- if here is an attempt to merge incompatible partitions
-
toString
-
getCleanPolicy
- Returns:
-
setCleanPolicy
- Parameters:
cleanPolicy-
-
getAmountPolicy
- Returns:
-
setAmountPolicy
- Parameters:
amountPolicy-
-