org.cip4.jdflib.resource
Class JDFResource.PartitionGetter

java.lang.Object
  extended by org.cip4.jdflib.resource.JDFResource.PartitionGetter
Enclosing class:
JDFResource

public class JDFResource.PartitionGetter
extends Object

Author:
Rainer Prosi, Heidelberger Druckmaschinen *

Constructor Summary
JDFResource.PartitionGetter()
           
 
Method Summary
 JDFResource addPartition(JDFResource.EnumPartIDKey partType, String value)
          Adds a new part to this node, also handles PartIDKeys in the root etc.
 VElement createPartitions(VJDFAttributeMap vPartMap, VString vPartIDKeys)
          Recursively adds the partition leaves defined in vPartMap
 JDFResource getCreatePartition(JDFAttributeMap partMap, VString vPartKeys)
          Recursively adds the partition leaves defined in partMap
protected  JDFResource getDeepPart(JDFAttributeMap m, JDFResource.EnumPartUsage partUsage)
          Gets a matching part from somewhere down there,
returns the closest ancestor of all matching elements within the target vector
protected  VElement getDeepPartVector(JDFAttributeMap m_in, JDFResource.EnumPartUsage partUsage, int matchingDepth, VString partIDKeys)
           
 JDFResource getPartition(JDFAttributeMap m, JDFResource.EnumPartUsage partUsage)
          Gets the first part that matches mAttribute
 VElement getPartitionVector(JDFAttributeMap m, JDFResource.EnumPartUsage partUsage)
          Gets the vector of parts (resource leaves or nodes) that match mAttribute
protected  VElement getPartitionVector(VJDFAttributeMap vm, JDFResource.EnumPartUsage partUsage)
          Gets the vector of parts (resource leaves or nodes) that match mAttribute
 boolean isFollowIdentical()
          Getter for followIdentical attribute.
 void setFollowIdentical(boolean followIdentical)
          Setter for followIdentical attribute.
 void setStrictPartVersion(boolean strictPartVersion)
          if set to true, partversion will only match if the string matches exactly
if set to false (the default) partversions will match if tokens overlap
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JDFResource.PartitionGetter

public JDFResource.PartitionGetter()
Method Detail

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

isFollowIdentical

public boolean isFollowIdentical()
Getter for followIdentical attribute.

Returns:
the followIdentical

setFollowIdentical

public void setFollowIdentical(boolean followIdentical)
Setter for followIdentical attribute.

Parameters:
followIdentical - the followIdentical to set

getPartitionVector

protected VElement getPartitionVector(VJDFAttributeMap vm,
                                      JDFResource.EnumPartUsage partUsage)
Gets the vector of parts (resource leaves or nodes) that match mAttribute

Parameters:
vm - the map of key-value partitions (where key - PartIDKey, value - its value)
partUsage - also accept nodes that are are not completely specified in the partmap, e.g. if partitioned by run, RunPage and only Run is specified
Returns:
VElement - the vector of matching resource leaves or nodes

getPartitionVector

public VElement getPartitionVector(JDFAttributeMap m,
                                   JDFResource.EnumPartUsage partUsage)
Gets the vector of parts (resource leaves or nodes) that match mAttribute

Parameters:
m - the map of key-value partitions (where key - PartIDKey, value - its value)
partUsage - also accept nodes that are are not completely specified in the partmap, e.g. if partitioned by run, RunPage and only Run is specified
Returns:
VElement - the vector of matching resource leaves or nodes

getDeepPartVector

protected VElement getDeepPartVector(JDFAttributeMap m_in,
                                     JDFResource.EnumPartUsage partUsage,
                                     int matchingDepth,
                                     VString partIDKeys)

getPartition

public JDFResource getPartition(JDFAttributeMap m,
                                JDFResource.EnumPartUsage partUsage)
Gets the first part that matches mAttribute

Parameters:
m - the map of key-value partitions (where key - PartIDKey, value - its value)
partUsage - also accept nodes that are are not completely specified in the partmap, e.g. if partitioned by run, RunPage and only Run is specified
Returns:
JDFResource: the first matching resource leaf or node

getDeepPart

protected JDFResource getDeepPart(JDFAttributeMap m,
                                  JDFResource.EnumPartUsage partUsage)
Gets a matching part from somewhere down there,
returns the closest ancestor of all matching elements within the target vector

Parameters:
m - map of attributes that should fit
partUsage - lso accept nodes that are are not completely specified in the partmap, e.g. if partitioned by run, RunPage and only Run is specified
Returns:
the first found matching resource node or leaf

getCreatePartition

public JDFResource getCreatePartition(JDFAttributeMap partMap,
                                      VString vPartKeys)
Recursively adds the partition leaves defined in partMap

Parameters:
partMap - the map of part keys
vPartKeys - the vector of partIDKeys strings of the resource. If empty (the default), the Resource PartIDKeys attribute is used
Returns:
JDFResource the last created partition leaf
Throws:
JDFException - if there are in the partMap not matching partitions
JDFException - if there is an attempt to fill non-matching partIDKeys
JDFException - if by adding of last partition key there is either non-continuous partmap or left more than one key

addPartition

public JDFResource addPartition(JDFResource.EnumPartIDKey partType,
                                String value)
Adds a new part to this node, also handles PartIDKeys in the root etc.

Parameters:
partType - part type of a new part
value - its value
Returns:
JDFResource - the newly created part

createPartitions

public VElement createPartitions(VJDFAttributeMap vPartMap,
                                 VString vPartIDKeys)
Recursively adds the partition leaves defined in vPartMap

Parameters:
vPartMap - the vector of maps of part keys
vPartIDKeys - the vector of partIDKeys strings of the resource. If empty (the default) the Resource PartIDKeys attribute is used
Returns:
VElement - vector of newly created partitions
Throws:
JDFException - if there are in the partMap not matching partitions
JDFException - if there is an attempt to fill non-matching partIDKeys
JDFException - if by adding of last partition key there is either non-continuous partmap or left more than one key

setStrictPartVersion

public void setStrictPartVersion(boolean strictPartVersion)
if set to true, partversion will only match if the string matches exactly
if set to false (the default) partversions will match if tokens overlap

Parameters:
strictPartVersion -


Copyright © 2013. All Rights Reserved.