Package org.cip4.jdflib.extensions
Class XJDFHelper
java.lang.Object
org.cip4.jdflib.extensions.BaseXJDFHelper
org.cip4.jdflib.extensions.XJDFHelper
- All Implemented Interfaces:
Cloneable,INodeIdentifiable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.static final Stringstatic final Stringstatic final StringFields inherited from class org.cip4.jdflib.extensions.BaseXJDFHelper
log, theElement -
Constructor Summary
ConstructorsConstructorDescriptionXJDFHelper(String jobID, String jobPartID) XJDFHelper(String jobID, String jobPartID, VJDFAttributeMap parts) XJDFHelper(JDFElement.EnumVersion version, String jobID) XJDFHelper(KElement xjdf) -
Method Summary
Modifier and TypeMethodDescriptionappend a types tokenvoidvoidadd a types tokenaddType(JDFNode.EnumType typ) append a enumerated types tokenappendParameter(String name, JDFResourceLink.EnumUsage usage) Deprecated.appendResource(String name, JDFResourceLink.EnumUsage usage) Deprecated.appendResourceSet(String name, JDFResourceLink.EnumUsage usage) appendSet(String family, String name, JDFResourceLink.EnumUsage usage) appendSet(String name, JDFResourceLink.EnumUsage usage) voidcleanUp()generic cleanup routinevoidcleanUp(boolean zappIDs) clone()static JDFElement.EnumVersiongetCreateParameterSet(String name, JDFResourceLink.EnumUsage usage) Deprecated.getCreateProduct(int iProduct) getCreateProduct(String id, String externalID) getCreateResource(String name, JDFResourceLink.EnumUsage usage, String processUsage) getCreateResourceSet(String name, JDFResourceLink.EnumUsage usage) Deprecated.use getCreateSetgetCreateRootProduct(int iProduct) get the Root product by index - note that this need not be the index in the product list but rather depends on the index of the ID in ProductList/@RootProductsgetCreateSet(String family, String name, JDFResourceLink.EnumUsage usage) Deprecated.- all sets are now resource setsgetCreateSet(String name, JDFResourceLink.EnumUsage usage) getCreateSet(String name, JDFResourceLink.EnumUsage usage, String processUsage) get or create a ResourceSet with a name, usage and processUsagegetCreateSet(String name, JDFResourceLink.EnumUsage usage, String processUsage, JDFIntegerList cpi) getCreateSet(String name, JDFResourceLink.EnumUsage usage, String processUsage, JDFIntegerList cpi, boolean explicitCPI) static XJDFHelperfactory to create a helper from an elementstatic XJDFHelperfactory to create a helper from a docgetJobID()getPartition(String id) getPartition(String name, int iSet, int iPart) getProduct(int iProduct) get the Root product by index - note that this need not be the index in the product list but rather depends on the index of the ID in ProductList/@RootProductsgetProduct(String id) the vector of product helpers; null if no ProductList or no ProductList/ProductgetResource(String name, int iSet, int iPart) getRootProduct(int iProduct) get the Root product by index - note that this need not be the index in the product list but rather depends on the index of the ID in ProductList/@RootProductsgetSet(String name, JDFResourceLink.EnumUsage usage) getSet(String name, JDFResourceLink.EnumUsage usage, String processUsage) getSet(String name, JDFResourceLink.EnumUsage usage, String processUsage, int cpi) getSet(String name, JDFResourceLink.EnumUsage usage, String processUsage, JDFIntegerList cpi) getSet(String name, JDFResourceLink.EnumUsage usage, String processUsage, JDFIntegerList cpi, boolean explicitCPI) getSets()getSets(String setName, JDFResourceLink.EnumUsage usage) getType()getTypes()intindexOfType(String typ, int iSkip) booleanDeprecated.use SetHelper.isSetstatic booleanstatic booleanintnumProductHelpers(boolean rootOnly) static XJDFHelperstatic XJDFHelpervoidvoidremoveType(String typ, int iSkip) remove a types tokenvoidsetCategory(String cat) voidsetDescriptiveName(String description) voidsetExternalID(String newID) setGeneralID(String idUsage, String idValue) setICSVersions(ICSVersion... versions) set attribute ICSVersionsvoidvoidvoidsetJobPartID(String jobPartID) voidvoidvoidtoString()writeToDir(String dir) write to a directory - potentially generating a jobPartIDbooleanwriteToFile(String file) voidMethods inherited from class org.cip4.jdflib.extensions.BaseXJDFHelper
appendElement, appendElement, copyHelper, deleteNode, ensureID, equals, getAttribute, getAttributeMap, getBaseHelper, getBaseHelper, getComment, getCreateElement, getDefaultVersion, getExternalID, getGeneralID, getID, getLocalName, getRoot, getRootDoc, getVersion, getXJDFRoot, getXJMFRoot, getXPathElement, getXPathValue, getXRoot, hasAttribute, hashCode, isEqual, removeAttribute, setAttribute, setAttribute, setComment, setDefaultVersion, setID, setXPathValue
-
Field Details
-
RESOURCE
- See Also:
-
XJDF
- See Also:
-
XJMF
- See Also:
-
PARAMETER
Deprecated.- See Also:
-
-
Constructor Details
-
XJDFHelper
- Parameters:
xjdf- if null a new XJDF is generated, else the xjdf root to be manipulated
-
XJDFHelper
- Parameters:
jobID- , if null a new jobid is generatedjobPartID-parts-
-
XJDFHelper
- Parameters:
jobID-jobPartID-
-
XJDFHelper
- Parameters:
jobID-jobPartID-
-
-
Method Details
-
getHelper
factory to create a helper from a doc- Parameters:
doc- the xmldoc to parse- Returns:
- the helper
-
getHelper
factory to create a helper from an element- Parameters:
root- the element to parse if not an XJDF - search in ancestors of element- Returns:
- the helper
-
isXJDF
- Parameters:
root-- Returns:
-
isXJMF
- Parameters:
root-- Returns:
-
parseFile
- Parameters:
fileName-- Returns:
-
parseFile
- Parameters:
fileName-- Returns:
-
getSets
- Returns:
- the vector of parametersets and resourcesets
-
getSets
- Parameters:
setName-usage-- Returns:
- the vector of parametersets and resourcesets
-
getAuditPool
- Returns:
-
getCreateAuditPool
- Returns:
-
getSet
- Parameters:
id-- Returns:
- the parameterset and resourceset with ID=iD
-
getNodeInfo
- Returns:
-
getCreateNodeInfo
- Returns:
-
getSetForPartition
- Parameters:
id-- Returns:
- the parameterset and resourceset with a child partiton with ID=iD
-
getPartition
- Parameters:
id-- Returns:
- the parameterset and resourceset with ID=iD
-
isSet
Deprecated.use SetHelper.isSetis the element a set?- Parameters:
e-- Returns:
-
getJobID
- Returns:
- the
-
getDependentJobParts
- Parameters:
usage- if Input, get predecessors, if Output get followers, if null get any- Returns:
- the list of dependents, null if none were found
-
getProduct
- Parameters:
id-- Returns:
-
getProductByExternalID
- Parameters:
id-- Returns:
-
getCreateProduct
- Parameters:
id-- Returns:
-
getCreateProduct
- Parameters:
id-- Returns:
-
getCreateProduct
- Parameters:
id-externalID- TODO- Returns:
-
getProduct
get the Root product by index - note that this need not be the index in the product list but rather depends on the index of the ID in ProductList/@RootProducts- Parameters:
iProduct- the index of root products- Returns:
- the product, null if no matching product exists
-
getRootProduct
get the Root product by index - note that this need not be the index in the product list but rather depends on the index of the ID in ProductList/@RootProducts- Parameters:
iProduct- the index of root products- Returns:
- the product, null if no matching product exists
-
getCreateRootProduct
get the Root product by index - note that this need not be the index in the product list but rather depends on the index of the ID in ProductList/@RootProducts- Parameters:
iProduct- the index of root products- Returns:
- the product, null if no matching product exists
-
numProductHelpers
public int numProductHelpers(boolean rootOnly) - Parameters:
rootOnly-- Returns:
-
getRootProductHelpers
- Returns:
- the xjdf root element
-
getProductHelpers
the vector of product helpers; null if no ProductList or no ProductList/Product- Returns:
- the vector of product helpers
-
getPartition
- Parameters:
name-iSet-iPart-- Returns:
- PartitionHelper for the requested partition, null if it ain't there
-
getResource
- Parameters:
name-iSet-iPart-- Returns:
- resource for the requested partition, null if it ain't there
-
getSet
- Parameters:
name-iSkip-- Returns:
- the SetHelper for the resourceset with a given name
-
getSet
- Parameters:
name-usage-processUsage- - if uses as a type then the cpi is calculated and returned- Returns:
- the SetHelper for the vector of resourcesets
-
getSet
public SetHelper getSet(String name, JDFResourceLink.EnumUsage usage, String processUsage, JDFIntegerList cpi, boolean explicitCPI) - Parameters:
name-usage-processUsage-- Returns:
- the SetHelper for the vector of resourcesets
-
getSet
public SetHelper getSet(String name, JDFResourceLink.EnumUsage usage, String processUsage, JDFIntegerList cpi) - Parameters:
name-usage-processUsage-- Returns:
- the SetHelper for the vector of resourcesets
-
getSet
- Parameters:
name-usage-processUsage-- Returns:
- the SetHelper
-
getCreateSet
public SetHelper getCreateSet(String name, JDFResourceLink.EnumUsage usage, String processUsage, JDFIntegerList cpi) - Parameters:
name-usage-processUsage-- Returns:
- the SetHelper
-
getCreateSet
public SetHelper getCreateSet(String name, JDFResourceLink.EnumUsage usage, String processUsage, JDFIntegerList cpi, boolean explicitCPI) - Parameters:
name-usage-processUsage-explicitCPI- TODO- Returns:
- the SetHelper
-
getSet
- Parameters:
name-usage-- Returns:
- the SetHelper for the vector of resourcesets
-
appendSet
- Parameters:
family- - always RESOURCE better use appendResourceSetname-usage-- Returns:
- a new set element
-
getCreateSet
@Deprecated public SetHelper getCreateSet(String family, String name, JDFResourceLink.EnumUsage usage) Deprecated.- all sets are now resource sets- Parameters:
family-name-usage-- Returns:
- a new set element
-
getCreateResourceSet
Deprecated.use getCreateSet- Parameters:
name-usage-- Returns:
- a new set element
-
getCreateSet
- Parameters:
name-usage-- Returns:
- a new set element
-
getCreateResource
public KElement getCreateResource(String name, JDFResourceLink.EnumUsage usage, String processUsage) - Parameters:
name-usage-- Returns:
- a new set element
-
getCreateSet
get or create a ResourceSet with a name, usage and processUsage- Parameters:
name-usage-processUsage-- Returns:
- a new set element
-
getCreateParameterSet
Deprecated.- Parameters:
name-usage-- Returns:
- a new set element
-
removeSet
- Parameters:
name-
-
appendParameter
Deprecated.- Parameters:
name-usage-- Returns:
- a new set element
-
appendProduct
- Returns:
- a new producthelper
-
appendResource
Deprecated.- Parameters:
name-usage-- Returns:
- a new set element
-
appendResourceSet
- Parameters:
name-usage-- Returns:
- a new set element
-
appendSet
- Parameters:
name-usage-- Returns:
- a new set element
-
toString
- Overrides:
toStringin classBaseXJDFHelper- Returns:
- See Also:
-
writeToFile
- Parameters:
file-- Returns:
-
writeToDir
write to a directory - potentially generating a jobPartID- Parameters:
dir-- Returns:
-
writeToStream
- Parameters:
os-- Throws:
IOException
-
setTypes
- Parameters:
types-
-
setTypes
- Parameters:
vtypes-
-
getTypes
- Returns:
- types the vector of types
-
getCategory
- Returns:
- the category
-
getPartMapVector
- Returns:
- the category
-
getType
- Returns:
- the implied JDF/@Type - if only one type in @Types, then we use said @Types, else ProcessGroup
-
cleanUp
public void cleanUp()Description copied from class:BaseXJDFHelpergeneric cleanup routine- Overrides:
cleanUpin classBaseXJDFHelper- See Also:
-
cleanUp
public void cleanUp(boolean zappIDs) - See Also:
-
clone
-
getJobPartID
- Returns:
-
setJobPartID
- Parameters:
jobPartID-
-
setJobID
- Parameters:
jobID-
-
setCategory
- Parameters:
cat-
-
getDescriptiveName
- Overrides:
getDescriptiveNamein classBaseXJDFHelper- Returns:
- the productID of the product
-
removeType
remove a types token- Parameters:
typ-iSkip-
-
addType
append a types token- Parameters:
typ-
-
addType
-
addType
append a enumerated types token- Parameters:
typ-
-
addType
add a types token- Parameters:
typ-iSkip- <0 for appendinsert-
-
indexOfType
- Parameters:
typ-iSkip-- Returns:
- the cpi of the iSkip occurrence of typ
-
defaultVersion
- Returns:
- default version - currently 2.0
-
setVersion
-
setICSVersions
set attribute ICSVersions- Parameters:
value- the value to set the attribute to
-
appendICSVersion
-
setExternalID
- See Also:
-
BaseXJDFHelper.setExternalID(java.lang.String)
-
setDescriptiveName
- See Also:
-
BaseXJDFHelper.setDescriptiveName(java.lang.String)
-
getIdentifier
- Specified by:
getIdentifierin interfaceINodeIdentifiable- Returns:
NodeIdentifierthe nodeidentifier that matches this
-
setIdentifier
- Specified by:
setIdentifierin interfaceINodeIdentifiable- Parameters:
ni- the nodeidentifier that this should be set to
-
setGeneralID
- See Also:
-
BaseXJDFHelper.setGeneralID(java.lang.String, java.lang.String)
-