Class BaseXJDFHelper

java.lang.Object
org.cip4.jdflib.extensions.BaseXJDFHelper
Direct Known Subclasses:
IntentHelper, MessageHelper, MessagePoolHelper, ProductHelper, ResourceHelper, SetHelper, XJDFHelper

public abstract class BaseXJDFHelper extends Object
  • Field Details

    • log

      protected static final org.apache.commons.logging.Log log
    • theElement

      protected KElement theElement
  • Constructor Details

    • BaseXJDFHelper

      protected BaseXJDFHelper()
    • BaseXJDFHelper

      protected BaseXJDFHelper(KElement theElement)
  • Method Details

    • getBaseHelper

      public static BaseXJDFHelper getBaseHelper(XMLDoc doc)
      factory to create a helper from a doc
      Parameters:
      doc - the xmldoc to parse
      Returns:
      the helper
    • getBaseHelper

      public static BaseXJDFHelper getBaseHelper(KElement root)
      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
    • getDefaultVersion

      public static JDFElement.EnumVersion getDefaultVersion()
      Returns:
      the defaultVersion
    • setDefaultVersion

      public static void setDefaultVersion(JDFElement.EnumVersion defaultVersion)
      Parameters:
      defaultVersion - the defaultVersion to set
    • getXPathValue

      public String getXPathValue(String xpath)
      Parameters:
      xpath -
      Returns:
    • getXPathElement

      public KElement getXPathElement(String xpath)
      Parameters:
      xpath -
      Returns:
    • getAttribute

      public String getAttribute(String attName)
      Parameters:
      attName -
      Returns:
    • hasAttribute

      public boolean hasAttribute(String attName)
      Parameters:
      attName -
      Returns:
    • removeAttribute

      public void removeAttribute(String attrib, String nameSpaceURI)
      Parameters:
      attrib -
      nameSpaceURI -
    • setAttribute

      public void setAttribute(String attName, String value)
      Parameters:
      attName -
      value -
    • setAttribute

      public void setAttribute(String attName, int value)
      Parameters:
      attName -
      value -
    • setXPathValue

      public void setXPathValue(String xpath, String value)
      Parameters:
      xpath -
      value -
    • cleanUp

      public void cleanUp()
      generic cleanup routine
    • getRoot

      public KElement getRoot()
      Returns:
      the underlying element
    • getRootDoc

      public JDFDoc getRootDoc()
      Returns:
      the underlying element
    • getXRoot

      public BaseXJDFHelper getXRoot()
      Returns:
      the underlying element
    • getXJDFRoot

      public XJDFHelper getXJDFRoot()
      Returns:
      the underlying parent XJDF element
    • getXJMFRoot

      public XJMFHelper getXJMFRoot()
      Returns:
      the underlying parent XJDF element
    • getVersion

      public JDFElement.EnumVersion getVersion()
      Returns:
      the underlying parent XJDF element
    • deleteNode

      public KElement deleteNode()
      Returns:
    • isEqual

      public boolean isEqual(BaseXJDFHelper other)
      Returns:
    • getID

      public String getID()
      get the ID from the generic Parameter or Resource element
      Returns:
      the ID , may be null
    • ensureID

      public String ensureID()
      get the ID from the generic Parameter or Resource element
      Returns:
      the ID , may never be null
    • setID

      public void setID(String newID)
      Parameters:
      newID -
    • hashCode

      public int hashCode()
      equals and hash are based on the xml element that this helper represents
      Overrides:
      hashCode in class Object
      See Also:
    • equals

      public boolean equals(Object obj)
      equals and hash are based on the xml element that this helper represents
      Overrides:
      equals in class Object
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      See Also:
    • appendElement

      public KElement appendElement(String elementName)
      Parameters:
      elementName -
      Returns:
      See Also:
    • copyHelper

      public KElement copyHelper(BaseXJDFHelper src)
      copy the helper src into this
      Parameters:
      src -
      Returns:
    • getCreateElement

      public KElement getCreateElement(String nodeName)
      Parameters:
      nodeName -
      Returns:
      See Also:
    • getLocalName

      public String getLocalName()
      Returns:
      the local name of the root
    • getGeneralID

      public String getGeneralID(String idUsage)
      Parameters:
      idUsage -
      idValue -
    • getComment

      public String getComment(int i)
      Returns:
      the comment text
    • setComment

      public JDFComment setComment(String text)
      Returns:
      the comment
    • getExternalID

      public String getExternalID()
      Returns:
      the productID of the product
    • getDescriptiveName

      public String getDescriptiveName()
      Returns:
      the descriptive name of the product
    • getAttributeMap

      public JDFAttributeMap getAttributeMap()
    • appendElement

      public KElement appendElement(String elementName, String nameSpaceURI)