Class ProductHelper

java.lang.Object
org.cip4.jdflib.extensions.BaseXJDFHelper
org.cip4.jdflib.extensions.ProductHelper

public class ProductHelper extends BaseXJDFHelper
  • Field Details

  • Constructor Details

    • ProductHelper

      public ProductHelper(KElement product)
      Parameters:
      product -
  • Method Details

    • 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(String name)
      Parameters:
      name -
      Returns:
    • appendIntent

      public IntentHelper appendIntent(String name)
      Parameters:
      name -
      ih -
      Returns:
    • getIntent

      public IntentHelper getIntent(String name)
      Parameters:
      name -
      Returns:
    • getIntents

      public Vector<IntentHelper> getIntents()
      Returns:
      the vector of intent helpers
    • getIntentAttribute

      public String getIntentAttribute(String intentName, 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(String name)
      Parameters:
      name -
      Returns:
    • getCreateProductResource

      public ResourceHelper getCreateProductResource(String name)
      Parameters:
      name - the resource set name
      Returns:
    • getProductResource

      public ResourceHelper getProductResource(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 String getProductID()
      Deprecated.
      use getExternalID
      Returns:
      the productID of the product
    • getExternalID

      public String getExternalID()
      Overrides:
      getExternalID in class BaseXJDFHelper
      Returns:
      the productID of the product
    • setExternalID

      public void setExternalID(String id)
      Parameters:
      id -
    • getDescriptiveName

      public String getDescriptiveName()
      Overrides:
      getDescriptiveName in class BaseXJDFHelper
      Returns:
      the productID of the product
    • setDescriptiveName

      public void setDescriptiveName(String id)
      Parameters:
      id -
    • getProductType

      public String getProductType()
      Returns:
      the product typeof the product
    • getProductTypeEnum

      public ProductHelper.eProductType getProductTypeEnum()
      Returns:
      the productID of the product
    • setProductType

      public void setProductType(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(String productType, int n)
      get the nth child of this
      Parameters:
      productType - the productType attribute
      n - the index of the child
      Returns:
    • getChildren

      public List<ProductHelper> getChildren(boolean recurse)
      get the vector of children of this
      Returns:
    • getChildren

      @Deprecated public Vector<ProductHelper> getChildren()
      Deprecated.
      use list / boolean
      get 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: BaseXJDFHelper
      generic cleanup routine
      Overrides:
      cleanUp in class BaseXJDFHelper
      See Also: