Class KElement
- All Implemented Interfaces:
Serializable,Cloneable,IStreamWriter,Element,ElementTraversal,EventTarget,Node,NodeList,TypeInfo
- Direct Known Subclasses:
JDFElement
Every access to a Element should be wrapped using KElement.
KElement is completely agnostic to JDF.
Typically elements in non-JDF namespaces will be KElements.
note that it is discouraged to mix direct calls to Dom Element and KElement routines a future version will most likely contain a private ElementNSImpl rather than inherit from it. The current extension solution is a work around around a xerces bug
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classsorts according to the value of one attribute
if the attribute is numeric, compare numerically, else lexical comparison is donestatic classsorts according to the lexical string representation of the xml objectsstatic classsorts according to the lexical string representation of the xml objectsstatic classsorts according to the value of one attribute
if the attribute is numeric, compare numerically, else lexical comparison is donestatic classsorts according to the value of one attribute
if the attribute is numeric, compare numerically, else lexical comparison is done -
Field Summary
Fields inherited from class org.apache.xerces.dom.ElementNSImpl
localName, namespaceURIFields inherited from class org.apache.xerces.dom.ElementImpl
attributes, nameFields inherited from class org.apache.xerces.dom.ParentNode
firstChild, fNodeListCache, ownerDocumentFields inherited from class org.apache.xerces.dom.ChildNode
nextSibling, previousSiblingFields inherited from class org.apache.xerces.dom.NodeImpl
DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, ID, IGNORABLEWS, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODEFields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODEFields inherited from interface org.w3c.dom.TypeInfo
DERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for KElementKElement(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument, String myNamespaceURI, String qualifiedName) Constructor for KElementKElement(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument, String myNamespaceURI, String qualifiedName, String myLocalName) Constructor for KElement -
Method Summary
Modifier and TypeMethodDescriptiondoubleaddAttribute(String key, double inc, String nameSpaceURI) increments or decrements a numeric attribute by incintaddAttribute(String key, int inc, String nameSpaceURI) increments or decrements a numeric attribute by incbooleanaddNameSpace(String strPrefix, String strNameSpaceURI) Adds a NameSpace and maps the prefix to a URI.intancestorDistance(KElement child) distance to ancestor (0=this)appendAnchor(String newID) create and append a unique id, keep the existing one if it already existsappendAttribute(String key, String value, boolean unique) convenienceappendAttribute(String key, String value, String nameSpaceURI, String sep, boolean bUnique) Append the contents of value to the existing attribute key.voidAppend the contents of value to the existing attribute key.voidappendCData(String cDataText) Appends XML CData section<![CDATA[ CData Section ]]>some character data
Appends a new CData section child node to the end of 'this 'voidappendCData(KElement cDataElem) Appends XML CData section<![CDATA[ CData Section ]]>some character data
Appends a new CData section child node to the end of 'this 'appendChild(Node arg0) appendElement(String elementName) append a DOM element.appendElement(String elementName, String nameSpaceURI) appendElementN(String elementName, int maxAllowed, String nameSpaceURI) Appends a new child element to the end of 'this', if it's maximum number of the children with defined name and nameSpace doesn't exceed maxAllowedappendElementRaw(String elementName, String nameSpaceURI) appends an element without any namespace validity checks or initialization Faster but not sa safe...voidappendEntityReference(String refName) appends a entity reference to the actual elementvoidappendText(String textName) append some generic textappendTextElement(String nodeName, String text) append a text element with text includedvoidappendXMLComment(String commentText) Deprecated.use appendXMLComment(commentText, null);appendXMLComment(String commentText, KElement beforeChild) append a DOM comment<!-- XMLComment -->The double minus sign '--' is escaped with an underscore '_' in order to ensure valid xmlbuildRelativeXPath(KElement relativeTo, int methCountSiblings) Gets the XPath full tree representation of 'this'Deprecated.use buildXPath(null,true);buildXPath(String relativeTo) Deprecated.use buildXPath(relativeTo,true);buildXPath(String relativeTo, int methCountSiblings) Gets the XPath full tree representation of 'this'voidcleanup()removes everythingvoidcleanup all namespace stuffprotected voidclone()the clone is the same documentsame as @see clone but the clone is in a new document
the document gets copies of context sensitive stuff like zip, mime, filename...copyAttribute(String attrib, KElement src) copy an attribute from src to this - shorthand if no renaming or namespace handling is necessarycopyAttribute(String attrib, KElement src, boolean overwriteEmpty) copy an attribute from src to this - shorthand if no renaming or namespace handling is necessarycopyAttribute(String attrib, KElement src, String srcAttrib, String nameSpaceURI, String srcNameSpaceURI) copy an attribute from src to this, if null - remove the attributecopyAttribute(String attrib, KElement src, String srcAttrib, String nameSpaceURI, String srcNameSpaceURI, boolean overwriteEmpty) copy an attribute from src to this, if null - remove the attributevoidcopyChildren(String elementName, KElement src) copyElement(KElement src, KElement beforeChild) Copies src node (including all attributes and subelements) and inserts the copy into 'this' in front of beforeChild, if it exists.voidcopyElements(VElement v, KElement beforeChild) append all children in a vector of elements in the order of the vectorcopies a node into this, ignoring identical node names i.e.copyXPathValue(String dstXPath, KElement src, String srcXPath) copy attribute values or text from an xpath in src to thisstatic KElementcreateRoot(String nodename) create a new root documentstatic KElementcreateRoot(String nodename, String namespaceURI) create a new root documentDeletes itself from its parentensureCase(String key) ensure the correct case of n attribute, if presentvoideraseEmptyAttributes(boolean bRecurse) remove all empty attributes from this (e.g.interaseEmptyNodes(boolean bTrimWhite) Erases all empty text nodes in 'this' and its subelements If there any empty text nodes removes them.fillHashSet(String attName, String attNS) fills a HashSet with all values of the attribute in all child elementsbooleanTests whether the specified nodename and namespace fits the nodename and namespace of 'this'protected booleanfitsName_KElement(String nodeName, String nameSpaceURI) booleanflush()Flush - remove all attributes, elements and text, leaving only a stub taggenerateDotID(String key, String nameSpaceURI) generate a unique id in the syntax newID=oldID.nn
nn is a unique number, that is generated as the first integer higher than the number of sibling elements with the same name.getAttribute(String strLocalName) Mother of all attribute getters
Gets an attribute value out of an element<T extends Enum<T>>
TgetAttribute(String key, Class<T> c) no namespace variantgetAttribute(String attrib, String nameSpaceURI, String def) mother of all attribute getters.getAttribute_KElement(String strLocalName) Mother of all attribute getters
Gets an attribute value out of an elementgetAttribute_KElement(String attrib, String nameSpaceURI, String def) Because getAttribute is overwritten in various classes this method can be called directly to get only KElement Attribute.Gets all attribute keys of 'this' as a vector of stringsGets an atrribute if the local nameGet the Attribute Map of the actual elementGet the Attribute Map of the actual elementgetAttributeRaw(String qualifiedName) getAttribute with no pardon for namespaces or anythingGets all attribute keys of 'this' as a vector of stringsGets all attribute keys of 'this' as a vector of stringsbooleangetBoolAttribute(String attrib, String nameSpaceURI, boolean def) get a boolean attributegetCData(int i) Gets of 'this' the text of the i'th XML CData section.getChildArray(String nodeName, String nameSpaceURI) Get all children from the actual element matching the given conditions
convenience for getChildElementVector(nodeName, nameSpaceURI, null, true, 0, true)getChildArray_KElement(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bAnd, int maxSize) Get all children from the actual element matching the given conditions
does NOT get refElement targets although the attributes are checked in the target elements in case of refElementsgetChildArrayByClass(Class<A> clazz, boolean bRecurse, int nMax) Get all children from the actual element matching the given conditions
does NOT get refElement targets although the attributes are checked in the target elements in case of refElements never nullgetChildArrayByClass_KElement(Class<A> clazz, boolean bRecurse, int nMax) Get all children from the actual element matching the given conditions
does NOT get refElement targets although the attributes are checked in the target elements in case of refElements never nullgetChildAttributeList(String nodeName, String attName, String nameSpaceURI, String attValue, boolean bDirect, boolean bUnique) Get a vector of all value of the attribute attName in the children of this nodegetChildByTagName(String s, String nameSpaceURI, int index, JDFAttributeMap mAttrib, boolean bDirect, boolean bAnd) Get a child from the actual element by the tag name.KElement[]gets an array of the direct children of the current elementgetChildElementVector(String nodeName, String nameSpaceURI) Get all children from the actual element matching the given conditions
convenience for getChildElementVector(nodeName, nameSpaceURI, null, true, 0, true)getChildElementVector(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bAnd, int maxSize) Deprecated.060302 - use 6 parameter versiongetChildElementVector(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bAnd, int maxSize, boolean bResolveTarget) Get all children from the actual element matching the given conditions
does NOT get refElement targets although the attributes are checked in the target elements in case of refElementsgetChildElementVector_KElement(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bAnd, int maxSize) Get all children from the actual element matching the given conditions
does NOT get refElement targets although the attributes are checked in the target elements in case of refElementsgetChildFromList(VString nodeNames, int iSkip) Deprecated.use getChildFromList(Vector nodeNames, int iSkip, JDFAttributeMap map)getChildFromList(VString nodeNames, int iSkip, JDFAttributeMap map, boolean bDirect) Get any Child that matches a string defined in nodeNames.never null list of all kidsgetChildList(String nodeName, String nameSpaceURI) Get all children from the actual element matching the given conditions
convenience for getChildElementVector(nodeName, nameSpaceURI, null, true, 0, true)protected NodegetChildNode(int nodeType, int iPos) gets the n'th child node of nodetypenodeTypewith n = iPosDeprecated.use getChildElementVector(null, null, null, true, 0)getChildNodeVector(int maxSize) Deprecated.getChildrenByClass(Class<A> clazz, boolean bRecurse, int nMax) Deprecated.use getChildArrayByClassgetChildrenByTagName(String elementName) convenience helpergetChildrenByTagName(String elementName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bDirect, boolean bAnd, int maxSize) Gets children of 'this' by tag name, nameSpaceURI and attribute map, if the attribute map is not empty.
Searches the entire tree including hidden nodes that are children of non-matching nodesgetChildrenByTagName_KElement(String elementName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bDirect, boolean bAnd, int maxSize) Gets children of 'this' by tag name, nameSpaceURI and attribute map, if the attribute map is not empty.
Searches the entire tree including hidden nodes that are children of non-matching nodesgetChildrenFromList(VString nodeNames, JDFAttributeMap map, boolean bDirect, VElement v) get a vector of all Children that match the strings defined in nodeNamesgetChildrenIgnoreList(VString nodeNames, boolean bDirect, VElement v) get a vector of all Children that do not match the strings defined in nodeNamesgetChildrenWithAttribute(String nodeName, String attName, String nameSpaceURI, String attVal, boolean bDirect) Deprecated.use getChildrenByTagName(nodeName, nameSpaceURI, new JDFAttributeMap(attName, attVal), bDirect, true, 0);<A extends KElement>
AgetChildWithAttribute(Class<A> clazz, String attName, String attVal) <A extends KElement>
AgetChildWithAttribute(Class<A> clazz, String attName, String attVal, boolean recurse) getChildWithAttribute(String nodeName, String attName, String nameSpaceURI, String attVal, int index, boolean bDirect) GetChildWithAttribute - Get a child with matching attributesgetCreateChildWithAttribute(String nodeName, String attName, String nameSpaceURI, String attVal, int index) GetChildWithAttribute - Get a child with matching attributes; craete it if it does not existgetCreateElement(String nodeName) Get the actual element, create if not theregetCreateElement(String nodeName, String nameSpaceURI, int iSkip) Get the actual element, create if not theregetCreateElement_KElement(String nodeName, String nameSpaceURI, int iSkip) Gets the iSkip-th child node with matching nodeName and nameSpaceURI, optionally creates it if it doesn't exist.getCreateXPathElement(String path) gets an element as defined by XPath to value and creates it if it does not existgetDeepElement(String nodeName, String nameSpaceURI, int iSkip) Deprecated.use getChildByTagName(nodeName, nameSpaceURI, iSkip, null, false, true);getDeepParent(String parentNode, int depth) Get the n'th Ancestor node with name parentNodegetDeepParent(Vector vParentElement, int depth) Deprecated.- loop over the single node methodgetDeepParentChild(String parentNode) Get the first child of parentNode with name parentNodegetDeepParentNotName(String thisNode) Get the Ancestor node with name other than thisNodeGets the root element of the current documentgetDOMAttr(String attrib, String nameSpaceURI, boolean bInherit) Get The DOM Attribute node of a given attribute if attrib has no namespace prefix and nameSpaceURI is a wildcard the attribute with the element prefix will be returned if no empty attribute exists e.g.getElement(String nodeName) Get the actual element - utility routine.getElement(String nodeName, String nameSpaceURI, int iSkip) Gets an existing iSkip-th child node with matching nodeName and nameSpaceURIgetElement_KElement(String nodeName, String nameSpaceURI, int iSkip) getElement - Get the actual element<A extends KElement>
AgetElementByClass(Class<A> clazz, int iSkip, boolean bRecurse) getElement - Get the actual element by java classgetElementHashMap(String elementName, String elementNS, String attName) performance enhanced function to access multiple elements e.g.Returns a vector which contains the childs of the actual element.getElementsByTagName_KElement(String s, String nameSpaceURI) wrappers of DOM routines that dont bang on null nodesget the first child element<a extends KElement>
agetFirstChildElement(Class<a> clazz) Gets the previous sibling named nodename from the namespace nameSpaceURI of 'this'.getFirstChildElement(String nodeName, String nameSpaceURI) Gets the previous sibling named nodename from the namespace nameSpaceURI of 'this'.static ElementgetFirstElementNode(Element parent) Deprecated.use elem.getFirstChildElementgetID()gets attribute IDprotected StringgetIDPrefixgetIgnoreCase(String strLocalName) similar to getAttribute but returns null for all empty strings Gets an attribute value out of an elementgetIgnoreCase_KElement(String strLocalName) similar to getAttribute but returns null for all empty strings Gets an attribute value out of an elementgetInheritedAttribute(String attrib, String nameSpaceURI, String def) searches for the first attribute occurrence in this element or any ancestorsgetInheritedElement(String elementName, String nameSpaceURI, int iSkip) searches for the first child element occurence in this element or any ancestorsgetInheritedXPathAttribute(String path, String def) Gets an attribute value as defined by XPath namespace prefixes are resolved
Attributes are searched for in partitioned resources if appropriateintgetIntAttribute(String attrib, String nameSpaceURI, int def) Get a integer attribute if presentstatic StringgetLocalNameStatic(KElement kElem) Deprecated.use getLocalNamelonggetLongAttribute(String attrib, String nameSpaceURI, long def) Get a long attribute if presentgetMultipleIDs(String attName) Get a vector of all IDs that occur multiple timesGet the NameSpaceURIgetNamespaceURIFromPrefix(String prefix) Gets the NameSpaceURI corresponding to a given prefix, returns null if no namespace is definedstatic ElementgetNextElementNode(Element elem) Deprecated.- use elem.getNextSiblingElement();get the next sibling element<a extends KElement>
agetNextSiblingElement(Class<a> clazz) Gets the previous sibling named nodename from the namespace nameSpaceURI of 'this'.getNextSiblingElement(String nodeName, String nameSpaceURI) Gets the previous sibling named nodename from the namespace nameSpaceURI of 'this'.getNonEmpty(String strLocalName) similar to getAttribute but returns null for all empty strings Gets an attribute value out of an elementgetNonEmpty_KElement(String strLocalName) similar to getAttribute but returns null for all empty strings Gets an attribute value out of an elementintgets the number of direct child CData sectionsintgetNumChildNodes(int nodeType) Gets the number of direct child nodes of 'this', that match NodeTypeintGets the number of direct text child nodesintgets the number of direct XMLComment child nodes of 'this'Get the document object that owns thisget the parent node of thisget the previous sibling elementgetPreviousSiblingElement(String nodeName, String nameSpaceURI) Gets the previous sibling named nodename from the namespace nameSpaceURI of 'this'.doublegetRealAttribute(String attrib, String nameSpaceURI, double def) get a double attributelooking for a specified target with an id, e.g.getTarget_KElement(String id, String attrib) Gets the target of link.getText()gets a concatenated string representing of all direct text child nodesgetText(int i) gets the i'th text child node of 'this'Get children from the actual element by the tag name
GetTree only follows direct links, e.g.getTree(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bDirect, boolean bAnd) Get children from the actual element by the tag name, nameSpaceURI or attribute map.getTreeByClass(Class<A> cl, boolean addself) getTreeElement(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bDirect, boolean bAnd) Get child from the actual element by the tag name, nameSpaceURI or attribute map.getXMLComment(int i) gets of 'this' the text of the i-th child XMLComment.static StringDeprecated.static StringgetXMLNSPrefix(String pc) Deprecated.use xmlnsPrefixgetXPathAttribute(String path, String def) Gets an attribute value as defined by XPath namespace prefixes are resolved or the node text if an element is specifiedgetXPathAttributeMap(String path) Gets a map of attribute values as defined by XPath namespace prefixes are resolvedgetXPathElement(String path) gets an element as defined by XPath to valuegetXPathElementVector(String path, int maxSize) gets an vector of elements element as defined by XPath to valueGets a map of attribute values as defined by XPath namespace prefixes are resolvedgetXPathValueMap(boolean isRelative) Gets a map of attribute values as defined by XPath namespace prefixes are resolvedreturns the xsi:type of this element, null if not presentbooleanhasAttribute(String attrib) Checks if the actual element has a specific attribute
this version checks only the explicit element and NOT any inherited resource partiotions Attention! this behavior differs from that of @see getAttribute()booleanhasAttribute(String attrib, String nameSpaceURI, boolean bInherit) Checks if the actual element has a specific attribute
this version checks within the exact xml elementbooleanhasAttribute_KElement(String attrib, String nameSpaceURI, boolean bInherit) Checks if the actual element has a specific attribute
this version checks within the exact xml elementbooleanchecks if the current element has attributesbooleanhasChildElement(String nodeName, String nameSpaceURI) Checks whether the current element has a child element NodeNamebooleanchecks if the current element has a child elementprotected booleanhasChildNodes(int nodeType) checks wether this has node childs of the stated node typebooleanTests, whether 'this' contains any text child nodesbooleanhasNonEmpty(String strLocalName) similar to hasAttribute but returns false for all empty strings Gets an attribute value out of an elementbooleanhasNonEmpty_KElement(String strLocalName) similar to hasAttribute but returns false for all empty strings Gets an attribute value out of an elementbooleanhasXPathNode(String path) returns true if the element or attribute described by this XPath exists, else falsebooleanincludesAttribute(String attName, String attValue) Check if an attribute is present.booleanincludesAttributes(JDFAttributeMap aMap, boolean bAnd) Checks if the actual element contains the attributes given in aMapbooleaninit()Method init.insertAt(String nodeName, int beforePos, String beforeNode, String nameSpaceURI, String beforeNameSpaceURI) Creates a new child element with defined Name and NameSpace and inserts it in front of the node with a name bForeNode and namespace beforeNameSpaceURI, with index beforePosinsertBefore(String elementName, Node beforeChild, String nameSpaceURI) Inserts the Element elementName before the existing Element node beforeChild.insertBefore(Node arg0, Node arg1) booleanisAncestor(KElement child) checks if KElement child is ancestor or notbooleanisDirty()Get the dirty status of this elementbooleanChecks if the contents of this element are equal to element kElem
differs from @see equals because nodes that are in different locations or documents but have the same name, attributes and elements are considered equalstatic booleannull safe test whether the elements e1 and e2 are equalstatic booleanisWildCard(String nodeName) Tests whether an argument is a wildcard i.e null, empty or * note that Wildcard ("*") is deprecated ideally null should be used to denote a wildcardbooleanmatchesPath(String path) Deprecated.use matchesPath(String path, boolean bFollowRefs)booleanmatchesPath(String path, boolean bFollowRefs) check whether this element matches a simple xpathprotected booleanmatchesPathName(String pathAt) mergeElement(KElement kElem, boolean bDelete) merge nodes in a way that no duplicate elements are created
attention !! this kills pools !! since elements in kElem overwrite those in *thisvoidmoveArray(Collection<KElement> v, KElement beforeChild) move all children in a vector of elements in the order of the vectorvoidmoveAttribute(String attrib, KElement src) moves an attribute from src to this, the attribute will be removed from src and moved to this.voidmoveAttribute(String attrib, KElement src, String srcAttrib, String nameSpaceURI, String srcNameSpaceURI) moves an attribute from src to this, the attribute will be removed from src and moved to this.moveElement(KElement src, KElement beforeChild) Moves src node (including all attributes and subelements) from its parent node into 'this' and inserts it in front of beforeChild, if it exists.voidmoveElements(VElement v, KElement beforeChild) Deprecated.use moveArraymoves this to a position before another child, fails if either this or beforechild are document rootsvoidintnumChildElements(String node, String nameSpaceURI) Get the number of child elements.intnumChildElements_KElement(String node, String nameSpaceURI) Get the number of child elements.intnumChildNodes(int nodeType) Deprecated.use 2-parameter version numChildNodes(nodeType, false);intnumChildNodes(int nodeType, boolean bRecurse) count the number of child nodes of DOM nodeType nodeType (0=count all)intnumChildrenByClass(Class<?> clazz, boolean bRecurse) Get the number of child elements of a certain classintnumSiblingElements(String elementName, String nameSpaceURI) get the number of sibling elementsstatic KElementstatic KElementstatic KElementstatic KElementparseString(String string) Moves 'this' from parent to grandparent or to the closest ancestor with name newParentNamevoidremoves all text children of the current nodevoidremoveAttribute(String attrib) voidremoveAttribute(String attrib, String nameSpaceURI) Remove an attribute from the current elementvoidremoveAttribute_KElement(String attrib, String nameSpaceURI) Remove a attribute from the current elementremoveAttributeNode(Attr arg0) voidremoveAttributeNS(String nameSpaceURI, String attrib) voidremoveAttributes(Collection<String> attribs) Removes all attributes spezified in attribs.voidremoveCData(int i) Removes the i'th XML CData sectionremoveChild(String node, String nameSpaceURI, int n) Removes the n'th child node that matches 'nodeName' and 'nameSpaceURI'removeChild(Node arg0) booleanremoveChildNode(int nodeType, int i) removes the i'th child node, that match NodeTypevoidremoveChildren(String nodeName, String nameSpaceURI) Remove children that matchnodeNameandnameSpaceURIvoidremoveChildren(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib) Removes the children namednodeNamein the namespacenameSpaceURIfrom the parent elementvoidremoveChildrenByClass(Class<? extends Node> clazz) voidremoveChildText(int i) Removes the i'th text node of 'this'voidremoveExtensions(String nsURI) remove all elements and attributes of a given namespaceintremoveFromAttribute(String key, String token, String nameSpaceURI, String sep, int nMax) Removes the attribute value from its value list
Removes the contents of value from the existing attribute key.voidremoveIgnoreCase(String key) voidvoidremoveXMLComment(int i) removes the i'th XMLComment nodevoidremoveXPathAttribute(String path) remove an attribute or text that is described by the xpath path quietly returns if the attribute or text does not existvoidremoveXPathElement(String path) remove an attribute or element that is described by the xpath path quietly returns if the element does not existvoidrenameAttribute(String oldName, String newName) Rename an attribute in this namespace
if oldName does not exist, newName is NOT modifiedvoidrenameAttribute(String oldName, String newName, String nameSpaceURI, String newNameSpaceURI) Rename an attribute in this namespace
if oldName does not exist, newName is NOT modifiedrenameElement(String newName, String nameSpaceURI) Rename the element with the String newName.replaceChild(Node arg0, Node arg1) replaceElement(KElement src) Replaces 'this' with src.voidsetAttribute(String key, boolean b, String nameSpaceURI) SetAttribute - Sets an element attributevoidsetAttribute(String key, double value, String nameSpaceURI) Sets an element attributevoidsetAttribute(String key, double value, String nameSpaceURI, int precision) Sets an element attributevoidsetAttribute(String key, int value, String nameSpaceURI) Sets an element attributevoidsetAttribute(String key, long value, String nameSpaceURI) Sets an element attributevoidsetAttribute(String key, Enum<?> value, String ns) no namespace variantvoidsetAttribute(String key, String value) no namespace variantvoidsetAttribute(String key, String value, String nameSpaceURI) Mother of all Attribute setters
Sets a new attribute.voidsetAttribute(String key, List<String> value, String nameSpaceURI) Sets an NMTOKENS attribute to all elements from parameter value will be concatenate with blanks to the resulting NMTOKENvoidsetAttribute(String key, org.apache.commons.lang.enums.ValuedEnum value, String nameSpaceURI) Sets an element attributevoidsetAttribute(String key, VString value, String nameSpaceURI) Sets an NMTOKENS attribute to all elements from parameter value will be concatenate with blanks to the resulting NMTOKENvoidsetAttribute(String key, JDFNumList value, int precision) voidsetAttribute(String key, JDFDate value, String nameSpaceURI) setAttributeNode(Attr arg0) setAttributeNodeNS(Attr arg0) voidsetAttributeNS(String nsURI, String arg1, String arg2) voidsetAttributeNSRaw(String ns, String key, String value) fastest setAttribute with namespace- use only if you know exactly what you are doingvoidsetAttributeRaw(String key, String value) fastest setAttribute - use only if you know exactly what you are doingvoidsetAttributes(String[] myAttributes, String[] strValues) Deprecated.use setAttributes(JDFAttributeMap)intsetAttributes(KElement kElem) Sets the attributes from the curent element to the attributes from kElem.intsetAttributes(KElement kElem, VString ignoreList) Sets the attributes from the curent element to the attributes from kElem.intSets the attributes from the curent element.voidsetAttributesRaw(KElement kElem) Sets the attributes from the current element to the attributes from kElem.voidsetBoolAttribute(String key, boolean b, String nameSpaceURI) Deprecated.use setAttribute insteadvoidsetDirty()Set this element as dirtyvoidsetDirty(boolean bAttribute) Set this element as dirtyvoidgets attribute IDvoidsetIntAttribute(String key, int value, String nameSpaceURI) Deprecated.use setAttribute insteadstatic voidsetLongID(boolean bLong) set the ID generation algorithm to include a datevoidsetNamespaceURI(String arg0) voidsetNodeValue(String arg0) voidsetNonEmpty(String key, String val) convenience setter same as setAttribute but never sets ""voidvoidsetRealAttribute(String key, double value, String nameSpaceURI) Deprecated.use setAttribute insteadvoidSets an XML Text
the text contents of this to the value of textvoidsetvStringAttribute(String key, VString value, String nameSpaceURI) Deprecated.use setAttribute insteadvoidsetXMLComment(String commentText) set a DOM comment<!-- XMLComment -->in front ofthisif an xml Comment node already exists directly in front ofthis, the previous comment is removed The double minus sign '--' is escaped with an underscore '_' in order to ensure valid xmlvoidsetXMLComment(String commentText, boolean single) set a DOM comment<!-- XMLComment -->in front ofthisif an xml Comment node already exists directly in front ofthis, the previous comment is removed The double minus sign '--' is escaped with an underscore '_' in order to ensure valid xmlvoidsetXPathAttribute(String path, String value) Sets an attribute as defined by XPath to valuevoidsetXPathValue(String path, String value) Sets an attribute as defined by XPath to valuevoidsets all xpaths to the values provided in mapvoidsetXSIType(String typ) voidsorts/inserts e by alphabetvoidsortChild(KElement e, Comparator<KElement> comparator) insert e into this, assuming that this is already sortedvoidsorts all child elements by alphabetvoidsortChildren(boolean bRecursive) sorts all child elements by alphabetvoidsortChildren(Comparator<KElement> comparator) sorts all child elements by alphabetvoidsortChildren(Comparator<KElement> comparator, boolean bRecursive) sorts all child elements by alphabettoDisplayXML(int indent) serialize this to a stringtoString()this to string, used for debug purpose mostlytoValueString(char sep) get a concatinated string of all valuestoXML()serialize this to a stringtoXML(int indent) serialize this to a stringstatic StringuniqueID(int id) UniqueID - create a unique id based on date and time + a counter - 6 digits are taken from id Normally this should only be used internally, @see JDFElement.appendAnchor() for details.static StringuniqueID(int id, boolean bDate) booleanwrite2File(File file) write myself to a filebooleanwrite2File(String filename) write myself to a filebooleanwrite2Stream(OutputStream stream) write myself to an output streamvoidwriteStream(OutputStream stream) write myself to a streamstatic StringDeprecated.use xmlnsPrefix()static StringxmlnsLocalName(String pc) used by get localnamestatic StringxmlnsPrefix(String nodeName) Parses pc for it's namespace prefixMethods inherited from class org.apache.xerces.dom.ElementNSImpl
getLocalName, getPrefix, getTypeName, getTypeNamespace, getXMLBaseAttribute, isDerivedFrom, setTypeMethods inherited from class org.apache.xerces.dom.ElementImpl
cloneNode, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getBaseURI, getChildElementCount, getDefaultAttributes, getElementsByTagName, getElementsByTagNameNS, getFirstElementChild, getLastElementChild, getNextElementSibling, getNodeName, getNodeType, getPreviousElementSibling, getSchemaTypeInfo, getTagName, getXercesAttribute, hasAttributeNS, isEqualNode, reconcileDefaultAttributes, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setOwnerDocument, setReadOnly, setupDefaultAttributes, setXercesAttributeNode, synchronizeDataMethods inherited from class org.apache.xerces.dom.ParentNode
getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getOwnerDocument, getTextContent, hasChildNodes, item, setTextContent, synchronizeChildrenMethods inherited from class org.apache.xerces.dom.ChildNode
getNextSibling, getParentNode, getPreviousSiblingMethods inherited from class org.apache.xerces.dom.NodeImpl
addEventListener, changed, changes, compareDocumentPosition, compareTreePosition, dispatchEvent, getContainer, getFeature, getNodeNumber, getNodeValue, getReadOnly, getUserData, getUserData, getUserDataRecord, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, removeEventListener, setUserData, setUserDataMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.w3c.dom.Element
getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNSMethods inherited from interface org.w3c.dom.Node
cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasChildNodes, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, setTextContent, setUserData
-
Constructor Details
-
KElement
Constructor for KElement- Parameters:
myOwnerDocument- the owner document of the new elementqualifiedName- the qualified name of the element
-
KElement
public KElement(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument, String myNamespaceURI, String qualifiedName) Constructor for KElement- Parameters:
myOwnerDocument- the owner document of the new elementmyNamespaceURI- the namespace of the new elementqualifiedName- the qualified name of the element
-
KElement
public KElement(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument, String myNamespaceURI, String qualifiedName, String myLocalName) Constructor for KElement- Parameters:
myOwnerDocument- the owner document of the new elementmyNamespaceURI- the namespace of the new elementqualifiedName- the qualified name of the elementmyLocalName- the localname of the element
-
-
Method Details
-
isDirty
public boolean isDirty()Get the dirty status of this element- Returns:
- boolean true if dirty
-
setDirty
public void setDirty()Set this element as dirty -
setDirty
public void setDirty(boolean bAttribute) Set this element as dirty- Parameters:
bAttribute- if true, only attributes are dirty, else also sub-elements
-
getOwnerDocument_KElement
Get the document object that owns this- Returns:
- XMLDoc the owner document of this
-
getInheritedAttribute
searches for the first attribute occurrence in this element or any ancestors- Parameters:
attrib- the attribute namenameSpaceURI- the XML-namespacedef- the default if it does not exist- Returns:
- String value of attribute found, value of def if not available
-
getAttribute
mother of all attribute getters. Get a attribute out of this element- Parameters:
attrib- the name of the attribute you want to havenameSpaceURI- namespace of keydef- the value that is returned if attrib does not exist in this or this is null- Returns:
- String the attribute value as a string, or def if that attribute does not have a specified or default value
-
getAttribute_KElement
Because getAttribute is overwritten in various classes this method can be called directly to get only KElement Attribute.- Parameters:
attrib- the name of the attribute you want to havenameSpaceURI- namespace of keydef- the value that is returned if attrib does not exist in this - may be null- Returns:
- String the attribute value as a string, or def if attribute was not found
-
getAttribute
Mother of all attribute getters
Gets an attribute value out of an element- Specified by:
getAttributein interfaceElement- Overrides:
getAttributein classorg.apache.xerces.dom.ElementImpl- Parameters:
strLocalName- the name of the attribute you want to have- Returns:
- String the value of the Attribute or emptystring
-
ensureCase
ensure the correct case of n attribute, if present- Parameters:
key-- Returns:
-
removeIgnoreCase
-
removeIgnoreCase_KElement
-
getIgnoreCase
similar to getAttribute but returns null for all empty strings Gets an attribute value out of an element- Parameters:
strLocalName- the name of the attribute you want to have- Returns:
- String the value of the Attribute or null
-
getIgnoreCase_KElement
similar to getAttribute but returns null for all empty strings Gets an attribute value out of an element- Parameters:
strLocalName- the name of the attribute you want to have- Returns:
- String the value of the Attribute or null
-
getNonEmpty
similar to getAttribute but returns null for all empty strings Gets an attribute value out of an element- Parameters:
strLocalName- the name of the attribute you want to have- Returns:
- String the value of the Attribute or null
-
getNonEmpty_KElement
similar to getAttribute but returns null for all empty strings Gets an attribute value out of an element- Parameters:
strLocalName- the name of the attribute you want to have- Returns:
- String the value of the Attribute or null
-
hasNonEmpty
similar to hasAttribute but returns false for all empty strings Gets an attribute value out of an element- Parameters:
strLocalName- the name of the attribute you want to have- Returns:
- String the value of the Attribute or emptystring
-
hasNonEmpty_KElement
similar to hasAttribute but returns false for all empty strings Gets an attribute value out of an element- Parameters:
strLocalName- the name of the attribute you want to have- Returns:
- String the value of the Attribute or emptystring
-
getAttributeRaw
getAttribute with no pardon for namespaces or anything- Parameters:
qualifiedName- the name of the attribute you want to have- Returns:
- String the value of the Attribute or emptystring
-
getAttribute_KElement
Mother of all attribute getters
Gets an attribute value out of an element- Parameters:
strLocalName- the name of the attribute you want to have- Returns:
- String the value of the Attribute or emptystring
-
getParentNode_KElement
get the parent node of this- Returns:
- KElement the parent node of the actual element
-
setvStringAttribute
Deprecated.use setAttribute insteadSets an NMTOKENS attribute to all elements from parameter value will be concatenate with blanks to the resulting NMTOKEN- Parameters:
key- the name of the attribute to setvalue- the values for the attribute keynameSpaceURI- the namespace of the key
-
setAttribute
Sets an NMTOKENS attribute to all elements from parameter value will be concatenate with blanks to the resulting NMTOKEN- Parameters:
key- the name of the attribute to setvalue- the values for the attribute keynameSpaceURI- the namespace of the key
-
setAttribute
Sets an NMTOKENS attribute to all elements from parameter value will be concatenate with blanks to the resulting NMTOKEN- Parameters:
key- the name of the attribute to setvalue- the values for the attribute keynameSpaceURI- the namespace of the key
-
setAttribute
- Parameters:
key-value-nameSpaceURI-
-
setAttribute
- Parameters:
key-value-nameSpaceURI-
-
getDOMAttr
Get The DOM Attribute node of a given attribute if attrib has no namespace prefix and nameSpaceURI is a wildcard the attribute with the element prefix will be returned if no empty attribute exists e.g. getDOMAttr("a") will return the node x:a in <x:e x:a="b"/>- Parameters:
attrib- the attribute NamenameSpaceURI- then namespaceURI, defaults to the local namespacebInherit- search in parent elements as well- Returns:
- Node the DOMAttr node of the matching attribute
-
setAttribute
Mother of all Attribute setters
Sets a new attribute. If an attribute with that name is already present in the element, its value is changed to be that of the value parameter. This value is a simple string; it is not parsed as it is being set. So any markup (such as syntax to be recognized as an entity reference) is treated as literal text, and needs to be appropriately escaped by the implementation when it is written out. In order to assign an attribute value that contains entity references, the user must create an Attr node plus any Text and EntityReference nodes, build the appropriate subtree, and use setAttributeNode to assign it as the value of an attribute. To set an attribute with a qualified name and namespace URI, use the setAttributeNS method.- Parameters:
key- the qualified name of the attribute to create or alter.value- the value to set in string form. If null, the attribute is removednameSpaceURI- the namespace the element is in- Throws:
JDFException- if no settings of its attributes are possible
-
setAttribute
no namespace variant- Specified by:
setAttributein interfaceElement- Overrides:
setAttributein classorg.apache.xerces.dom.ElementImpl- Parameters:
key- name of the attribute to setvalue- value of the attribute
-
setAttribute
no namespace variant- Parameters:
key- name of the attribute to setvalue- value of the attribute
-
getAttribute
no namespace variant- Parameters:
key- name of the attribute to setvalue- value of the attribute
-
setAttributeRaw
fastest setAttribute - use only if you know exactly what you are doing- Parameters:
key- name of the attribute to setvalue- value of the attribute
-
setAttributeNSRaw
fastest setAttribute with namespace- use only if you know exactly what you are doing- Parameters:
ns- the namespace urikey- name of the attribute to setvalue- value of the attribute
-
setIntAttribute
Deprecated.use setAttribute insteadSets an element attribute- Parameters:
key- the name of the attribute to setvalue- the value for the attributenameSpaceURI- the namespace the element is in
-
setAttribute
Sets an element attribute- Parameters:
key- the name of the attribute to setvalue- the value for the attributenameSpaceURI- the namespace the element is in
-
setAttribute
public void setAttribute(String key, org.apache.commons.lang.enums.ValuedEnum value, String nameSpaceURI) Sets an element attribute- Parameters:
key- the name of the attribute to setvalue- the value for the attributenameSpaceURI- the namespace the element is in
-
setAttribute
Sets an element attribute- Parameters:
key- the name of the attribute to setvalue- the long value for the attributenameSpaceURI- the namespace the element is in
-
setRealAttribute
Deprecated.use setAttribute insteadSets an element attribute- Parameters:
key- the name of the attribute to setvalue- the value for the attributenameSpaceURI- the namespace the element is in
-
setAttribute
Sets an element attribute- Parameters:
key- the name of the attribute to setvalue- the value for the attributenameSpaceURI- the namespace the element is in
-
setAttribute
Sets an element attribute- Parameters:
key- the name of the attribute to setvalue- the value for the attributenameSpaceURI- the namespace the element is inprecision-
-
setBoolAttribute
Deprecated.use setAttribute insteadSetAttribute - Sets an element attribute- Parameters:
key- the name of the attribute to setb- value of the boolean attribute to be set (true or false)nameSpaceURI- the nameSpace the attribute is in
-
setAttribute
SetAttribute - Sets an element attribute- Parameters:
key- the name of the attribute to setb- value of the boolean attribute to be set (true or false)nameSpaceURI- the nameSpace the attribute is in
-
addAttribute
increments or decrements a numeric attribute by inc- Parameters:
key- the name of the attribute to setinc- the value to increment or decrement bynameSpaceURI- the nameSpace the attribute is in- Returns:
- double the attribute value after modification
-
addAttribute
increments or decrements a numeric attribute by inc- Parameters:
key- the name of the attribute to setinc- the value to increment or decrement bynameSpaceURI- the nameSpace the attribute is in- Returns:
- double the attribute value after modification
-
removeAttribute
Remove an attribute from the current element- Parameters:
attrib- attribute name to removenameSpaceURI- the nameSpace of the attribut
-
removeAttribute_KElement
Remove a attribute from the current element- Parameters:
attrib- attribute name to removenameSpaceURI- the nameSpace of the attribut
-
hasAttribute
Checks if the actual element has a specific attribute
this version checks only the explicit element and NOT any inherited resource partiotions Attention! this behavior differs from that of @see getAttribute()- Specified by:
hasAttributein interfaceElement- Overrides:
hasAttributein classorg.apache.xerces.dom.ElementImpl- Parameters:
attrib- the name of the attribute to look for- Returns:
- boolean true, if the attribute is present
-
hasAttribute
Checks if the actual element has a specific attribute
this version checks within the exact xml element- Parameters:
attrib- the name of the attribute to look fornameSpaceURI- the nameSpace to look inbInherit- if true also check recursively in parent elements- Returns:
- boolean true if the attribute is present
-
hasAttribute_KElement
Checks if the actual element has a specific attribute
this version checks within the exact xml element- Parameters:
attrib- the name of the attribute to look fornameSpaceURI- the nameSpace to look inbInherit- if true also check recursively in parent elements- Returns:
- boolean true if the attribute is present
-
appendAttribute
convenience- Parameters:
key- attribute keyvalue- string to be appended
-
appendAttribute
public String appendAttribute(String key, String value, String nameSpaceURI, String sep, boolean bUnique) Append the contents of value to the existing attribute key. Create Key, if it does not exist- Parameters:
key- attribute keyvalue- string to be appendednameSpaceURI- namespace of keysep- separator between the original attribute value and value, defaults to " " if nullbUnique- if true, the attribute will only be appended if it is not yet within the current attribute value appendAttribute("key","next",JDFCoreConstants.EMPTYSTRING,JDFCoreConstants .COMMA) applied toresults in - Returns:
- the updated value; null if none exists
-
appendAttributes
public void appendAttributes(String key, List<String> value, String nameSpaceURI, String sep, boolean bUnique) Append the contents of value to the existing attribute key. Create Key, if it does not exist- Parameters:
key- attribute keyvalue- string to be appendednameSpaceURI- namespace of keysep- separator between the original attribute value and value, defaults to " " if nullbUnique- if true, the attribute will only be appended if it is not yet within the current attribute value appendAttribute("key","next",JDFCoreConstants.EMPTYSTRING,JDFCoreConstants .COMMA) applied toresults in
-
isWildCard
Tests whether an argument is a wildcard i.e null, empty or * note that Wildcard ("*") is deprecated ideally null should be used to denote a wildcard- Parameters:
nodeName- the argument to test- Returns:
- boolean true if the name is wildcard
-
isEqual
null safe test whether the elements e1 and e2 are equal- Parameters:
e1-e2-- See Also:
-
fitsName
Tests whether the specified nodename and namespace fits the nodename and namespace of 'this'- Parameters:
nodeName- the name of the node to test. May be either local or qualifiednameSpaceURI- the namespace of the node to test.- Returns:
- boolean true if fits
-
fitsName_KElement
-
getNamespaceURIFromPrefix
Gets the NameSpaceURI corresponding to a given prefix, returns null if no namespace is defined- Parameters:
prefix- the prefix to check for- Returns:
- String The nameSpaceURI that maps to prefix
-
getNamespaceURI
Get the NameSpaceURI- Specified by:
getNamespaceURIin interfaceNode- Overrides:
getNamespaceURIin classorg.apache.xerces.dom.ElementNSImpl- Returns:
- String The nameSpaceURI
-
xmlnsPrefix
Parses pc for it's namespace prefix- Parameters:
nodeName- string to parse- Returns:
- String namespace prefix of element - null if no ":" is in nodeName or nodeName starts with ":"
-
getLocalNameStatic
Deprecated.use getLocalNameGets the local name of kElem- Parameters:
kElem- the element to get the LocalName from- Returns:
- String the local name of 'this'
-
setAttributes
Sets the attributes from the curent element. If Attributes map is null or empty, zero is returned. otherwhise the size of the map is returned- Parameters:
map- map of attributes to set- Returns:
- int size of the map or zero if empty
-
setAttributes
Sets the attributes from the curent element to the attributes from kElem. If the Attributes map from kElem is empty (kElem has no attributes), zero is returned. Otherwhise the size of the map (number of attributes from kElem) is returned.- Parameters:
kElem- the attribute source- Returns:
- int number of elements from kElem
-
setAttributesRaw
Sets the attributes from the current element to the attributes from kElem. If the Attributes map from kElem is empty (kElem has no attributes), zero is returned. Otherwise the size of the map (number of attributes from kElem) is returned.- Parameters:
kElem- the attribute source
-
setAttributes
Sets the attributes from the curent element to the attributes from kElem. If the Attributes map from kElem is empty (kElem has no attributes), zero is returned. Otherwhise the size of the map (number of attributes from kElem) is returned.- Parameters:
kElem- the attribute sourceignoreList-- Returns:
- int number of elements from kElem
-
getAttributeMap
Get the Attribute Map of the actual element- Returns:
- JDFAttributeMap the attribute map of the actual element - never null
-
getAttributeMap_KElement
Get the Attribute Map of the actual element- Returns:
- JDFAttributeMap the attribute map of the actual element
-
init
public boolean init()Method init. Superclass of all inits- Returns:
- boolean true always
-
appendElement
- Parameters:
elementName- the elementname with namespace prefix "xyz:abc"nameSpaceURI- the namespace of the element "null" is valid if the namespace was specified already above. The method will lookup the namespace for you. Performance wise its better to add it nevertheless.- Returns:
- KElement the appended element or null
- Throws:
JDFException- if you tried to append an element into an unspecified namespace
-
appendElementRaw
appends an element without any namespace validity checks or initialization Faster but not sa safe...- Parameters:
elementName- element namenameSpaceURI- element namespace- Returns:
- the newly created element
- Since:
- 090216
-
appendElement
append a DOM element. This function creates a new element in the given namespace and appends it there.- Parameters:
elementName- the name of the element to append- Returns:
- KElement the appended element
-
copyElements
append all children in a vector of elements in the order of the vector- Parameters:
v- the vector of elements to append, if null nothing happensbeforeChild- the child before which to append the elements of the vector
-
deleteNode
Deletes itself from its parent- Returns:
- KElement - the deleted element, null if this has no parent node
-
getChildElementArray
gets an array of the direct children of the current element- Returns:
- KElement[] the array of direct children
-
getChildList
never null list of all kids- Returns:
-
getChildElementVector
@Deprecated public VElement getChildElementVector(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bAnd, int maxSize) Deprecated.060302 - use 6 parameter versionGet all children from the actual element matching the given conditions
does NOT get refElement targets although the attributes are checked in the target elements in case of refElements- Parameters:
nodeName- element name you are searching fornameSpaceURI- nameSpace you are searching formAttrib- attributes you are lokking forbAnd- if true, a child is only added if it has all attributes specified in Attributes mAttribmaxSize- maximum size of the element vector- Returns:
- VElement vector with all found elements
-
getChildElementVector
public VElement getChildElementVector(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bAnd, int maxSize, boolean bResolveTarget) Get all children from the actual element matching the given conditions
does NOT get refElement targets although the attributes are checked in the target elements in case of refElements- Parameters:
nodeName- element name you are searching fornameSpaceURI- nameSpace you are searching formAttrib- attributes you are lokking forbAnd- if true, a child is only added if it has all attributes specified in Attributes mAttribmaxSize- maximum size of the element vector (0=any)bResolveTarget- if true, IDRef elements are followed, dummy at this level but needed in JDFElement- Returns:
- VElement vector with all found elements, an empty vector if no elements match
-
getChildElementVector
Get all children from the actual element matching the given conditions
convenience for getChildElementVector(nodeName, nameSpaceURI, null, true, 0, true)- Parameters:
nodeName- element name you are searching fornameSpaceURI- nameSpace you are searching for- Returns:
- VElement vector with all found elements, an empty vector if no elements match
-
getChildList
Get all children from the actual element matching the given conditions
convenience for getChildElementVector(nodeName, nameSpaceURI, null, true, 0, true)- Parameters:
nodeName- element name you are searching fornameSpaceURI- nameSpace you are searching for- Returns:
- VElement vector with all found elements, an empty vector if no elements match
-
getChildArray
Get all children from the actual element matching the given conditions
convenience for getChildElementVector(nodeName, nameSpaceURI, null, true, 0, true)- Parameters:
nodeName- element name you are searching fornameSpaceURI- nameSpace you are searching for- Returns:
- VElement vector with all found elements, an empty vector if no elements match
-
getChildElementVector_KElement
public VElement getChildElementVector_KElement(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bAnd, int maxSize) Get all children from the actual element matching the given conditions
does NOT get refElement targets although the attributes are checked in the target elements in case of refElements- Parameters:
nodeName- element name you are searching fornameSpaceURI- nameSpace you are searching formAttrib- attributes you are lokking forbAnd- if true, a child is only added if it has all attributes specified in Attributes mAttribmaxSize- maximum size of the element vector- Returns:
- VElement vector with all found elements, an empty vector if no elements match
- See Also:
-
getChildArray_KElement
public List<KElement> getChildArray_KElement(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bAnd, int maxSize) Get all children from the actual element matching the given conditions
does NOT get refElement targets although the attributes are checked in the target elements in case of refElements- Parameters:
nodeName- element name you are searching fornameSpaceURI- nameSpace you are searching formAttrib- attributes you are lokking forbAnd- if true, a child is only added if it has all attributes specified in Attributes mAttribmaxSize- maximum size of the element vector- Returns:
- VElement vector with all found elements, an empty List if no elements match
- See Also:
-
removeChildrenByClass
- Parameters:
clazz- the class of the children to zapp
-
getChildrenByClass
@Deprecated public <A extends KElement> Vector<A> getChildrenByClass(Class<A> clazz, boolean bRecurse, int nMax) Deprecated.use getChildArrayByClass- Parameters:
clazz-bRecurse-nMax-- Returns:
-
getChildArrayByClass
public <A extends KElement> List<A> getChildArrayByClass(Class<A> clazz, boolean bRecurse, int nMax) Get all children from the actual element matching the given conditions
does NOT get refElement targets although the attributes are checked in the target elements in case of refElements never null- Type Parameters:
A-- Parameters:
clazz-bRecurse- if true recurse through all children, grandchildren etc.nMax- maximum number to search - if 0 or negative, search all- Returns:
- Vector vector with all found elements, never null
- See Also:
-
getChildArrayByClass_KElement
public <A extends KElement> List<A> getChildArrayByClass_KElement(Class<A> clazz, boolean bRecurse, int nMax) Get all children from the actual element matching the given conditions
does NOT get refElement targets although the attributes are checked in the target elements in case of refElements never null- Type Parameters:
A-- Parameters:
clazz-bRecurse- if true recurse through all children, grandchildren etc.nMax- maximum number to search - if 0 or negative, search all- Returns:
- Vector vector with all found elements, never null
- See Also:
-
getChildWithAttribute
-
getChildWithAttribute
-
getFirstChildElement
get the first child element- Returns:
- KElement the first child element of type ELEMENT_NODE if existing otherwise null
-
getNextSiblingElement
get the next sibling element- Returns:
- KElement the next sibling element is existing otherwise null
-
getPreviousSiblingElement
get the previous sibling element- Returns:
- KElement the previous sibling element is existing otherwise null
-
getNextSiblingElement
Gets the previous sibling named nodename from the namespace nameSpaceURI of 'this'.- Type Parameters:
a-- Parameters:
clazz- the class of the sibling- Returns:
- KElement the next sibling element of 'this', null if none is found
-
getFirstChildElement
Gets the previous sibling named nodename from the namespace nameSpaceURI of 'this'.- Type Parameters:
a-- Parameters:
clazz- the class of the sibling- Returns:
- KElement the next sibling element of 'this', null if none is found
-
getNextSiblingElement
Gets the previous sibling named nodename from the namespace nameSpaceURI of 'this'.- Parameters:
nodeName- the name of the siblingnameSpaceURI- the namespace of the sibling- Returns:
- KElement the next sibling element of 'this', null if none is found
-
getFirstChildElement
Gets the previous sibling named nodename from the namespace nameSpaceURI of 'this'.- Parameters:
nodeName- the name of the siblingnameSpaceURI- the namespace of the sibling- Returns:
- KElement the next sibling element of 'this', null if none is found
-
getPreviousSiblingElement
Gets the previous sibling named nodename from the namespace nameSpaceURI of 'this'.- Parameters:
nodeName- the name of the siblingnameSpaceURI- the namespace of the sibling- Returns:
- KElement the previous sibling element of 'this', null if none is found
-
includesAttributes
Checks if the actual element contains the attributes given in aMap- Parameters:
aMap- the attribute names to checkbAnd- true if you want to make sure all given attributes in aMap are present. False if it is enough if only one attribute in aMap is present- Returns:
- boolean: true if present
-
includesAttribute
Check if an attribute is present. If attValue is '*', "" or null it is checked if the element attName is present. Only for simple attributes where an exact .equals match is appropriate, for ranges and rangelists use JDFElement.includesMatchingAttributes()- Parameters:
attName- the name of the attributeattValue- the value of the attribute- Returns:
- boolean true if present
-
getChildrenByTagName
convenience helper- Parameters:
elementName-- Returns:
-
getChildrenByTagName
public VElement getChildrenByTagName(String elementName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bDirect, boolean bAnd, int maxSize) Gets children of 'this' by tag name, nameSpaceURI and attribute map, if the attribute map is not empty.
Searches the entire tree including hidden nodes that are children of non-matching nodes- Parameters:
elementName- elementname you are searching fornameSpaceURI- nameSpace you are searching formAttrib- map of attributes you are looking for
Wildcards in the attribute map are supportedbDirect- if true, return value is a vector only of all direct child elements.
Otherwise the returned vector contains nodes of arbitrary depthbAnd- if true, a child is only added, if it includes all attributes, specified in mAttribmaxSize- maximum size of the element vector. maxSize is ignored if bDirect is false- Returns:
- VElement: vector with all found elements
- See Also:
-
getChildrenByTagName_KElement
public VElement getChildrenByTagName_KElement(String elementName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bDirect, boolean bAnd, int maxSize) Gets children of 'this' by tag name, nameSpaceURI and attribute map, if the attribute map is not empty.
Searches the entire tree including hidden nodes that are children of non-matching nodes- Parameters:
elementName- elementname you are searching fornameSpaceURI- nameSpace you are searching formAttrib- map of attributes you are looking for
Wildcards in the attribute map are supportedbDirect- if true, return value is a vector only of all direct child elements.
Otherwise the returned vector contains nodes of arbitrary depthbAnd- if true, a child is only added, if it includes all attributes, specified in mAttribmaxSize- maximum size of the element vector. maxSize is ignored if bDirect is false- Returns:
- VElement: vector with all found elements
- See Also:
-
getElementsByTagName_KElement
wrappers of DOM routines that dont bang on null nodes- Parameters:
s- the local name of the elements to match onnameSpaceURI- the namespace URI of the elements to match on- Returns:
- VElement a new NodeList object containing all the matched Elements
-
getChildrenWithAttribute
@Deprecated public VElement getChildrenWithAttribute(String nodeName, String attName, String nameSpaceURI, String attVal, boolean bDirect) Deprecated.use getChildrenByTagName(nodeName, nameSpaceURI, new JDFAttributeMap(attName, attVal), bDirect, true, 0);Get a vector of all children with a matching attribte- Parameters:
nodeName- elementname you are searching forattName- attributes you are looking fornameSpaceURI- nameSpace you are searching forattVal- value of the attribute you are searching forbDirect- if true : return only direct children if false : search recursively- Returns:
- VElement - vector with all found elements
-
getCreateElement
Get the actual element, create if not there- Parameters:
nodeName- name of the node from the element- Returns:
- KElement the requested element
-
getMultipleIDs
Get a vector of all IDs that occur multiple times- Parameters:
attName- name of the attribute to test for- Returns:
- VString the list of multiply occurring ID values, null if all is well
-
getCreateElement
Get the actual element, create if not there- Parameters:
nodeName- name of the node from the elementnameSpaceURI- the name of the namespaceURIiSkip- which one you want- Returns:
- KElement the requested element
-
getCreateElement_KElement
Gets the iSkip-th child node with matching nodeName and nameSpaceURI, optionally creates it if it doesn't exist.
If iSkip is more than one larger that the number of elements only one is appended- Parameters:
nodeName- name of the child node to getnameSpaceURI- namespace to search foriSkip- number of matching child nodes to skip- Returns:
- KElement the matching child element
-
getElement
Get the actual element - utility routine.- Parameters:
nodeName- Name of the node- Returns:
- KElement - the child node
-
getElement
Gets an existing iSkip-th child node with matching nodeName and nameSpaceURI- Parameters:
nodeName- name of the child node to getnameSpaceURI- namespace to search foriSkip- number of matching child nodes to skip- Returns:
- KElement the matching child element
-
getElementHashMap
public HashMap<String,KElement> getElementHashMap(String elementName, String elementNS, String attName) performance enhanced function to access multiple elements e.g. by ID get a HashMap of key= attribute value, object=element- Parameters:
elementName- the names of the elements, wildcard if nullelementNS- the namespace URI of the elements, any if nullattName- the attribute name - MUST not be null- Returns:
- a hashmap of the matching elements
-
getElement_KElement
getElement - Get the actual element- Parameters:
nodeName- Name of the nodenameSpaceURI- Name of the namespaceURI to search iniSkip- number of element to get, if negative count backwards (-1 is the last)- Returns:
- KElement the child node
-
getElementByClass
getElement - Get the actual element by java class- Type Parameters:
A- the data type to return- Parameters:
clazz- java class of the requested elementiSkip- number of element to get, if negative count backwards (-1 is the last)bRecurse- if true recurse sub elements- Returns:
- KElement the child node
-
getDeepParent
Get the n'th Ancestor node with name parentNode- Parameters:
parentNode- name of the parent node to search fordepth- which one you want to have in order of appearance- Returns:
- KElement the n'th ancestor node with name nodeName
-
getDeepParent
Deprecated.- loop over the single node methodGet the ancestor which may have one of the node names defined in parentNode- Parameters:
vParentElement- vector with node names to search fordepth- which one you want to have (in order of appearance)- Returns:
- KElement the first ancestor node with name nodeName
-
getDocRoot
Gets the root element of the current document- Returns:
- KElement the root element of the current document
-
getAttributeVector
Gets all attribute keys of 'this' as a vector of strings- Returns:
- vWString: a vector of all attribute keys in 'this'
-
getAttributeVector_KElement
Gets all attribute keys of 'this' as a vector of strings- Returns:
- VString: a vector of all attribute keys in 'this'
-
getAttributeArray_KElement
Gets all attribute keys of 'this' as a vector of strings- Returns:
- VString: a vector of all attribute keys in 'this'
-
getAttributeIgnoreCase
Gets an atrribute if the local name- Returns:
- VString: a vector of all attribute keys in 'this'
-
getTarget
looking for a specified target with an id, e.g. resource.
Offers access to exactly KElements implementation of GetTarget even if called for an instance of one of it's subclasses.default: getTarget(id, JDFCoreConstants.ID)
- Parameters:
id- value of the ID tag to searchattrib- name of the ID tag, defaults to "ID"- Returns:
- KElement - the element if existing, otherwise
null
-
getTarget_KElement
Gets the target of link. Follows an ID-IDREF pair by recursively searching for an attrib with the value id- Parameters:
id- value of the ID tag to searchattrib- name of the ID tag, defaults to "ID"- Returns:
- KElement the target of link - the element node.
-
getElementNameVector
Returns a vector which contains the childs of the actual element. But every child only once.- Returns:
- Vector vector with the childs of the actual element. Ever child typ is only added once.
-
getFirstElementNode
Deprecated.use elem.getFirstChildElementget the first child element- Parameters:
parent- the node to get the first element node from- Returns:
- Element - the first child element if existing otherwise null
-
getNextElementNode
Deprecated.- use elem.getNextSiblingElement();get the next sibling element- Parameters:
elem- the Element to get the next element node from- Returns:
- Element the first sibling element if existing otherwise null
-
isEqual
Checks if the contents of this element are equal to element kElem
differs from @see equals because nodes that are in different locations or documents but have the same name, attributes and elements are considered equal- Parameters:
kElem- the element to compare- Returns:
- boolean true if equal
-
getChildNodes_KElement
Deprecated.use getChildElementVector(null, null, null, true, 0)Get all child nodes from the actual element- Returns:
- VElement list of all childs
-
isAncestor
checks if KElement child is ancestor or not- Parameters:
child- child to check- Returns:
- boolean true if anchestor
-
ancestorDistance
distance to ancestor (0=this)- Parameters:
child- child to check- Returns:
- int distance to ancestor, -1 if no direct descendant
-
numChildElements
Get the number of child elements. If String 'node' is an empty string or '*', all nodes are counted.default: numChildElements(null, null)
- Parameters:
node- the nodes with name 'node' to countnameSpaceURI- the nameSpace to look in- Returns:
- int the number of matching child elements
-
numChildrenByClass
Get the number of child elements of a certain class- Parameters:
clazz- the child classbRecurse- if true search the tree- Returns:
- int the number of matching child elements
-
numChildElements_KElement
Get the number of child elements. If String 'node' is null, an empty string or '*', all nodes are counted. This method is the same as numChildElements but prevents before the maybe unwanted virtuality of numChildElements.default: numChildElements_KElement(null, null)
- Parameters:
node- the nodes with name 'node' to countnameSpaceURI- the nameSpace to look in- Returns:
- int the number of matching child elements
-
removeChild
Removes the n'th child node that matches 'nodeName' and 'nameSpaceURI'- Parameters:
node- name of the child node to remove, if empty; or "*" removes the n'th elementnameSpaceURI- namespace to search inn- number of nodes to skip before deleting- Returns:
- KElement the removed element
-
getChildByTagName
public KElement getChildByTagName(String s, String nameSpaceURI, int index, JDFAttributeMap mAttrib, boolean bDirect, boolean bAnd) Get a child from the actual element by the tag name.default: getChildByTagName(s, null, 0, null, true, true)
- Parameters:
s- elementname you are searching fornameSpaceURI- nameSpace you are searching forindex- if more then one child match the condition you can specify which one you want to have via the indexmAttrib- attributes you are lokking forbDirect- if true return value is directly the elemement. Otherwise the return value is the node of the found element. Only direct child, not grandchild etc.bAnd- if true, a child is only returned if it has all attributes specified in mAttrib- Returns:
- KElement the found child (element or node), null if index < 0 or index < number of matching children
-
removeChildren
Remove children that matchnodeNameandnameSpaceURIdefault: removeChildren(nodeName, nameSpaceURI, null)
- Parameters:
nodeName- name of the child node to get, if empty or null remove allnameSpaceURI- namespace to search in
-
removeChildren
Removes the children namednodeNamein the namespacenameSpaceURIfrom the parent elementdefault: removeChildren(null,null,null)
- Parameters:
nodeName- name of the element typ to removenameSpaceURI- namespace in which the elements are to be removedmAttrib- map of attributes to match
-
removeFromAttribute
Removes the attribute value from its value list
Removes the contents of value from the existing attribute key. Deletes the attribute Key, if it has no value.
removeFromAttribute("key","next","",",", -1)applied toresults in- Parameters:
key- attribute keytoken- string to removenameSpaceURI- namespace of attribute keysep- separator between the valuesnMax- maximum number of value instances to remove (-1 = all)- Returns:
- int number of removed instances
-
flush
public boolean flush()Flush - remove all attributes, elements and text, leaving only a stub tag- Returns:
- boolean true always
-
getChildNodeVector
Deprecated.Get all or the spezified number of childs nodes from the actual element a maxSize of 0 spezifies all children.default: getChildNodeVector(0)
- Parameters:
maxSize-- Returns:
- Vector vector with all found nodes
-
removeAttributes
Removes all attributes spezified in attribs. If attribs is empty, all attributes are removed- Parameters:
attribs- list of attributes to remove, if null, remove all
-
eraseEmptyAttributes
public void eraseEmptyAttributes(boolean bRecurse) remove all empty attributes from this (e.g. att="")- Parameters:
bRecurse- if true, alse recurse subelements, else only local
-
getDeepElement
Deprecated.use getChildByTagName(nodeName, nameSpaceURI, iSkip, null, false, true);You can get the iSkip element named by nodeName. If there is no element present, a new empty element is returned. If iSkip is out of range, a new element is returned.default: getDeepElement(nodeName, null, 0)
- Parameters:
nodeName- the type of element you want to getnameSpaceURI- the namespace to search in !!! NOT USED IN FUCTION !!!iSkip- which element you want to have (order of appearance)- Returns:
- KElement the iSkip element or a new element
-
getChildFromList
Deprecated.use getChildFromList(Vector nodeNames, int iSkip, JDFAttributeMap map)- Parameters:
nodeNames-iSkip-- Returns:
- KElement
-
getChildFromList
public KElement getChildFromList(VString nodeNames, int iSkip, JDFAttributeMap map, boolean bDirect) Get any Child that matches a string defined in nodeNames. The method compares the strings with the element namedefault: getChildFromList(nodeNames, 0, null)
- Parameters:
nodeNames- container for the node name stringiSkip- how many of the found child should be skipedmap- map of attributes to matchbDirect-- Returns:
- KElement a child matching the condition
-
renameElement
Rename the element with the String newName. Attention. the Java class of the element does not get modified. It is up to the caller to ensure that no inconsistent types get created with renamedefault: renameElement(newName, null)
- Parameters:
newName- the new name of the actual elementnameSpaceURI- the new nameSpace, ignored if null- Returns:
- KElement the renamed child, i.e. this
-
removeExtensions
remove all elements and attributes of a given namespace- Parameters:
nsURI- the ns uri of the extensions to remove
-
moveMe
moves this to a position before another child, fails if either this or beforechild are document roots- Parameters:
beforeChild- the child to move before, if beforechild is a the document root, do nothing if null, move me to the end of my parent- Returns:
- this after moving, null if failure
-
moveElement
Moves src node (including all attributes and subelements) from its parent node into 'this' and inserts it in front of beforeChild, if it exists. Otherwise appends src to 'this'.
If src isnull, an empty KElement is returned.
src is removed from its parent node. if the actual document owner is the same as the document owner of src, src is appended to 'this' If the documents are different, then src is appended to 'this' in the actual document.default: moveElement(src, null)
- Parameters:
src- node to move.beforeChild- child of 'this' to insert src before. If beforeChild is null, src is appended to 'this'- Returns:
- KElement src element after moving, null if src is null
- Throws:
JDFException- if beforeChild is not a child of 'this'
-
clearTargets
protected void clearTargets() -
moveElements
Deprecated.use moveArray- Parameters:
v-beforeChild-
-
moveArray
move all children in a vector of elements in the order of the vector- Parameters:
v- the vector of elements to append, if null nothing happensbeforeChild- the child before which to append the elements of the vector
-
eraseEmptyNodes
public int eraseEmptyNodes(boolean bTrimWhite) Erases all empty text nodes in 'this' and its subelements If there any empty text nodes removes them. If bTrimWhite is true, then trims white spaces from both ends of a text node and only then, if it is empty, removes it- Parameters:
bTrimWhite- trims whitespace of text, default = true- Returns:
- int the number of removed nodes
-
copyElement
Copies src node (including all attributes and subelements) and inserts the copy into 'this' in front of beforeChild, if it exists. Otherwise appends src node to 'this'.default: copyElement(src, null)
- Parameters:
src- node to copy.beforeChild- child of 'this' to insert src before. If null, src is appended- Returns:
- KElement the copied element,
nullif src isnull.
-
copyInto
copies a node into this, ignoring identical node names i.e. duplicating elements- Parameters:
src-bRemove- if true, remove existing information, else retain and overwrite / merge- Returns:
- this
-
replaceElement
Replaces 'this' with src.
If the actual document is the same as the src document, 'this' is replaced by src.
If the actual document and the src document are different, src is positioned at the position of 'this' in the current document and removed from the old parent document.- Parameters:
src- node, that 'this' will be replaced with- Returns:
- KElement the replaced element. If src is null or equal 'this', src is returned.
- Since:
- 130103 ReplaceElement works on all elements including the document root
-
getLongAttribute
Get a long attribute if presentdefault: getLongAttribute(attrib, null, 0)
- Parameters:
attrib- attribute to parse for an integer attributenameSpaceURI- nameSpaceURI to search indef- the default to return if the value is empty or the attribute is not set- Returns:
- the parsed int. If the attribute was not found,
long defis returned.
-
getIntAttribute
Get a integer attribute if presentdefault: getIntAttribute(attrib, null, 0)
- Parameters:
attrib- attribute to parse for an integer attributenameSpaceURI- nameSpaceURI to search indef- the default to return if the value is not set or the attribute does not exists- Returns:
- int the parsed int. If the attribute was not found int def is returned
-
getBoolAttribute
get a boolean attributedefault: getBoolAttribute(attrib, null, false)
- Parameters:
attrib- attribute to parse for a boolean valuenameSpaceURI- nameSapceURI to search indef- the default to return if value is not set or the attribute does not exists- Returns:
- boolean the boolean value or the def parameter
-
getRealAttribute
get a double attributedefault: getRealAttribute(attrib, null, 0.0)
- Parameters:
attrib- attribute to parse for a boolean valuenameSpaceURI- nameSapceURI to search indef- default to return if none value is set or attribute does not exist- Returns:
- double the double value or
def
-
getDeepParentNotName
Get the Ancestor node with name other than thisNode- Parameters:
thisNode- serch string- Returns:
- KElement parent node element
-
getDeepParentChild
Get the first child of parentNode with name parentNode- Parameters:
parentNode- node name to search for- Returns:
- KElement the matching child of the parent element
-
appendXMLComment
Deprecated.use appendXMLComment(commentText, null);append a DOM comment<!-- XMLComment -->The double minus sign '--' is escaped with an underscore '_' in order to ensure valid xml- Parameters:
commentText- the comment to append
-
appendXMLComment
append a DOM comment<!-- XMLComment -->The double minus sign '--' is escaped with an underscore '_' in order to ensure valid xml- Parameters:
commentText- the comment to appendbeforeChild- the child of this that the Comment should be appended before. if null, append the Comment- Returns:
- the newly created xml comment
-
setXMLComment
set a DOM comment<!-- XMLComment -->in front ofthisif an xml Comment node already exists directly in front ofthis, the previous comment is removed The double minus sign '--' is escaped with an underscore '_' in order to ensure valid xml- Parameters:
commentText- the comment text to set Convenience - seesetXMLComment(String,boolean)
-
setXMLComment
set a DOM comment<!-- XMLComment -->in front ofthisif an xml Comment node already exists directly in front ofthis, the previous comment is removed The double minus sign '--' is escaped with an underscore '_' in order to ensure valid xml- Parameters:
commentText- the comment text to setsingle- TODO
-
appendCData
Appends XML CData section<![CDATA[ CData Section ]]>some character data
Appends a new CData section child node to the end of 'this '- Parameters:
cDataText- the text of the XML CData section to append
-
appendCData
Appends XML CData section<![CDATA[ CData Section ]]>some character data
Appends a new CData section child node to the end of 'this '- Parameters:
cDataElem- the element of the XML CData section to append
-
appendText
append some generic text- Parameters:
textName- the text to append
-
appendEntityReference
appends a entity reference to the actual element- Parameters:
refName- the name of the entity reference
-
appendTextElement
append a text element with text included- Parameters:
nodeName- node name of the text elementtext- the text to apend- Returns:
- KElement the appended text element
-
mergeElement
merge nodes in a way that no duplicate elements are created
attention !! this kills pools !! since elements in kElem overwrite those in *this- Parameters:
kElem- the node element to merge with the current nodebDelete- if true KElement kElem will be deleted- Returns:
- KElement the merged node element
-
getChildWithAttribute
public KElement getChildWithAttribute(String nodeName, String attName, String nameSpaceURI, String attVal, int index, boolean bDirect) GetChildWithAttribute - Get a child with matching attributesdefault: getChildWithAttribute(nodeName, attName, null,attValue, 0, true)
- Parameters:
nodeName- name of the child node to search forattName- attribute name to search fornameSpaceURI- namespace to search forattVal- the attribute value to search for, Wildcard supported (null)index- if more then one child meets the condition, you can specify the one to return via an indexbDirect- if true, looks only in direct children, else search through all children, grandchildren etc.- Returns:
- KElement the element which matches the above conditions
-
getCreateChildWithAttribute
public KElement getCreateChildWithAttribute(String nodeName, String attName, String nameSpaceURI, String attVal, int index) GetChildWithAttribute - Get a child with matching attributes; craete it if it does not existdefault: getChildWithAttribute(nodeName, attName, null,attValue, 0, true)
- Parameters:
nodeName- name of the child node to search forattName- attribute name to search fornameSpaceURI- namespace to search forattVal- the attribute value to search for, Wildcard supported (null)index- if more then one child meets the condition, you can specify the one to return via an index- Returns:
- KElement the element which matches the above conditions
-
hasChildElement
Checks whether the current element has a child element NodeNamedefault: hasChildElement(String nodeName, null)
- Parameters:
nodeName- name of the node to check fornameSpaceURI- nameSpaceURI to search in- Returns:
- boolean true if there is a child with nodeName, otherwise false
-
getInheritedElement
searches for the first child element occurence in this element or any ancestorsdefault: getInheritedElement(elementName, null, 0)
- Parameters:
elementName- name of the element to be searchednameSpaceURI- XML-namespaceiSkip- leading siblings to be skipped- Returns:
- JDFElement the element found
-
addNameSpace
Adds a NameSpace and maps the prefix to a URI.
Checks all parents, whether such namespace is already defined in an ancestor- Parameters:
strPrefix- the namespace prefix to setstrNameSpaceURI- the namespace URI to set- Returns:
- boolean true if newly set, false if already there and matching
-
sortChildren
public void sortChildren()sorts all child elements by alphabet -
sortChildren
public void sortChildren(boolean bRecursive) sorts all child elements by alphabet -
sortChild
sorts/inserts e by alphabet- Parameters:
e-
-
sortChildren
sorts all child elements by alphabet- Parameters:
comparator- the comparator object to sort by
-
sortChildren
sorts all child elements by alphabet- Parameters:
comparator- the comparator object to sort by
-
sortChild
insert e into this, assuming that this is already sorted- Parameters:
e- the existing element to sortcomparator- the comparator object to sort by
-
toValueString
get a concatinated string of all values- Returns:
-
toString
this to string, used for debug purpose mostly- Overrides:
toStringin classorg.apache.xerces.dom.NodeImpl- Returns:
- string representativ of this
- See Also:
-
toXML
serialize this to a string- Returns:
- String the dom element serialized as a string
- Throws:
JDFException- if an error occurs while serializing
-
toXML
serialize this to a string- Parameters:
indent-- Returns:
- String the dom element serialized as a string
- Throws:
JDFException- if an io exception occurs while serializing
-
toDisplayXML
serialize this to a string- Parameters:
indent-- Returns:
- String the dom element serialized as a string
- Throws:
JDFException- if an error occurs while serializing
-
renameAttribute
public void renameAttribute(String oldName, String newName, String nameSpaceURI, String newNameSpaceURI) Rename an attribute in this namespace
if oldName does not exist, newName is NOT modifieddefault: renameAttribute(oldName, newName, null, null)
- Parameters:
oldName- attribute name to move fromnewName- attribute name to move tonameSpaceURI- attribute nameSpaceURI to move fromnewNameSpaceURI- attribute nameSpaceURI to move the name to
-
renameAttribute
Rename an attribute in this namespace
if oldName does not exist, newName is NOT modifieddefault: renameAttribute(oldName, newName, null, null)
- Parameters:
oldName- attribute name to move fromnewName- attribute name to move to
-
getChildAttributeList
public VString getChildAttributeList(String nodeName, String attName, String nameSpaceURI, String attValue, boolean bDirect, boolean bUnique) Get a vector of all value of the attribute attName in the children of this nodedefault: getChildAttributeList(nodeName, attName, null, JDFCoreConstants.WILDCARD, true, true)
- Parameters:
nodeName- element name you are searching forattName- attributes you are looking fornameSpaceURI- nameSpace you are searching forattValue-bDirect- if true return value is a vector of all found elements. Otherwise the returned vector contains only the nodesbUnique- if you want to make sure, the attribute is unique, set this boolean to true. Otherwise attribute attName is added to the returned vector- Returns:
- Vector - vector with attributes
-
insertBefore
Inserts the Element elementName before the existing Element node beforeChild. If beforeChild isnull, insert elementName at the end of the list of children. If elementName is a DocumentFragment object, all of its children are inserted, in the same order, before beforeChild. If the elementName is already in the tree, it is removed first.default: insertBefore(elementName, beforeChild, null)
- Parameters:
elementName- The elementName to insert the element itself will be createdbeforeChild- The reference element, i.e., the elemente before which the new element must be insertednameSpaceURI- The namespace to create elementName in- Returns:
- KElement the element being inserted
-
getChildrenFromList
public VElement getChildrenFromList(VString nodeNames, JDFAttributeMap map, boolean bDirect, VElement v) get a vector of all Children that match the strings defined in nodeNames- Parameters:
nodeNames- list of node names that fit, both local and qualified node names are checkedmap-bDirect-v- the vector to be filled. if null, a new empty vector will be created- Returns:
- VElement the found child elements
-
getChildrenIgnoreList
get a vector of all Children that do not match the strings defined in nodeNames- Parameters:
nodeNames- list of node names that fit, both local and qualified node names are checkedbDirect-v- the vector to be filled. if null, a new empty vector will be created- Returns:
- VElement the found child elements
-
appendElementN
Appends a new child element to the end of 'this', if it's maximum number of the children with defined name and nameSpace doesn't exceed maxAlloweddefault: AppendElementN(elementName, maxAllowed, null)
- Parameters:
elementName- name of the new child elementmaxAllowed- the maximum number of children with defined name and nameSpace, that are allowed for 'this'nameSpaceURI- nameSpace of the new child element- Returns:
- KElement newly created child element
- Throws:
JDFException- if more elements with name and namespace then maxAllowed already exist
-
buildXPath
Deprecated.use buildXPath(null,true);Gets the XPath full tree representation of 'this'- Returns:
- String the XPath representation of 'this' e.g.
/root/parent/element
nullif parent of this is null (e.g. called on rootnode)
-
buildXPath
Deprecated.use buildXPath(relativeTo,true);Gets the XPath full tree representation of 'this'- Parameters:
relativeTo- relative path to which to create an xpath- Returns:
- String the XPath representation of 'this' e.g.
/root/parent/element
nullif parent of this is null (e.g. called on rootnode)
-
buildXPath
Gets the XPath full tree representation of 'this'- Parameters:
relativeTo- relative path to which to create an xpathmethCountSiblings- , if 1 count siblings, i.e. add '[n]' if 0, only specify the path of parents if 2 or 3, add [@ID="id"]- Returns:
- String the XPath representation of 'this' e.g.
/root/parent/element
nullif parent of this is null (e.g. called on rootnode)
-
buildRelativeXPath
Gets the XPath full tree representation of 'this'- Parameters:
relativeTo- parent element to which to create an xpathmethCountSiblings- , if 1 count siblings, i.e. add '[n]' if 0, only specify the path of parents if 2 or 3, add [@ID="id"]- Returns:
- String the XPath representation of 'this' e.g.
/root/parent/element
nullif parent of this is null (e.g. called on rootnode)
-
insertAt
public KElement insertAt(String nodeName, int beforePos, String beforeNode, String nameSpaceURI, String beforeNameSpaceURI) Creates a new child element with defined Name and NameSpace and inserts it in front of the node with a name bForeNode and namespace beforeNameSpaceURI, with index beforePosdefault: InsertAt(nodeName, beforePos, null, null, null)
- Parameters:
nodeName- name of the new ElementbeforePos- index of beforeNode, i.e if beforePos = 0, put it before the first occurrencebeforeNode- name of the node to put it before, default - any name, Wildcard supportednameSpaceURI- nameSpace of the new nodebeforeNameSpaceURI- nameSpace of the node to put it before, default - value of nameSpaceURI- Returns:
- KElement the newly created element
- Throws:
JDFException- if 'this' is a null element and thus nothing can be inserted in it
-
setXPathValue
Sets an attribute as defined by XPath to value- Parameters:
path- XPath abbreviated syntax representation of the attribute, e.g.:parentElement/thisElement@thisAttparentElement/thisElement[2]/@thisAttparentElement/thisElement[@foo=\"bar\"]/@thisAttvalue- string to be set as attribute value
-
setXPathValues
sets all xpaths to the values provided in map- Parameters:
map- map of XPath / values to set
-
setXPathAttribute
Sets an attribute as defined by XPath to value- Parameters:
path- XPath abbreviated syntax representation of the attribute, e.g.:parentElement/thisElement@thisAttparentElement/thisElement[2]/@thisAttparentElement/thisElement[@foo=\"bar\"]/@thisAttvalue- string to be set as attribute value- Throws:
JDFException- if the defined path is a bad attribute path
-
hasXPathNode
returns true if the element or attribute described by this XPath exists, else false- Parameters:
path- the XPath to test for- Returns:
- true if the element described by path exists
-
getXPathAttribute
Gets an attribute value as defined by XPath namespace prefixes are resolved or the node text if an element is specified- Parameters:
path- XPath abbreviated syntax representation of the attribute,parentElement/thisElement/@thisAttparentElement/thisElement[2]/@thisAttparentElement[@a=\"b\"]/thisElement[@foo=\"bar\"]/@thisAttdef- default value if it doesn't exist- Returns:
- String the String value of the attribute or null if the xpath element does not exist
- Throws:
JDFException- if the defined path is a bad attribute path
-
getInheritedXPathAttribute
Gets an attribute value as defined by XPath namespace prefixes are resolved
Attributes are searched for in partitioned resources if appropriate- Parameters:
path- XPath abbreviated syntax representation of the attribute,parentElement/thisElement/@thisAttparentElement/thisElement[2]/@thisAttparentElement[@a=\"b\"]/thisElement[@foo=\"bar\"]/@thisAttdef- default value if it doesn't exist- Returns:
- String the String value of the attribute or null if the xpath element does not exist
- Throws:
JDFException- if the defined path is a bad attribute path
-
getXPathAttributeMap
Gets a map of attribute values as defined by XPath namespace prefixes are resolved- Parameters:
path- XPath abbreviated syntax representation of the attribute,parentElement/thisElement/@thisAttparentElement/thisElement[2]/@thisAttparentElement[@a=\"b\"]/thisElement[@foo=\"bar\"]/@thisAttif null, assume .//@*, i.e. all of this- Returns:
- String the String value of the attribute or null if the xpath element does not exist
- Throws:
JDFException- if the defined path is a bad attribute path
-
getXPathValueMap
Gets a map of attribute values as defined by XPath namespace prefixes are resolved- Returns:
- String the String value of the xpath
-
getXPathValueMap
Gets a map of attribute values as defined by XPath namespace prefixes are resolved- Returns:
- String the String value of the xpath
-
getXPathElement
gets an element as defined by XPath to value- Parameters:
path- XPath abbreviated syntax representation of the attribute, e.gparentElement/thisElementparentElement/thisElement[2]parentElement[@a=\"b\"]/thisElement[./foo/@foo=\"bar\"]- Returns:
- KElement the specified element
- Throws:
IllegalArgumentException- if path is not supported
-
getXPathElementVector
gets an vector of elements element as defined by XPath to value- Parameters:
path- XPath abbreviated syntax representation of the attribute, e.gparentElement/thisElementparentElement/thisElement[2]parentElement[@a=\"b\"]/thisElement[@foo=\"bar\"]maxSize-- Returns:
- VElement the vector of matching elements
- Throws:
IllegalArgumentException- if path is not supported
-
getCreateXPathElement
gets an element as defined by XPath to value and creates it if it does not exist- Parameters:
path- XPath abbreviated syntax representation of the attribute,parentElement/thisElementparentElement/thisElement[2]parentElement[@a=\"b\"]/thisElement[@foo=\"bar\"]- Returns:
- KElement the specified element
-
hasAttributes
public boolean hasAttributes()checks if the current element has attributes- Specified by:
hasAttributesin interfaceNode- Overrides:
hasAttributesin classorg.apache.xerces.dom.ElementImpl- Returns:
- boolean true if at least one attribute is present
-
hasChildNodes
protected boolean hasChildNodes(int nodeType) checks wether this has node childs of the stated node type- Parameters:
nodeType-- ELEMENT_NODE = 1
- ATTRIBUTE_NODE = 2
- TEXT_NODE = 3
- CDATA_SECTION_NODE = 4
- ENTITY_REFERENCE_NODE = 5
- ENTITY_NODE = 6
- PROCESSING_INSTRUCTION_NODE = 7
- COMMENT_NODE = 8
- DOCUMENT_NODE = 9
- DOCUMENT_TYPE_NODE = 10
- DOCUMENT_FRAGMENT_NODE = 11
- NOTATION_NODE = 12
- XML_DECL_NODE = 13
- Returns:
- boolean true if there is at least one child of the stated node type, false otherwise
-
-
hasChildElements
public boolean hasChildElements()checks if the current element has a child element- Returns:
- boolean - true if there is one or more child elements present
-
getTree
public VElement getTree(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bDirect, boolean bAnd) Get children from the actual element by the tag name, nameSpaceURI or attribute map.
GetTree only follows direct links, e.g. as in a JDF tree. Hidden nodes that are children of nodes with non-matching names are ignored- Parameters:
nodeName- elementname you are searching fornameSpaceURI- nameSpace you are searching formAttrib- attributes you are looking for. Wildcards in the attribute map are supportedbDirect- if true return value is a vector of all direct elements. Otherwise the returned vector contains nodes of arbitrary depthbAnd- if true, a child is only added if it has all attributes specified in Attributes mAttrib- Returns:
- VElement vector with all found elements
-
getTree
Get children from the actual element by the tag name
GetTree only follows direct links, e.g. as in a JDF tree. Hidden nodes that are children of nodes with non-matching names are ignored- Parameters:
nodeName- elementname you are searching for- Returns:
- VElement vector with all found elements
-
getTreeByClass
-
getTreeElement
public KElement getTreeElement(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bDirect, boolean bAnd) Get child from the actual element by the tag name, nameSpaceURI or attribute map. GetTree only follows direct links, e.g. as in a JDF tree. Hidden nodes that are children of non-matching nodes are ignored- Parameters:
nodeName- elementname you are searching for.
Required, no default.nameSpaceURI- nameSpace you are searching for.
Default isnullmAttrib- attributes you are looking for
Wildcards in the attribute map are supported. Default is an empty MapbDirect- if true, return value is a vector of all direct elements.
Otherwise the returned vector contains nodes of arbitrary depth.
Default is false.bAnd- if true, a child is only added if it has all attributes specified in Attributes mAttrib.
Default is true.- Returns:
- KElement the first found element
-
getText
gets the i'th text child node of 'this'- Parameters:
i- index of the child text node, you are searching for- Returns:
- String the text if the i'th text node.
nullif the i'th text node does not exists
-
getCData
Gets of 'this' the text of the i'th XML CData section. This section may also contain < and >.- Parameters:
i- index of the CData section child node, you are searching for- Returns:
- String content of the i'th XML CData section
-
getXMLComment
gets of 'this' the text of the i-th child XMLComment.would returnthis is a XMLComment- Parameters:
i- index of the XMLComment child node, you are searching for- Returns:
- String text of the i-th XMLComment, null if i is higher then the number of child nodes
-
copyXPathValue
copy attribute values or text from an xpath in src to this- Parameters:
dstXPath- the destination xpath in this elementsrc- the source element, if null; use thissrcXPath- the source xpath, if null same as dstXPath- Returns:
- the copied value; may be null if no value was found in srcXPath
-
copyAttribute
public String copyAttribute(String attrib, KElement src, String srcAttrib, String nameSpaceURI, String srcNameSpaceURI) copy an attribute from src to this, if null - remove the attributedefault: copyAttribute(attrib, src, null, null, null)
- Parameters:
attrib- the name of the attribute to copy (if source attribute is different only the value will be copied)src- source element where the attribute to be copied residessrcAttrib- attribute to copy, defaults to the value of attribnameSpaceURI- of the attribute in the destinationsrcNameSpaceURI- of the attribute in the source, defaults to the value of nameSpaceURI- Returns:
- the value of the copied attribute
-
copyAttribute
public String copyAttribute(String attrib, KElement src, String srcAttrib, String nameSpaceURI, String srcNameSpaceURI, boolean overwriteEmpty) copy an attribute from src to this, if null - remove the attributedefault: copyAttribute(attrib, src, null, null, null)
- Parameters:
attrib- the name of the attribute to copy (if source attribute is different only the value will be copied)src- source element where the attribute to be copied residessrcAttrib- attribute to copy, defaults to the value of attribnameSpaceURI- of the attribute in the destinationsrcNameSpaceURI- of the attribute in the source, defaults to the value of nameSpaceURI- Returns:
- the value of the copied attribute
-
copyAttribute
copy an attribute from src to this - shorthand if no renaming or namespace handling is necessarydefault: copyAttribute(attrib, src, null, null, null)
- Parameters:
attrib- the name of the attribute to copy (if source attribute is different only the value will be copied)src- source element where the attribute to be copied resides- Returns:
- the value of the copied attribute
-
copyAttribute
copy an attribute from src to this - shorthand if no renaming or namespace handling is necessarydefault: copyAttribute(attrib, src, null, null, null)
- Parameters:
attrib- the name of the attribute to copy (if source attribute is different only the value will be copied)src- source element where the attribute to be copied resides- Returns:
- the value of the copied attribute
-
copyChildren
- Parameters:
elementName-src-
-
moveAttribute
public void moveAttribute(String attrib, KElement src, String srcAttrib, String nameSpaceURI, String srcNameSpaceURI) moves an attribute from src to this, the attribute will be removed from src and moved to this.default: moveAttribute(attrib, src, null, null, null)
- Parameters:
attrib- where to move the attributesrc- element to move fromsrcAttrib- the attribute to move. If empty string, the string attrib is used as source and targetnameSpaceURI- the namespaceURI to setsrcNameSpaceURI-
-
moveAttribute
moves an attribute from src to this, the attribute will be removed from src and moved to this.- Parameters:
attrib- where to move the attributesrc- element to move from
-
hasChildText
public boolean hasChildText()Tests, whether 'this' contains any text child nodes- Returns:
- boolean true, if there are one or more text child nodes
-
getText
gets a concatenated string representing of all direct text child nodes- Returns:
- String the concatenated values of all direct text child nodes empty string if no child nodes exist
-
removeAllText
public void removeAllText()removes all text children of the current node -
pushUp
Moves 'this' from parent to grandparent or to the closest ancestor with name newParentName- Parameters:
newParentName- name of the parent to recursively search, defaults to any name- Returns:
- this, null if failed (e.g. no parentNode found)
-
numChildNodes
Deprecated.use 2-parameter version numChildNodes(nodeType, false);count the number of child nodes of DOM nodeType nodeType (0=count all)- Parameters:
nodeType- DOM nodeType- count all = 0
- ELEMENT_NODE = 1
- ATTRIBUTE_NODE = 2
- TEXT_NODE = 3
- CDATA_SECTION_NODE = 4
- ENTITY_REFERENCE_NODE = 5
- ENTITY_NODE = 6
- PROCESSING_INSTRUCTION_NODE = 7
- COMMENT_NODE = 8
- DOCUMENT_NODE = 9
- DOCUMENT_TYPE_NODE = 10
- DOCUMENT_FRAGMENT_NODE = 11
- NOTATION_NODE = 12
- XML_DECL_NODE = 13
numChildNodes
- Parameters:
nodeType- DOM nodeType- count all = 0
- ELEMENT_NODE = 1
- ATTRIBUTE_NODE = 2
- TEXT_NODE = 3
- CDATA_SECTION_NODE = 4
- ENTITY_REFERENCE_NODE = 5
- ENTITY_NODE = 6
- PROCESSING_INSTRUCTION_NODE = 7
- COMMENT_NODE = 8
- DOCUMENT_NODE = 9
- DOCUMENT_TYPE_NODE = 10
- DOCUMENT_FRAGMENT_NODE = 11
- NOTATION_NODE = 12
- XML_DECL_NODE = 13
bRecurse-- Returns:
- number of child nodes with "nodeType"
removeChildNode
- Parameters:
nodeType- the DOM NodeType,if 0 count all nodes- ELEMENT_NODE = 1
- ATTRIBUTE_NODE = 2
- TEXT_NODE = 3
- CDATA_SECTION_NODE = 4
- ENTITY_REFERENCE_NODE = 5
- ENTITY_NODE = 6
- PROCESSING_INSTRUCTION_NODE = 7
- COMMENT_NODE = 8
- DOCUMENT_NODE = 9
- DOCUMENT_TYPE_NODE = 10
- DOCUMENT_FRAGMENT_NODE = 11
- NOTATION_NODE = 12
- XML_DECL_NODE = 13
i- index of the child nodes to remove- Returns:
- true if success, false if failed (no i'th node of nodeType found)
cleanup
removeChildText
- Parameters:
i- index of the text node to remove. First node has index 0, second 1, etc.
removeCData
- Parameters:
i- index of the CData section child node to remove
removeXMLComment
- Parameters:
i- index of the XMLComment node to remove
getNumChildNodes
- Parameters:
nodeType- the DOM NodeType, if 0 count all nodes- ELEMENT_NODE = 1
- ATTRIBUTE_NODE = 2
- TEXT_NODE = 3
- CDATA_SECTION_NODE = 4
- ENTITY_REFERENCE_NODE = 5
- ENTITY_NODE = 6
- PROCESSING_INSTRUCTION_NODE = 7
- COMMENT_NODE = 8
- DOCUMENT_NODE = 9
- DOCUMENT_TYPE_NODE = 10
- DOCUMENT_FRAGMENT_NODE = 11
- NOTATION_NODE = 12
- XML_DECL_NODE = 13
- Returns:
- int: the counted number of direct child nodes, that match NodeType
getNumChildText
- Returns:
- int: the number of direct text child nodes in 'this'
getNumCDatas
- Returns:
- int: the number of direct child CData sections
getNumXMLComments
- Returns:
- int: the number of direct XMLComment child nodes
getChildNode
nodeType with n = iPos- Parameters:
nodeType- the DOM node type to get- ELEMENT_NODE = 1
- ATTRIBUTE_NODE = 2
- TEXT_NODE = 3
- CDATA_SECTION_NODE = 4
- ENTITY_REFERENCE_NODE = 5
- ENTITY_NODE = 6
- PROCESSING_INSTRUCTION_NODE = 7
- COMMENT_NODE = 8
- DOCUMENT_NODE = 9
- DOCUMENT_TYPE_NODE = 10
- DOCUMENT_FRAGMENT_NODE = 11
- NOTATION_NODE = 12
- XML_DECL_NODE = 13
iPos- the index of the node with default 0 for the first occurance- Returns:
- KElement: a node that matches the filter, null if iPos is higher then the number of child nodes
xmlNameSpace
exp:myexampley would return exp- Parameters:
s- the qualified name- Returns:
- namespace of the qualified name
setAttributes
- Parameters:
myAttributes- array of attributesstrValues- array of values- Throws:
ArrayIndexOutOfBoundsException- if the arrays are not of equal length
xmlnsLocalName
- Parameters:
pc- the qualifiedname- Returns:
- the local part of the qualified name, null if no local name exists
getXMLNSNameSpace
namespace:localname
- Parameters:
pc- the qualified name.- Returns:
- the namespace of the qualified name. An Emptystring if pc is null or no namespace found.
setXSIType
- Parameters:
typ-
getXSIType
- Returns:
- String the xsi:type of this element, null if not present
getXMLNSPrefix
ns:foowill returnns
- Parameters:
pc- string to parse- Returns:
- String namespace prefix of pc, emptyspace if no ":" is in pc
setText
the text contents of this to the value of text
- Parameters:
text- XML Text to set- Throws:
JDFException- if 'this' is a null element and thus nothing can be inserted in it
removeAttribute
- Specified by:
removeAttributein interfaceElement- Overrides:
removeAttributein classorg.apache.xerces.dom.ElementImpl- Throws:
DOMException- See Also:
-
ElementImpl.removeAttribute(java.lang.String)
removeAttributeNS
- Specified by:
removeAttributeNSin interfaceElement- Overrides:
removeAttributeNSin classorg.apache.xerces.dom.ElementImpl- Throws:
DOMException- See Also:
-
ElementImpl.removeAttributeNS(java.lang.String, java.lang.String)
removeAttributeNode
- Specified by:
removeAttributeNodein interfaceElement- Overrides:
removeAttributeNodein classorg.apache.xerces.dom.ElementImpl- Throws:
DOMException- See Also:
-
ElementImpl.removeAttributeNode(org.w3c.dom.Attr)
setAttributeNode
- Specified by:
setAttributeNodein interfaceElement- Overrides:
setAttributeNodein classorg.apache.xerces.dom.ElementImpl- Throws:
DOMException- See Also:
-
ElementImpl.setAttributeNode(org.w3c.dom.Attr)
setAttributeNodeNS
- Specified by:
setAttributeNodeNSin interfaceElement- Overrides:
setAttributeNodeNSin classorg.apache.xerces.dom.ElementImpl- Throws:
DOMException- See Also:
-
ElementImpl.setAttributeNodeNS(org.w3c.dom.Attr)
setAttributeNS
- Specified by:
setAttributeNSin interfaceElement- Overrides:
setAttributeNSin classorg.apache.xerces.dom.ElementImpl- Throws:
DOMException- See Also:
-
ElementImpl.setAttributeNS(java.lang.String, java.lang.String, java.lang.String)
normalize
setNodeValue
- Specified by:
setNodeValuein interfaceNode- Overrides:
setNodeValuein classorg.apache.xerces.dom.NodeImpl- Throws:
DOMException- See Also:
-
NodeImpl.setNodeValue(java.lang.String)
setPrefix
- Specified by:
setPrefixin interfaceNode- Overrides:
setPrefixin classorg.apache.xerces.dom.ElementNSImpl- Throws:
DOMException- See Also:
-
ElementNSImpl.setPrefix(java.lang.String)
setNamespaceURI
- Parameters:
arg0- the ns uri to set- Throws:
DOMException
appendChild
- Specified by:
appendChildin interfaceNode- Overrides:
appendChildin classorg.apache.xerces.dom.NodeImpl- Throws:
DOMException- See Also:
-
NodeImpl.appendChild(org.w3c.dom.Node)
removeChild
- Specified by:
removeChildin interfaceNode- Overrides:
removeChildin classorg.apache.xerces.dom.ParentNode- Throws:
DOMException- See Also:
-
ParentNode.removeChild(org.w3c.dom.Node)
insertBefore
- Specified by:
insertBeforein interfaceNode- Overrides:
insertBeforein classorg.apache.xerces.dom.ParentNode- Throws:
DOMException- See Also:
-
ParentNode.insertBefore(org.w3c.dom.Node, org.w3c.dom.Node)
replaceChild
- Specified by:
replaceChildin interfaceNode- Overrides:
replaceChildin classorg.apache.xerces.dom.ParentNode- Throws:
DOMException- See Also:
-
ParentNode.replaceChild(org.w3c.dom.Node, org.w3c.dom.Node)
removeXPathAttribute
- Parameters:
path- the XPath to the attribute that is to be removed- Throws:
JDFException- if the XPath is corrupt
removeXPathElement
- Parameters:
path- the XPath to the attribute that is to be removed- Throws:
JDFException- if the XPath is corrupt
matchesPath
- Parameters:
path-- Returns:
- boolean
matchesPath
- Parameters:
path- xpath to match may include syntaxe[i]ore[@a="b"]bFollowRefs-- Returns:
- boolean true, if this matches the given xpath
matchesPathName
fillHashSet
- Parameters:
attName- the attribute to searchattNS- the namespace of the attribute- Returns:
clone
cloneNewDoc
the document gets copies of context sensitive stuff like zip, mime, filename...
- Returns:
- See Also:
appendAnchor
- Parameters:
newID- the new id. if null, then a reasonably unique id is generated- Returns:
- String - the value of the ID attribute after setting
getID
- Returns:
- the attribute value
generateDotID
nn is a unique number, that is generated as the first integer higher than the number of sibling elements with the same name.
Note that it is the responsibilty of the caller not to provide multiple siblings that use the same base IDs.
- Parameters:
key- the attribute that is to be set to this ID, e.g. jobpartidnameSpaceURI- the attribute namespace that is to be set to this ID, e.g. jobpartid- Returns:
- String - the newly generated ID in the syntax parentID.nn
getIDPrefix
- Returns:
- the default ID prefix of non-overwritten JDF elements
setID
- Parameters:
id-
setLongID
- Parameters:
bLong- if true (default), the date and time is used to generate long IDs
uniqueID
- Parameters:
id- the starting id of the ID - should normally be 0 in order to increment- Returns:
- the ID string value
uniqueID
- Parameters:
id-bDate-- Returns:
createRoot
- Parameters:
nodename-namespaceURI-- Returns:
createRoot
- Parameters:
nodename-namespaceURI-- Returns:
numSiblingElements
- Parameters:
elementName- , if null any and all at the same levelnameSpaceURI-- Returns:
write2Stream
- Parameters:
stream-- Returns:
writeStream
IStreamWriter- Specified by:
writeStreamin interfaceIStreamWriter- Parameters:
stream- the output stream
write2File
- Parameters:
file-- Returns:
write2File
- Parameters:
filename-- Returns:
setNonEmpty
- Parameters:
key-val-
parseStream
- Parameters:
s-- Returns:
parseString
- Parameters:
string-- Returns:
parseFile
- Parameters:
filename-- Returns:
parseFile
- Parameters:
filename-- Returns: