Path: blob/master/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadataNode.java
41153 views
/*1* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.imageio.metadata;2627import java.io.Serial;28import java.util.ArrayList;29import java.util.List;3031import org.w3c.dom.Attr;32import org.w3c.dom.DOMException;33import org.w3c.dom.Document;34import org.w3c.dom.Element;35import org.w3c.dom.NamedNodeMap;36import org.w3c.dom.Node;37import org.w3c.dom.NodeList;38import org.w3c.dom.TypeInfo;39import org.w3c.dom.UserDataHandler;4041/**42* An {@code IIODOMException} is thrown by the {@code IIOMetadataNode} in43* "exceptional" circumstances.44*/45class IIODOMException extends DOMException {4647/**48* Use serialVersionUID from JDK 9 for interoperability.49*/50@Serial51private static final long serialVersionUID = -4369510142067447468L;5253public IIODOMException(short code, String message) {54super(code, message);55}56}5758class IIONamedNodeMap implements NamedNodeMap {5960List<? extends Node> nodes;6162public IIONamedNodeMap(List<? extends Node> nodes) {63this.nodes = nodes;64}6566public int getLength() {67return nodes.size();68}6970public Node getNamedItem(String name) {71for (Node node : nodes) {72if (name.equals(node.getNodeName())) {73return node;74}75}7677return null;78}7980public Node item(int index) {81Node node = nodes.get(index);82return node;83}8485public Node removeNamedItem(java.lang.String name) {86throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,87"This NamedNodeMap is read-only!");88}8990public Node setNamedItem(Node arg) {91throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,92"This NamedNodeMap is read-only!");93}9495/**96* Equivalent to {@code getNamedItem(localName)}.97*/98public Node getNamedItemNS(String namespaceURI, String localName) {99return getNamedItem(localName);100}101102/**103* Equivalent to {@code setNamedItem(arg)}.104*/105public Node setNamedItemNS(Node arg) {106return setNamedItem(arg);107}108109/**110* Equivalent to {@code removeNamedItem(localName)}.111*/112public Node removeNamedItemNS(String namespaceURI, String localName) {113return removeNamedItem(localName);114}115}116117class IIONodeList implements NodeList {118119List<? extends Node> nodes;120121public IIONodeList(List<? extends Node> nodes) {122this.nodes = nodes;123}124125public int getLength() {126return nodes.size();127}128129public Node item(int index) {130if (index < 0 || index >= nodes.size()) {131return null;132}133return nodes.get(index);134}135}136137class IIOAttr extends IIOMetadataNode implements Attr {138139Element owner;140String name;141String value;142143public IIOAttr(Element owner, String name, String value) {144this.owner = owner;145this.name = name;146this.value = value;147}148149public String getName() {150return name;151}152153public String getNodeName() {154return name;155}156157public short getNodeType() {158return ATTRIBUTE_NODE;159}160161public boolean getSpecified() {162return true;163}164165public String getValue() {166return value;167}168169public String getNodeValue() {170return value;171}172173public void setValue(String value) {174this.value = value;175}176177public void setNodeValue(String value) {178this.value = value;179}180181public Element getOwnerElement() {182return owner;183}184185public void setOwnerElement(Element owner) {186this.owner = owner;187}188189/** This method is new in the DOM L3 for Attr interface.190* Could throw DOMException here, but its probably OK191* to always return false. One reason for this, is we have no good192* way to document this exception, since this class, IIOAttr,193* is not a public class. The rest of the methods that throw194* DOMException are publically documented as such on IIOMetadataNode.195* @return false196*/197public boolean isId() {198return false;199}200201202}203204/**205* A class representing a node in a meta-data tree, which implements206* the {@link Element org.w3c.dom.Element} interface and additionally allows207* for the storage of non-textual objects via the208* {@code getUserObject} and {@code setUserObject} methods.209*210* <p> This class is not intended to be used for general XML211* processing. In particular, {@code Element} nodes created212* within the Image I/O API are not compatible with those created by213* Sun's standard implementation of the {@code org.w3.dom} API.214* In particular, the implementation is tuned for simple uses and may215* not perform well for intensive processing.216*217* <p> Namespaces are ignored in this implementation. The terms "tag218* name" and "node name" are always considered to be synonymous.219*220* <em>Note:</em>221* The DOM Level 3 specification added a number of new methods to the222* {@code Node}, {@code Element} and {@code Attr} interfaces that are not223* of value to the {@code IIOMetadataNode} implementation or specification.224*225* Calling such methods on an {@code IIOMetadataNode}, or an {@code Attr}226* instance returned from an {@code IIOMetadataNode} will result in a227* {@code DOMException} being thrown.228*229* @see IIOMetadata#getAsTree230* @see IIOMetadata#setFromTree231* @see IIOMetadata#mergeTree232*233*/234public class IIOMetadataNode implements Element, NodeList {235236/**237* The name of the node as a {@code String}.238*/239private String nodeName = null;240241/**242* The value of the node as a {@code String}. The Image I/O243* API typically does not make use of the node value.244*/245private String nodeValue = null;246247/**248* The {@code Object} value associated with this node.249*/250private Object userObject = null;251252/**253* The parent node of this node, or {@code null} if this node254* forms the root of its own tree.255*/256private IIOMetadataNode parent = null;257258/**259* The number of child nodes.260*/261private int numChildren = 0;262263/**264* The first (leftmost) child node of this node, or265* {@code null} if this node is a leaf node.266*/267private IIOMetadataNode firstChild = null;268269/**270* The last (rightmost) child node of this node, or271* {@code null} if this node is a leaf node.272*/273private IIOMetadataNode lastChild = null;274275/**276* The next (right) sibling node of this node, or277* {@code null} if this node is its parent's last child node.278*/279private IIOMetadataNode nextSibling = null;280281/**282* The previous (left) sibling node of this node, or283* {@code null} if this node is its parent's first child node.284*/285private IIOMetadataNode previousSibling = null;286287/**288* A {@code List} of {@code IIOAttr} nodes representing289* attributes.290*/291private List<IIOAttr> attributes = new ArrayList<>();292293/**294* Constructs an empty {@code IIOMetadataNode}.295*/296public IIOMetadataNode() {}297298/**299* Constructs an {@code IIOMetadataNode} with a given node300* name.301*302* @param nodeName the name of the node, as a {@code String}.303*/304public IIOMetadataNode(String nodeName) {305this.nodeName = nodeName;306}307308/**309* Check that the node is either {@code null} or an310* {@code IIOMetadataNode}.311*312* @throws DOMException if {@code node} is not {@code null} and not an313* instance of {@code IIOMetadataNode}314*/315private void checkNode(Node node) throws DOMException {316if (node == null) {317return;318}319if (!(node instanceof IIOMetadataNode)) {320throw new IIODOMException(DOMException.WRONG_DOCUMENT_ERR,321"Node not an IIOMetadataNode!");322}323}324325// Methods from Node326327/**328* Returns the node name associated with this node.329*330* @return the node name, as a {@code String}.331*/332public String getNodeName() {333return nodeName;334}335336/**337* Returns the value associated with this node.338*339* @return the node value, as a {@code String}.340*/341public String getNodeValue(){342return nodeValue;343}344345/**346* Sets the {@code String} value associated with this node.347*/348public void setNodeValue(String nodeValue) {349this.nodeValue = nodeValue;350}351352/**353* Returns the node type, which is always354* {@code ELEMENT_NODE}.355*356* @return the {@code short} value {@code ELEMENT_NODE}.357*/358public short getNodeType() {359return ELEMENT_NODE;360}361362/**363* Returns the parent of this node. A {@code null} value364* indicates that the node is the root of its own tree. To add a365* node to an existing tree, use one of the366* {@code insertBefore}, {@code replaceChild}, or367* {@code appendChild} methods.368*369* @return the parent, as a {@code Node}.370*371* @see #insertBefore372* @see #replaceChild373* @see #appendChild374*/375public Node getParentNode() {376return parent;377}378379/**380* Returns a {@code NodeList} that contains all children of this node.381* If there are no children, this is a {@code NodeList} containing382* no nodes.383*384* @return the children as a {@code NodeList}385*/386public NodeList getChildNodes() {387return this;388}389390/**391* Returns the first child of this node, or {@code null} if392* the node has no children.393*394* @return the first child, as a {@code Node}, or395* {@code null}396*/397public Node getFirstChild() {398return firstChild;399}400401/**402* Returns the last child of this node, or {@code null} if403* the node has no children.404*405* @return the last child, as a {@code Node}, or406* {@code null}.407*/408public Node getLastChild() {409return lastChild;410}411412/**413* Returns the previous sibling of this node, or {@code null}414* if this node has no previous sibling.415*416* @return the previous sibling, as a {@code Node}, or417* {@code null}.418*/419public Node getPreviousSibling() {420return previousSibling;421}422423/**424* Returns the next sibling of this node, or {@code null} if425* the node has no next sibling.426*427* @return the next sibling, as a {@code Node}, or428* {@code null}.429*/430public Node getNextSibling() {431return nextSibling;432}433434/**435* Returns a {@code NamedNodeMap} containing the attributes of436* this node.437*438* @return a {@code NamedNodeMap} containing the attributes of439* this node.440*/441public NamedNodeMap getAttributes() {442return new IIONamedNodeMap(attributes);443}444445/**446* Returns {@code null}, since {@code IIOMetadataNode}s447* do not belong to any {@code Document}.448*449* @return {@code null}.450*/451public Document getOwnerDocument() {452return null;453}454455/**456* Inserts the node {@code newChild} before the existing457* child node {@code refChild}. If {@code refChild} is458* {@code null}, insert {@code newChild} at the end of459* the list of children.460*461* @param newChild the {@code Node} to insert.462* @param refChild the reference {@code Node}.463*464* @return the node being inserted.465*466* @exception IllegalArgumentException if {@code newChild} is467* {@code null}.468*/469public Node insertBefore(Node newChild,470Node refChild) {471if (newChild == null) {472throw new IllegalArgumentException("newChild == null!");473}474475checkNode(newChild);476checkNode(refChild);477478IIOMetadataNode newChildNode = (IIOMetadataNode)newChild;479IIOMetadataNode refChildNode = (IIOMetadataNode)refChild;480481// Siblings, can be null.482IIOMetadataNode previous = null;483IIOMetadataNode next = null;484485if (refChild == null) {486previous = this.lastChild;487next = null;488this.lastChild = newChildNode;489} else {490previous = refChildNode.previousSibling;491next = refChildNode;492}493494if (previous != null) {495previous.nextSibling = newChildNode;496}497if (next != null) {498next.previousSibling = newChildNode;499}500501newChildNode.parent = this;502newChildNode.previousSibling = previous;503newChildNode.nextSibling = next;504505// N.B.: O.K. if refChild == null506if (this.firstChild == refChildNode) {507this.firstChild = newChildNode;508}509510++numChildren;511return newChildNode;512}513514/**515* Replaces the child node {@code oldChild} with516* {@code newChild} in the list of children, and returns the517* {@code oldChild} node.518*519* @param newChild the {@code Node} to insert.520* @param oldChild the {@code Node} to be replaced.521*522* @return the node replaced.523*524* @exception IllegalArgumentException if {@code newChild} is525* {@code null}.526*/527public Node replaceChild(Node newChild,528Node oldChild) {529if (newChild == null) {530throw new IllegalArgumentException("newChild == null!");531}532533checkNode(newChild);534checkNode(oldChild);535536IIOMetadataNode newChildNode = (IIOMetadataNode)newChild;537IIOMetadataNode oldChildNode = (IIOMetadataNode)oldChild;538539IIOMetadataNode previous = oldChildNode.previousSibling;540IIOMetadataNode next = oldChildNode.nextSibling;541542if (previous != null) {543previous.nextSibling = newChildNode;544}545if (next != null) {546next.previousSibling = newChildNode;547}548549newChildNode.parent = this;550newChildNode.previousSibling = previous;551newChildNode.nextSibling = next;552553if (firstChild == oldChildNode) {554firstChild = newChildNode;555}556if (lastChild == oldChildNode) {557lastChild = newChildNode;558}559560oldChildNode.parent = null;561oldChildNode.previousSibling = null;562oldChildNode.nextSibling = null;563564return oldChildNode;565}566567/**568* Removes the child node indicated by {@code oldChild} from569* the list of children, and returns it.570*571* @param oldChild the {@code Node} to be removed.572*573* @return the node removed.574*575* @exception IllegalArgumentException if {@code oldChild} is576* {@code null}.577*/578public Node removeChild(Node oldChild) {579if (oldChild == null) {580throw new IllegalArgumentException("oldChild == null!");581}582checkNode(oldChild);583584IIOMetadataNode oldChildNode = (IIOMetadataNode)oldChild;585586IIOMetadataNode previous = oldChildNode.previousSibling;587IIOMetadataNode next = oldChildNode.nextSibling;588589if (previous != null) {590previous.nextSibling = next;591}592if (next != null) {593next.previousSibling = previous;594}595596if (this.firstChild == oldChildNode) {597this.firstChild = next;598}599if (this.lastChild == oldChildNode) {600this.lastChild = previous;601}602603oldChildNode.parent = null;604oldChildNode.previousSibling = null;605oldChildNode.nextSibling = null;606607--numChildren;608return oldChildNode;609}610611/**612* Adds the node {@code newChild} to the end of the list of613* children of this node.614*615* @param newChild the {@code Node} to insert.616*617* @return the node added.618*619* @exception IllegalArgumentException if {@code newChild} is620* {@code null}.621*/622public Node appendChild(Node newChild) {623if (newChild == null) {624throw new IllegalArgumentException("newChild == null!");625}626checkNode(newChild);627628// insertBefore will increment numChildren629return insertBefore(newChild, null);630}631632/**633* Returns {@code true} if this node has child nodes.634*635* @return {@code true} if this node has children.636*/637public boolean hasChildNodes() {638return numChildren > 0;639}640641/**642* Returns a duplicate of this node. The duplicate node has no643* parent ({@code getParentNode} returns {@code null}).644* If a shallow clone is being performed ({@code deep} is645* {@code false}), the new node will not have any children or646* siblings. If a deep clone is being performed, the new node647* will form the root of a complete cloned subtree.648*649* @param deep if {@code true}, recursively clone the subtree650* under the specified node; if {@code false}, clone only the651* node itself.652*653* @return the duplicate node.654*/655public Node cloneNode(boolean deep) {656IIOMetadataNode newNode = new IIOMetadataNode(this.nodeName);657newNode.setUserObject(getUserObject());658// Attributes659660if (deep) {661for (IIOMetadataNode child = firstChild;662child != null;663child = child.nextSibling) {664newNode.appendChild(child.cloneNode(true));665}666}667668return newNode;669}670671/**672* Does nothing, since {@code IIOMetadataNode}s do not673* contain {@code Text} children.674*/675public void normalize() {676}677678/**679* Returns {@code false} since DOM features are not680* supported.681*682* @return {@code false}.683*684* @param feature a {@code String}, which is ignored.685* @param version a {@code String}, which is ignored.686*/687public boolean isSupported(String feature, String version) {688return false;689}690691/**692* Returns {@code null}, since namespaces are not supported.693*/694public String getNamespaceURI() throws DOMException {695return null;696}697698/**699* Returns {@code null}, since namespaces are not supported.700*701* @return {@code null}.702*703* @see #setPrefix704*/705public String getPrefix() {706return null;707}708709/**710* Does nothing, since namespaces are not supported.711*712* @param prefix a {@code String}, which is ignored.713*714* @see #getPrefix715*/716public void setPrefix(String prefix) {717}718719/**720* Equivalent to {@code getNodeName}.721*722* @return the node name, as a {@code String}.723*/724public String getLocalName() {725return nodeName;726}727728// Methods from Element729730731/**732* Equivalent to {@code getNodeName}.733*734* @return the node name, as a {@code String}735*/736public String getTagName() {737return nodeName;738}739740/**741* Retrieves an attribute value by name.742* @param name The name of the attribute to retrieve.743* @return The {@code Attr} value as a string, or the empty string744* if that attribute does not have a specified or default value.745*/746public String getAttribute(String name) {747Attr attr = getAttributeNode(name);748if (attr == null) {749return "";750}751return attr.getValue();752}753754/**755* Equivalent to {@code getAttribute(localName)}.756*757* @see #setAttributeNS758*/759public String getAttributeNS(String namespaceURI, String localName) {760return getAttribute(localName);761}762763public void setAttribute(String name, String value) {764// Name must be valid unicode chars765boolean valid = true;766char[] chs = name.toCharArray();767for (int i=0;i<chs.length;i++) {768if (chs[i] >= 0xfffe) {769valid = false;770break;771}772}773if (!valid) {774throw new IIODOMException(DOMException.INVALID_CHARACTER_ERR,775"Attribute name is illegal!");776}777removeAttribute(name, false);778attributes.add(new IIOAttr(this, name, value));779}780781/**782* Equivalent to {@code setAttribute(qualifiedName, value)}.783*784* @see #getAttributeNS785*/786public void setAttributeNS(String namespaceURI,787String qualifiedName, String value) {788setAttribute(qualifiedName, value);789}790791public void removeAttribute(String name) {792removeAttribute(name, true);793}794795private void removeAttribute(String name, boolean checkPresent) {796int numAttributes = attributes.size();797for (int i = 0; i < numAttributes; i++) {798IIOAttr attr = attributes.get(i);799if (name.equals(attr.getName())) {800attr.setOwnerElement(null);801attributes.remove(i);802return;803}804}805806// If we get here, the attribute doesn't exist807if (checkPresent) {808throw new IIODOMException(DOMException.NOT_FOUND_ERR,809"No such attribute!");810}811}812813/**814* Equivalent to {@code removeAttribute(localName)}.815*/816public void removeAttributeNS(String namespaceURI,817String localName) {818removeAttribute(localName);819}820821public Attr getAttributeNode(String name) {822Node node = getAttributes().getNamedItem(name);823return (Attr)node;824}825826/**827* Equivalent to {@code getAttributeNode(localName)}.828*829* @see #setAttributeNodeNS830*/831public Attr getAttributeNodeNS(String namespaceURI,832String localName) {833return getAttributeNode(localName);834}835836public Attr setAttributeNode(Attr newAttr) throws DOMException {837Element owner = newAttr.getOwnerElement();838if (owner != null) {839if (owner == this) {840return null;841} else {842throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR,843"Attribute is already in use");844}845}846847IIOAttr attr;848if (newAttr instanceof IIOAttr) {849attr = (IIOAttr)newAttr;850attr.setOwnerElement(this);851} else {852attr = new IIOAttr(this,853newAttr.getName(),854newAttr.getValue());855}856857Attr oldAttr = getAttributeNode(attr.getName());858if (oldAttr != null) {859removeAttributeNode(oldAttr);860}861862attributes.add(attr);863864return oldAttr;865}866867/**868* Equivalent to {@code setAttributeNode(newAttr)}.869*870* @see #getAttributeNodeNS871*/872public Attr setAttributeNodeNS(Attr newAttr) {873return setAttributeNode(newAttr);874}875876public Attr removeAttributeNode(Attr oldAttr) {877removeAttribute(oldAttr.getName());878return oldAttr;879}880881public NodeList getElementsByTagName(String name) {882List<Node> l = new ArrayList<>();883getElementsByTagName(name, l);884return new IIONodeList(l);885}886887private void getElementsByTagName(String name, List<Node> l) {888if (nodeName.equals(name) || "*".equals(name)) {889l.add(this);890}891892Node child = getFirstChild();893while (child != null) {894((IIOMetadataNode)child).getElementsByTagName(name, l);895child = child.getNextSibling();896}897}898899/**900* Equivalent to {@code getElementsByTagName(localName)}.901*/902public NodeList getElementsByTagNameNS(String namespaceURI,903String localName) {904return getElementsByTagName(localName);905}906907public boolean hasAttributes() {908return attributes.size() > 0;909}910911public boolean hasAttribute(String name) {912return getAttributeNode(name) != null;913}914915/**916* Equivalent to {@code hasAttribute(localName)}.917*/918public boolean hasAttributeNS(String namespaceURI,919String localName) {920return hasAttribute(localName);921}922923// Methods from NodeList924925public int getLength() {926return numChildren;927}928929public Node item(int index) {930if (index < 0) {931return null;932}933934Node child = getFirstChild();935while (child != null && index-- > 0) {936child = child.getNextSibling();937}938return child;939}940941/**942* Returns the {@code Object} value associated with this node.943*944* @return the user {@code Object}.945*946* @see #setUserObject947*/948public Object getUserObject() {949return userObject;950}951952/**953* Sets the value associated with this node.954*955* @param userObject the user {@code Object}.956*957* @see #getUserObject958*/959public void setUserObject(Object userObject) {960this.userObject = userObject;961}962963// Start of dummy methods for DOM L3.964965/**966* This DOM Level 3 method is not supported for {@code IIOMetadataNode}967* and will throw a {@code DOMException}.968* @throws DOMException always.969*/970public void setIdAttribute(String name,971boolean isId)972throws DOMException {973throw new DOMException(DOMException.NOT_SUPPORTED_ERR,974"Method not supported");975}976977/**978* This DOM Level 3 method is not supported for {@code IIOMetadataNode}979* and will throw a {@code DOMException}.980* @throws DOMException always.981*/982public void setIdAttributeNS(String namespaceURI,983String localName,984boolean isId)985throws DOMException {986throw new DOMException(DOMException.NOT_SUPPORTED_ERR,987"Method not supported");988}989990/**991* This DOM Level 3 method is not supported for {@code IIOMetadataNode}992* and will throw a {@code DOMException}.993* @throws DOMException always.994*/995public void setIdAttributeNode(Attr idAttr,996boolean isId)997throws DOMException {998throw new DOMException(DOMException.NOT_SUPPORTED_ERR,999"Method not supported");1000}10011002/**1003* This DOM Level 3 method is not supported for {@code IIOMetadataNode}1004* and will throw a {@code DOMException}.1005* @throws DOMException always.1006*/1007public TypeInfo getSchemaTypeInfo() throws DOMException {1008throw new DOMException(DOMException.NOT_SUPPORTED_ERR,1009"Method not supported");1010}10111012/**1013* This DOM Level 3 method is not supported for {@code IIOMetadataNode}1014* and will throw a {@code DOMException}.1015* @throws DOMException always.1016*/1017public Object setUserData(String key,1018Object data,1019UserDataHandler handler) throws DOMException {1020throw new DOMException(DOMException.NOT_SUPPORTED_ERR,1021"Method not supported");1022}10231024/**1025* This DOM Level 3 method is not supported for {@code IIOMetadataNode}1026* and will throw a {@code DOMException}.1027* @throws DOMException always.1028*/1029public Object getUserData(String key) throws DOMException {1030throw new DOMException(DOMException.NOT_SUPPORTED_ERR,1031"Method not supported");1032}10331034/**1035* This DOM Level 3 method is not supported for {@code IIOMetadataNode}1036* and will throw a {@code DOMException}.1037* @throws DOMException always.1038*/1039public Object getFeature(String feature, String version)1040throws DOMException {1041throw new DOMException(DOMException.NOT_SUPPORTED_ERR,1042"Method not supported");1043}10441045/**1046* This DOM Level 3 method is not supported for {@code IIOMetadataNode}1047* and will throw a {@code DOMException}.1048* @throws DOMException always.1049*/1050public boolean isSameNode(Node node) throws DOMException {1051throw new DOMException(DOMException.NOT_SUPPORTED_ERR,1052"Method not supported");1053}10541055/**1056* This DOM Level 3 method is not supported for {@code IIOMetadataNode}1057* and will throw a {@code DOMException}.1058* @throws DOMException always.1059*/1060public boolean isEqualNode(Node node) throws DOMException {1061throw new DOMException(DOMException.NOT_SUPPORTED_ERR,1062"Method not supported");1063}10641065/**1066* This DOM Level 3 method is not supported for {@code IIOMetadataNode}1067* and will throw a {@code DOMException}.1068* @throws DOMException always.1069*/1070public String lookupNamespaceURI(String prefix) throws DOMException {1071throw new DOMException(DOMException.NOT_SUPPORTED_ERR,1072"Method not supported");1073}10741075/**1076* This DOM Level 3 method is not supported for {@code IIOMetadataNode}1077* and will throw a {@code DOMException}.1078* @throws DOMException always.1079*/1080public boolean isDefaultNamespace(String namespaceURI)1081throws DOMException {1082throw new DOMException(DOMException.NOT_SUPPORTED_ERR,1083"Method not supported");1084}10851086/**1087* This DOM Level 3 method is not supported for {@code IIOMetadataNode}1088* and will throw a {@code DOMException}.1089* @throws DOMException always.1090*/1091public String lookupPrefix(String namespaceURI) throws DOMException {1092throw new DOMException(DOMException.NOT_SUPPORTED_ERR,1093"Method not supported");1094}10951096/**1097* This DOM Level 3 method is not supported for {@code IIOMetadataNode}1098* and will throw a {@code DOMException}.1099* @throws DOMException always.1100*/1101public String getTextContent() throws DOMException {1102throw new DOMException(DOMException.NOT_SUPPORTED_ERR,1103"Method not supported");1104}11051106/**1107* This DOM Level 3 method is not supported for {@code IIOMetadataNode}1108* and will throw a {@code DOMException}.1109* @throws DOMException always.1110*/1111public void setTextContent(String textContent) throws DOMException {1112throw new DOMException(DOMException.NOT_SUPPORTED_ERR,1113"Method not supported");1114}11151116/**1117* This DOM Level 3 method is not supported for {@code IIOMetadataNode}1118* and will throw a {@code DOMException}.1119* @throws DOMException always.1120*/1121public short compareDocumentPosition(Node other)1122throws DOMException {1123throw new DOMException(DOMException.NOT_SUPPORTED_ERR,1124"Method not supported");1125}11261127/**1128* This DOM Level 3 method is not supported for {@code IIOMetadataNode}1129* and will throw a {@code DOMException}.1130* @throws DOMException always.1131*/1132public String getBaseURI() throws DOMException {1133throw new DOMException(DOMException.NOT_SUPPORTED_ERR,1134"Method not supported");1135}1136//End of dummy methods for DOM L3.113711381139}114011411142