Package org.cip4.jdflib.extensions
Class BaseXJDFHelper
java.lang.Object
org.cip4.jdflib.extensions.BaseXJDFHelper
- Direct Known Subclasses:
IntentHelper,MessageHelper,MessagePoolHelper,ProductHelper,ResourceHelper,SetHelper,XJDFHelper
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.apache.commons.logging.Logprotected KElement -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendElement(String elementName) appendElement(String elementName, String nameSpaceURI) voidcleanUp()generic cleanup routinecopyHelper(BaseXJDFHelper src) copy the helper src into thisensureID()get the ID from the generic Parameter or Resource elementbooleanequals and hash are based on the xml element that this helper representsgetAttribute(String attName) static BaseXJDFHelpergetBaseHelper(KElement root) factory to create a helper from an elementstatic BaseXJDFHelpergetBaseHelper(XMLDoc doc) factory to create a helper from a docgetComment(int i) getCreateElement(String nodeName) static JDFElement.EnumVersiongetGeneralID(String idUsage) getID()get the ID from the generic Parameter or Resource elementgetRoot()getXPathElement(String xpath) getXPathValue(String xpath) getXRoot()booleanhasAttribute(String attName) inthashCode()equals and hash are based on the xml element that this helper representsbooleanisEqual(BaseXJDFHelper other) voidremoveAttribute(String attrib, String nameSpaceURI) voidsetAttribute(String attName, int value) voidsetAttribute(String attName, String value) setComment(String text) static voidsetDefaultVersion(JDFElement.EnumVersion defaultVersion) voidvoidsetXPathValue(String xpath, String value) toString()
-
Field Details
-
log
protected static final org.apache.commons.logging.Log log -
theElement
-
-
Constructor Details
-
BaseXJDFHelper
protected BaseXJDFHelper() -
BaseXJDFHelper
-
-
Method Details
-
getBaseHelper
factory to create a helper from a doc- Parameters:
doc- the xmldoc to parse- Returns:
- the helper
-
getBaseHelper
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
- Returns:
- the defaultVersion
-
setDefaultVersion
- Parameters:
defaultVersion- the defaultVersion to set
-
getXPathValue
- Parameters:
xpath-- Returns:
-
getXPathElement
- Parameters:
xpath-- Returns:
-
getAttribute
- Parameters:
attName-- Returns:
-
hasAttribute
- Parameters:
attName-- Returns:
-
removeAttribute
- Parameters:
attrib-nameSpaceURI-
-
setAttribute
- Parameters:
attName-value-
-
setAttribute
- Parameters:
attName-value-
-
setXPathValue
- Parameters:
xpath-value-
-
cleanUp
public void cleanUp()generic cleanup routine -
getRoot
- Returns:
- the underlying element
-
getRootDoc
- Returns:
- the underlying element
-
getXRoot
- Returns:
- the underlying element
-
getXJDFRoot
- Returns:
- the underlying parent XJDF element
-
getXJMFRoot
- Returns:
- the underlying parent XJDF element
-
getVersion
- Returns:
- the underlying parent XJDF element
-
deleteNode
- Returns:
-
isEqual
- Returns:
-
getID
get the ID from the generic Parameter or Resource element- Returns:
- the ID , may be null
-
ensureID
get the ID from the generic Parameter or Resource element- Returns:
- the ID , may never be null
-
setID
- Parameters:
newID-
-
hashCode
public int hashCode()equals and hash are based on the xml element that this helper represents -
equals
equals and hash are based on the xml element that this helper represents -
toString
-
appendElement
- Parameters:
elementName-- Returns:
- See Also:
-
copyHelper
copy the helper src into this- Parameters:
src-- Returns:
-
getCreateElement
- Parameters:
nodeName-- Returns:
- See Also:
-
getLocalName
- Returns:
- the local name of the root
-
getGeneralID
- Parameters:
idUsage-idValue-
-
getComment
- Returns:
- the comment text
-
setComment
- Returns:
- the comment
-
getExternalID
- Returns:
- the productID of the product
-
getDescriptiveName
- Returns:
- the descriptive name of the product
-
getAttributeMap
-
appendElement
-