/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
}
}
}
public int getLength() {
}
return node;
}
}
return null;
}
return node;
}
"This NamedNodeMap is read-only!");
}
"This NamedNodeMap is read-only!");
}
/**
* Equivalent to <code>getNamedItem(localName)</code>.
*/
return getNamedItem(localName);
}
/**
* Equivalent to <code>setNamedItem(arg)</code>.
*/
return setNamedItem(arg);
}
/**
* Equivalent to <code>removeNamedItem(localName)</code>.
*/
return removeNamedItem(localName);
}
}
}
public int getLength() {
}
return null;
}
}
}
}
return name;
}
return name;
}
public short getNodeType() {
return ATTRIBUTE_NODE;
}
public boolean getSpecified() {
return true;
}
return value;
}
return value;
}
}
}
return owner;
}
}
/** This method is new in the DOM L3 for Attr interface.
* Could throw DOMException here, but its probably OK
* to always return false. One reason for this, is we have no good
* way to document this exception, since this class, IIOAttr,
* is not a public class. The rest of the methods that throw
* DOMException are publically documented as such on IIOMetadataNode.
* @return false
*/
public boolean isId() {
return false;
}
}
/**
* A class representing a node in a meta-data tree, which implements
* the <a
* href="../../../../api/org/w3c/dom/Element.html">
* <code>org.w3c.dom.Element</code></a> interface and additionally allows
* for the storage of non-textual objects via the
* <code>getUserObject</code> and <code>setUserObject</code> methods.
*
* <p> This class is not intended to be used for general XML
* processing. In particular, <code>Element</code> nodes created
* within the Image I/O API are not compatible with those created by
* Sun's standard implementation of the <code>org.w3.dom</code> API.
* In particular, the implementation is tuned for simple uses and may
* not perform well for intensive processing.
*
* <p> Namespaces are ignored in this implementation. The terms "tag
* name" and "node name" are always considered to be synonymous.
*
* <em>Note:</em>
* The DOM Level 3 specification added a number of new methods to the
* {@code Node}, {@code Element} and {@code Attr} interfaces that are not
* of value to the {@code IIOMetadataNode} implementation or specification.
*
* Calling such methods on an {@code IIOMetadataNode}, or an {@code Attr}
* instance returned from an {@code IIOMetadataNode} will result in a
* {@code DOMException} being thrown.
*
* @see IIOMetadata#getAsTree
* @see IIOMetadata#setFromTree
* @see IIOMetadata#mergeTree
*
*/
/**
* The name of the node as a <code>String</code>.
*/
/**
* The value of the node as a <code>String</code>. The Image I/O
* API typically does not make use of the node value.
*/
/**
* The <code>Object</code> value associated with this node.
*/
/**
* The parent node of this node, or <code>null</code> if this node
* forms the root of its own tree.
*/
/**
* The number of child nodes.
*/
/**
* The first (leftmost) child node of this node, or
* <code>null</code> if this node is a leaf node.
*/
/**
* The last (rightmost) child node of this node, or
* <code>null</code> if this node is a leaf node.
*/
/**
* The next (right) sibling node of this node, or
* <code>null</code> if this node is its parent's last child node.
*/
/**
* The previous (left) sibling node of this node, or
* <code>null</code> if this node is its parent's first child node.
*/
/**
* A <code>List</code> of <code>IIOAttr</code> nodes representing
* attributes.
*/
/**
* Constructs an empty <code>IIOMetadataNode</code>.
*/
public IIOMetadataNode() {}
/**
* Constructs an <code>IIOMetadataNode</code> with a given node
* name.
*
* @param nodeName the name of the node, as a <code>String</code>.
*/
}
/**
* Check that the node is either <code>null</code> or an
* <code>IIOMetadataNode</code>.
*/
return;
}
if (!(node instanceof IIOMetadataNode)) {
"Node not an IIOMetadataNode!");
}
}
// Methods from Node
/**
* Returns the node name associated with this node.
*
* @return the node name, as a <code>String</code>.
*/
return nodeName;
}
/**
* Returns the value associated with this node.
*
* @return the node value, as a <code>String</code>.
*/
return nodeValue;
}
/**
* Sets the <code>String</code> value associated with this node.
*/
}
/**
* Returns the node type, which is always
* <code>ELEMENT_NODE</code>.
*
* @return the <code>short</code> value <code>ELEMENT_NODE</code>.
*/
public short getNodeType() {
return ELEMENT_NODE;
}
/**
* Returns the parent of this node. A <code>null</code> value
* indicates that the node is the root of its own tree. To add a
* node to an existing tree, use one of the
* <code>insertBefore</code>, <code>replaceChild</code>, or
* <code>appendChild</code> methods.
*
* @return the parent, as a <code>Node</code>.
*
* @see #insertBefore
* @see #replaceChild
* @see #appendChild
*/
return parent;
}
/**
* Returns a <code>NodeList</code> that contains all children of this node.
* If there are no children, this is a <code>NodeList</code> containing
* no nodes.
*
* @return the children as a <code>NodeList</code>
*/
return this;
}
/**
* Returns the first child of this node, or <code>null</code> if
* the node has no children.
*
* @return the first child, as a <code>Node</code>, or
* <code>null</code>
*/
return firstChild;
}
/**
* Returns the last child of this node, or <code>null</code> if
* the node has no children.
*
* @return the last child, as a <code>Node</code>, or
* <code>null</code>.
*/
return lastChild;
}
/**
* Returns the previous sibling of this node, or <code>null</code>
* if this node has no previous sibling.
*
* @return the previous sibling, as a <code>Node</code>, or
* <code>null</code>.
*/
return previousSibling;
}
/**
* Returns the next sibling of this node, or <code>null</code> if
* the node has no next sibling.
*
* @return the next sibling, as a <code>Node</code>, or
* <code>null</code>.
*/
return nextSibling;
}
/**
* Returns a <code>NamedNodeMap</code> containing the attributes of
* this node.
*
* @return a <code>NamedNodeMap</code> containing the attributes of
* this node.
*/
return new IIONamedNodeMap(attributes);
}
/**
* Returns <code>null</code>, since <code>IIOMetadataNode</code>s
* do not belong to any <code>Document</code>.
*
* @return <code>null</code>.
*/
return null;
}
/**
* Inserts the node <code>newChild</code> before the existing
* child node <code>refChild</code>. If <code>refChild</code> is
* <code>null</code>, insert <code>newChild</code> at the end of
* the list of children.
*
* @param newChild the <code>Node</code> to insert.
* @param refChild the reference <code>Node</code>.
*
* @return the node being inserted.
*
* @exception IllegalArgumentException if <code>newChild</code> is
* <code>null</code>.
*/
throw new IllegalArgumentException("newChild == null!");
}
// Siblings, can be null.
this.lastChild = newChildNode;
} else {
next = refChildNode;
}
}
}
newChildNode.parent = this;
// N.B.: O.K. if refChild == null
if (this.firstChild == refChildNode) {
this.firstChild = newChildNode;
}
++numChildren;
return newChildNode;
}
/**
* Replaces the child node <code>oldChild</code> with
* <code>newChild</code> in the list of children, and returns the
* <code>oldChild</code> node.
*
* @param newChild the <code>Node</code> to insert.
* @param oldChild the <code>Node</code> to be replaced.
*
* @return the node replaced.
*
* @exception IllegalArgumentException if <code>newChild</code> is
* <code>null</code>.
*/
throw new IllegalArgumentException("newChild == null!");
}
}
}
newChildNode.parent = this;
if (firstChild == oldChildNode) {
}
if (lastChild == oldChildNode) {
}
return oldChildNode;
}
/**
* Removes the child node indicated by <code>oldChild</code> from
* the list of children, and returns it.
*
* @param oldChild the <code>Node</code> to be removed.
*
* @return the node removed.
*
* @exception IllegalArgumentException if <code>oldChild</code> is
* <code>null</code>.
*/
throw new IllegalArgumentException("oldChild == null!");
}
}
}
if (this.firstChild == oldChildNode) {
this.firstChild = next;
}
if (this.lastChild == oldChildNode) {
}
--numChildren;
return oldChildNode;
}
/**
* Adds the node <code>newChild</code> to the end of the list of
* children of this node.
*
* @param newChild the <code>Node</code> to insert.
*
* @return the node added.
*
* @exception IllegalArgumentException if <code>newChild</code> is
* <code>null</code>.
*/
throw new IllegalArgumentException("newChild == null!");
}
// insertBefore will increment numChildren
}
/**
* Returns <code>true</code> if this node has child nodes.
*
* @return <code>true</code> if this node has children.
*/
public boolean hasChildNodes() {
return numChildren > 0;
}
/**
* Returns a duplicate of this node. The duplicate node has no
* parent (<code>getParentNode</code> returns <code>null</code>).
* If a shallow clone is being performed (<code>deep</code> is
* <code>false</code>), the new node will not have any children or
* siblings. If a deep clone is being performed, the new node
* will form the root of a complete cloned subtree.
*
* @param deep if <code>true</code>, recursively clone the subtree
* under the specified node; if <code>false</code>, clone only the
* node itself.
*
* @return the duplicate node.
*/
// Attributes
if (deep) {
}
}
return newNode;
}
/**
* Does nothing, since <code>IIOMetadataNode</code>s do not
* contain <code>Text</code> children.
*/
public void normalize() {
}
/**
* Returns <code>false</code> since DOM features are not
* supported.
*
* @return <code>false</code>.
*
* @param feature a <code>String</code>, which is ignored.
* @param version a <code>String</code>, which is ignored.
*/
return false;
}
/**
* Returns <code>null</code>, since namespaces are not supported.
*/
return null;
}
/**
* Returns <code>null</code>, since namespaces are not supported.
*
* @return <code>null</code>.
*
* @see #setPrefix
*/
return null;
}
/**
* Does nothing, since namespaces are not supported.
*
* @param prefix a <code>String</code>, which is ignored.
*
* @see #getPrefix
*/
}
/**
* Equivalent to <code>getNodeName</code>.
*
* @return the node name, as a <code>String</code>.
*/
return nodeName;
}
// Methods from Element
/**
* Equivalent to <code>getNodeName</code>.
*
* @return the node name, as a <code>String</code>
*/
return nodeName;
}
/**
* Retrieves an attribute value by name.
* @param name The name of the attribute to retrieve.
* @return The <code>Attr</code> value as a string, or the empty string
* if that attribute does not have a specified or default value.
*/
return "";
}
}
/**
* Equivalent to <code>getAttribute(localName)</code>.
*
* @see #setAttributeNS
*/
return getAttribute(localName);
}
// Name must be valid unicode chars
boolean valid = true;
if (chs[i] >= 0xfffe) {
valid = false;
break;
}
}
if (!valid) {
"Attribute name is illegal!");
}
removeAttribute(name, false);
}
/**
* Equivalent to <code>setAttribute(qualifiedName, value)</code>.
*
* @see #getAttributeNS
*/
}
removeAttribute(name, true);
}
for (int i = 0; i < numAttributes; i++) {
attributes.remove(i);
return;
}
}
// If we get here, the attribute doesn't exist
if (checkPresent) {
"No such attribute!");
}
}
/**
* Equivalent to <code>removeAttribute(localName)</code>.
*/
}
}
/**
* Equivalent to <code>getAttributeNode(localName)</code>.
*
* @see #setAttributeNodeNS
*/
return getAttributeNode(localName);
}
if (owner == this) {
return null;
} else {
"Attribute is already in use");
}
}
attr.setOwnerElement(this);
} else {
}
}
return oldAttr;
}
/**
* Equivalent to <code>setAttributeNode(newAttr)</code>.
*
* @see #getAttributeNodeNS
*/
return setAttributeNode(newAttr);
}
return oldAttr;
}
getElementsByTagName(name, l);
return new IIONodeList(l);
}
l.add(this);
}
}
}
/**
* Equivalent to <code>getElementsByTagName(localName)</code>.
*/
return getElementsByTagName(localName);
}
public boolean hasAttributes() {
}
}
/**
* Equivalent to <code>hasAttribute(localName)</code>.
*/
return hasAttribute(localName);
}
// Methods from NodeList
public int getLength() {
return numChildren;
}
if (index < 0) {
return null;
}
}
return child;
}
/**
* Returns the <code>Object</code> value associated with this node.
*
* @return the user <code>Object</code>.
*
* @see #setUserObject
*/
return userObject;
}
/**
* Sets the value associated with this node.
*
* @param userObject the user <code>Object</code>.
*
* @see #getUserObject
*/
this.userObject = userObject;
}
// Start of dummy methods for DOM L3.
/**
* This DOM Level 3 method is not supported for {@code IIOMetadataNode}
* and will throw a {@code DOMException}.
* @throws DOMException - always.
*/
boolean isId)
throws DOMException {
"Method not supported");
}
/**
* This DOM Level 3 method is not supported for {@code IIOMetadataNode}
* and will throw a {@code DOMException}.
* @throws DOMException - always.
*/
boolean isId)
throws DOMException {
"Method not supported");
}
/**
* This DOM Level 3 method is not supported for {@code IIOMetadataNode}
* and will throw a {@code DOMException}.
* @throws DOMException - always.
*/
boolean isId)
throws DOMException {
"Method not supported");
}
/**
* This DOM Level 3 method is not supported for {@code IIOMetadataNode}
* and will throw a {@code DOMException}.
* @throws DOMException - always.
*/
"Method not supported");
}
/**
* This DOM Level 3 method is not supported for {@code IIOMetadataNode}
* and will throw a {@code DOMException}.
* @throws DOMException - always.
*/
"Method not supported");
}
/**
* This DOM Level 3 method is not supported for {@code IIOMetadataNode}
* and will throw a {@code DOMException}.
* @throws DOMException - always.
*/
"Method not supported");
}
/**
* This DOM Level 3 method is not supported for {@code IIOMetadataNode}
* and will throw a {@code DOMException}.
* @throws DOMException - always.
*/
throws DOMException {
"Method not supported");
}
/**
* This DOM Level 3 method is not supported for {@code IIOMetadataNode}
* and will throw a {@code DOMException}.
* @throws DOMException - always.
*/
"Method not supported");
}
/**
* This DOM Level 3 method is not supported for {@code IIOMetadataNode}
* and will throw a {@code DOMException}.
* @throws DOMException - always.
*/
"Method not supported");
}
/**
* This DOM Level 3 method is not supported for {@code IIOMetadataNode}
* and will throw a {@code DOMException}.
* @throws DOMException - always.
*/
"Method not supported");
}
/**
* This DOM Level 3 method is not supported for {@code IIOMetadataNode}
* and will throw a {@code DOMException}.
* @throws DOMException - always.
*/
throws DOMException {
"Method not supported");
}
/**
* This DOM Level 3 method is not supported for {@code IIOMetadataNode}
* and will throw a {@code DOMException}.
* @throws DOMException - always.
*/
"Method not supported");
}
/**
* This DOM Level 3 method is not supported for {@code IIOMetadataNode}
* and will throw a {@code DOMException}.
* @throws DOMException - always.
*/
"Method not supported");
}
/**
* This DOM Level 3 method is not supported for {@code IIOMetadataNode}
* and will throw a {@code DOMException}.
* @throws DOMException - always.
*/
"Method not supported");
}
/**
* This DOM Level 3 method is not supported for {@code IIOMetadataNode}
* and will throw a {@code DOMException}.
* @throws DOMException - always.
*/
throws DOMException {
"Method not supported");
}
/**
* This DOM Level 3 method is not supported for {@code IIOMetadataNode}
* and will throw a {@code DOMException}.
* @throws DOMException - always.
*/
"Method not supported");
}
//End of dummy methods for DOM L3.
}