Package org.cip4.jdflib.extensions
Class ProductHelper
- java.lang.Object
-
- org.cip4.jdflib.extensions.BaseXJDFHelper
-
- org.cip4.jdflib.extensions.ProductHelper
-
public class ProductHelper extends BaseXJDFHelper
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProductHelper.eProductType
-
Field Summary
Fields Modifier and Type Field Description static booleanpartitionProductsstatic java.lang.StringPRODUCTstatic java.lang.StringPRODUCTLISTstatic java.lang.StringrootProductroot products attribute name-
Fields inherited from class org.cip4.jdflib.extensions.BaseXJDFHelper
log, theElement
-
-
Constructor Summary
Constructors Constructor Description ProductHelper(KElement product)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IntentHelperappendIntent(java.lang.String name)voidcleanUp()generic cleanup routineintgetAmount()ProductHelpergetChild(int nChild)get the nth child of thisProductHelpergetChild(java.lang.String productType, int n)get the nth child of thisjava.util.Vector<ProductHelper>getChildren()Deprecated.use list / booleanjava.util.List<ProductHelper>getChildren(boolean recurse)get the vector of children of thisIntentHelpergetCreateIntent(java.lang.String name)ResourceHelpergetCreateProductResource(java.lang.String name)java.lang.StringgetDescriptiveName()java.lang.StringgetExternalID()static ProductHelpergetHelper(KElement e)factory to create a helper from an elementIntentHelpergetIntent(java.lang.String name)java.lang.StringgetIntentAttribute(java.lang.String intentName, java.lang.String attName)get an attribute from an explicit intent resourcejava.util.Vector<IntentHelper>getIntents()intgetMaxAmount()intgetMinAmount()SetHelpergetNodeInfo()get an attribute from an explicit intent resourcedoublegetOverproduction()ProductHelpergetParent()get the nth child of thisKElementgetProduct()java.lang.StringgetProductID()Deprecated.use getExternalIDResourceHelpergetProductResource(java.lang.String name)SetHelpergetProductSet(java.lang.String name)java.lang.StringgetProductType()ProductHelper.eProductTypegetProductTypeEnum()booleanisRootProduct()voidsetAmount(int amount)voidsetChild(ProductHelper phKid)voidsetChild(ProductHelper phCover, int amount)Deprecated.voidsetCustomerInfo(ResourceHelper cuph)reference the customerinfo specified by phvoidsetDescriptiveName(java.lang.String id)voidsetExternalID(java.lang.String id)voidsetMaxAmount(int amount)voidsetMinAmount(int amount)voidsetProductType(java.lang.String productType)voidsetProductType(ProductHelper.eProductType productType)voidsetRoot()voidsetRoot(boolean isRoot)-
Methods inherited from class org.cip4.jdflib.extensions.BaseXJDFHelper
appendElement, appendElement, copyHelper, deleteNode, ensureID, equals, getAttribute, getAttributeMap, getBaseHelper, getBaseHelper, getComment, getCreateElement, getDefaultVersion, getGeneralID, getID, getLocalName, getRoot, getRootDoc, getXJDFRoot, getXPathElement, getXPathValue, getXRoot, hasAttribute, hashCode, isEqual, removeAttribute, setAttribute, setAttribute, setComment, setDefaultVersion, setID, setXPathValue, toString
-
-
-
-
Field Detail
-
PRODUCT
public static final java.lang.String PRODUCT
- See Also:
- Constant Field Values
-
PRODUCTLIST
public static final java.lang.String PRODUCTLIST
- See Also:
- Constant Field Values
-
partitionProducts
public static boolean partitionProducts
-
rootProduct
public static final java.lang.String rootProduct
root products attribute name- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ProductHelper
public ProductHelper(KElement product)
- Parameters:
product-
-
-
Method Detail
-
getHelper
public static ProductHelper getHelper(KElement e)
factory to create a helper from an element- Parameters:
root- the element to parse- Returns:
- the helper
-
setRoot
public void setRoot()
-
setRoot
public void setRoot(boolean isRoot)
- Parameters:
isRoot-
-
getCreateIntent
public IntentHelper getCreateIntent(java.lang.String name)
- Parameters:
name-- Returns:
-
appendIntent
public IntentHelper appendIntent(java.lang.String name)
- Parameters:
name-ih-- Returns:
-
getIntent
public IntentHelper getIntent(java.lang.String name)
- Parameters:
name-- Returns:
-
getIntents
public java.util.Vector<IntentHelper> getIntents()
- Returns:
- the vector of intent helpers
-
getIntentAttribute
public java.lang.String getIntentAttribute(java.lang.String intentName, java.lang.String attName)get an attribute from an explicit intent resource- Parameters:
intentName-attName-- Returns:
-
getNodeInfo
public SetHelper getNodeInfo()
get an attribute from an explicit intent resource- Parameters:
intentName-attName-- Returns:
-
getProductSet
public SetHelper getProductSet(java.lang.String name)
- Parameters:
name-- Returns:
-
getCreateProductResource
public ResourceHelper getCreateProductResource(java.lang.String name)
- Parameters:
name- the resource set name- Returns:
-
getProductResource
public ResourceHelper getProductResource(java.lang.String name)
- Parameters:
name- the resource set name- Returns:
-
getAmount
public int getAmount()
- Returns:
- amount the amount to get
-
setAmount
public void setAmount(int amount)
- Parameters:
amount- the amount to set
-
getMaxAmount
public int getMaxAmount()
- Returns:
- amount the max amount to get, defaults to the value of amount
-
getProductID
@Deprecated public java.lang.String getProductID()
Deprecated.use getExternalID- Returns:
- the productID of the product
-
getExternalID
public java.lang.String getExternalID()
- Overrides:
getExternalIDin classBaseXJDFHelper- Returns:
- the productID of the product
-
setExternalID
public void setExternalID(java.lang.String id)
- Parameters:
id-
-
getDescriptiveName
public java.lang.String getDescriptiveName()
- Overrides:
getDescriptiveNamein classBaseXJDFHelper- Returns:
- the productID of the product
-
setDescriptiveName
public void setDescriptiveName(java.lang.String id)
- Parameters:
id-
-
getProductType
public java.lang.String getProductType()
- Returns:
- the product typeof the product
-
getProductTypeEnum
public ProductHelper.eProductType getProductTypeEnum()
- Returns:
- the productID of the product
-
setProductType
public void setProductType(java.lang.String productType)
- Parameters:
productType-
-
setProductType
public void setProductType(ProductHelper.eProductType productType)
- Parameters:
productType-
-
getOverproduction
public double getOverproduction()
- Returns:
- overproduction in %
-
setMaxAmount
public void setMaxAmount(int amount)
- Parameters:
amount- the amount to set
-
getMinAmount
public int getMinAmount()
- Returns:
- amount the minamount to get, if not set default to Amount
-
setMinAmount
public void setMinAmount(int amount)
- Parameters:
amount- the amount to set
-
setChild
@Deprecated public void setChild(ProductHelper phCover, int amount)
Deprecated.- Parameters:
phCover-amount-
-
setChild
public void setChild(ProductHelper phKid)
- Parameters:
phCover-
-
getChild
public ProductHelper getChild(int nChild)
get the nth child of this- Parameters:
nChild- the index of the child- Returns:
-
getParent
public ProductHelper getParent()
get the nth child of this- Parameters:
nChild- the index of the child- Returns:
-
getChild
public ProductHelper getChild(java.lang.String productType, int n)
get the nth child of this- Parameters:
productType- the productType attributen- the index of the child- Returns:
-
getChildren
public java.util.List<ProductHelper> getChildren(boolean recurse)
get the vector of children of this- Returns:
-
getChildren
@Deprecated public java.util.Vector<ProductHelper> getChildren()
Deprecated.use list / booleanget the vector of children of this- Returns:
-
getProduct
public KElement getProduct()
- Returns:
-
isRootProduct
public boolean isRootProduct()
- Returns:
- the explicit value or the heuristic value if not set
-
setCustomerInfo
public void setCustomerInfo(ResourceHelper cuph)
reference the customerinfo specified by ph- Parameters:
cuph-
-
cleanUp
public void cleanUp()
Description copied from class:BaseXJDFHelpergeneric cleanup routine- Overrides:
cleanUpin classBaseXJDFHelper- See Also:
BaseXJDFHelper.cleanUp()
-
-