Package org.cip4.jdflib.extensions
Class ResourceHelper
java.lang.Object
org.cip4.jdflib.extensions.BaseXJDFHelper
org.cip4.jdflib.extensions.ResourceHelper
- All Implemented Interfaces:
IAmountPoolContainer
- Direct Known Subclasses:
PartitionHelper
-
Field Summary
Fields inherited from class org.cip4.jdflib.extensions.BaseXJDFHelper
log, theElement -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendPartMap(JDFAttributeMap part) voidvoidcleanUp()generic cleanup stuffreturn a clone of this, placed just behind thisbooleanensurePart(String key, String value) voidensureReference(KElement src, String key) ensure a reference *FROM* srcvoidensureReference(ResourceHelper src, String key) ensure a reference *FROM* src's explicit resourcedoublegetAmount(JDFAttributeMap partMap, boolean bGood) doublegetAmountSum(boolean bGood) getAttribute(String attrib, String nameSpaceURI, String def) getBrand()getComment(int i) static ResourceHelperfactory to create a helper from an elementgetName()getPartKey(String key) convenience to get the partmap of the first (and typically only) part elementconvenience to get the partmap of the first (and typically only) part elementdoublegetRealAttribute(String attName, String namespace, double def) getResourceAttribute(String string) getSet()getXJDF()booleanhasPartition(JDFAttributeMap exactMap) static booleanstatic booleanstatic booleanisResourceElement(KElement toCheck) booleanmatches(JDFAttributeMap map) booleanmatches(VJDFAttributeMap vmap) voidsetAmount(double amount, JDFAttributeMap moreMap, boolean bGood) voidsetAttribute(String attrib, String value, String nameSpaceURI) voidvoidsetDescriptiveName(String description) voidsetExternalID(String externalID) setGeneralID(String idUsage, String idValue) voidvoidsetPartMapVector(VJDFAttributeMap vPart) voidsetResourceAttribute(String attrib, String value) voidsetResourceEnum(String attrib, ValuedEnum value) voidsetStatus(JDFResource.EnumResStatus status) voidsetVAmount(double amount, VJDFAttributeMap moreMaps, boolean bGood) toString()Methods inherited from class org.cip4.jdflib.extensions.BaseXJDFHelper
appendElement, appendElement, copyHelper, deleteNode, ensureID, equals, getAttribute, getAttributeMap, getBaseHelper, getBaseHelper, getCreateElement, getDefaultVersion, getGeneralID, getID, getLocalName, getRoot, getRootDoc, getVersion, getXJDFRoot, getXJMFRoot, getXPathElement, getXPathValue, getXRoot, hasAttribute, hashCode, isEqual, removeAttribute, setAttribute, setAttribute, setComment, setDefaultVersion, setID, setXPathValueMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.cip4.jdflib.ifaces.IAmountPoolContainer
hasAttribute, removeAttribute
-
Constructor Details
-
ResourceHelper
- Parameters:
partition-
-
-
Method Details
-
isAsset
- Parameters:
toCheck-- Returns:
- true if toCheck is an asset (Resource, Parameter...)
-
isAsset
- Parameters:
toCheck-- Returns:
- true if toCheck is an asset (Resource, Parameter...)
-
isResourceElement
- Parameters:
toCheck-- Returns:
- true if toCheck is an explicit resource element (Media, RunList, ...)
-
getHelper
factory to create a helper from an element- Parameters:
res- the element to parse either a "Resource" or a resource element- Returns:
- the helper
-
getPartMapVector
- Specified by:
getPartMapVectorin interfaceIAmountPoolContainer- Returns:
-
getPartMapList
- Returns:
-
hasPartition
- Parameters:
exactMap- the map that must be present- Returns:
-
getPartMap
convenience to get the partmap of the first (and typically only) part element- Returns:
- one non-null part element that may be empty
-
getPartKey
convenience to get the partmap of the first (and typically only) part element- Returns:
- one non-null part element that may be empty
-
setPartMap
- Parameters:
map- the partmap to set the part element
-
ensurePart
- Parameters:
key-value-- Returns:
- this - useful for lazy chaining
-
ensureReference
ensure a reference *FROM* src- Parameters:
src-key- the reference key in src
-
ensureReference
ensure a reference *FROM* src's explicit resource- Parameters:
src-key- the reference key in src
-
setPartMapVector
- Parameters:
vPart- the vector of partmaps to set the part element
-
appendPartMapVector
- Parameters:
vPart- the vector of partmaps to set the part element
-
appendPartMap
- Parameters:
part-
-
matches
- Parameters:
map-- Returns:
-
containsMap
- Parameters:
map-- Returns:
-
matches
- Parameters:
vmap-- Returns:
-
getPartition
- Returns:
- the generic Parameter or Resource element
-
getSet
- Returns:
- the parent set
-
getXJDF
- Returns:
-
setAmount
- Parameters:
amount-moreMap-bGood-
-
setVAmount
- Parameters:
amount-moreMap-bGood-
-
getResource
- Returns:
- the actual detailed resource
-
getName
- Returns:
- the name of this resource - calculated from ResourceSet/@Name
-
getCreateResource
- Returns:
-
toString
- Overrides:
toStringin classBaseXJDFHelper- Returns:
- See Also:
-
cleanUp
public void cleanUp()generic cleanup stuff- Overrides:
cleanUpin classBaseXJDFHelper
-
getAmountPool
- Specified by:
getAmountPoolin interfaceIAmountPoolContainer- Returns:
- the matching amountpool
- See Also:
-
getAmount
- Parameters:
partMap-- Returns:
-
getAmountSum
public double getAmountSum(boolean bGood) - Parameters:
partMap-- Returns:
-
getAttribute
- Specified by:
getAttributein interfaceIAmountPoolContainer- Returns:
- See Also:
-
getRealAttribute
- Specified by:
getRealAttributein interfaceIAmountPoolContainer- Returns:
- See Also:
-
getLinkRoot
- Specified by:
getLinkRootin interfaceIAmountPoolContainer- Returns:
- See Also:
-
setAttribute
- Specified by:
setAttributein interfaceIAmountPoolContainer- See Also:
-
setResourceAttribute
-
setResourceEnum
-
getCreateAmountPool
- Specified by:
getCreateAmountPoolin interfaceIAmountPoolContainer- Returns:
- the AmountPool
- See Also:
-
setBrand
- Parameters:
brand-
-
getBrand
- Returns:
- the brand
-
getComment
- Overrides:
getCommentin classBaseXJDFHelper- Returns:
- the comment text
-
setExternalID
- Parameters:
externalID-
-
getDescriptiveName
- Overrides:
getDescriptiveNamein classBaseXJDFHelper- Returns:
- the descriptive name of the product
-
getExternalID
- Overrides:
getExternalIDin classBaseXJDFHelper- Returns:
- the productID of the product
-
setStatus
- Parameters:
available-
-
getStatus
- Returns:
- the res status enum
-
setDescriptiveName
- See Also:
-
BaseXJDFHelper.setDescriptiveName(java.lang.String)
-
setGeneralID
- See Also:
-
BaseXJDFHelper.setGeneralID(java.lang.String, java.lang.String)
-
getResourceAttribute
- Parameters:
string-- Returns:
- the attribute of the detailed resource, null if empty
-
clonePartition
return a clone of this, placed just behind this- Returns:
-