src/share/classes/javax/imageio/metadata/IIOMetadataNode.java

Print this page




 288     private List<IIOAttr> attributes = new ArrayList<>();
 289 
 290     /**
 291      * Constructs an empty <code>IIOMetadataNode</code>.
 292      */
 293     public IIOMetadataNode() {}
 294 
 295     /**
 296      * Constructs an <code>IIOMetadataNode</code> with a given node
 297      * name.
 298      *
 299      * @param nodeName the name of the node, as a <code>String</code>.
 300      */
 301     public IIOMetadataNode(String nodeName) {
 302         this.nodeName = nodeName;
 303     }
 304 
 305     /**
 306      * Check that the node is either <code>null</code> or an
 307      * <code>IIOMetadataNode</code>.



 308      */
 309     private void checkNode(Node node) throws DOMException {
 310         if (node == null) {
 311             return;
 312         }
 313         if (!(node instanceof IIOMetadataNode)) {
 314             throw new IIODOMException(DOMException.WRONG_DOCUMENT_ERR,
 315                                       "Node not an IIOMetadataNode!");
 316         }
 317     }
 318 
 319     // Methods from Node
 320 
 321     /**
 322      * Returns the node name associated with this node.
 323      *
 324      * @return the node name, as a <code>String</code>.
 325      */
 326     public String getNodeName() {
 327         return nodeName;




 288     private List<IIOAttr> attributes = new ArrayList<>();
 289 
 290     /**
 291      * Constructs an empty <code>IIOMetadataNode</code>.
 292      */
 293     public IIOMetadataNode() {}
 294 
 295     /**
 296      * Constructs an <code>IIOMetadataNode</code> with a given node
 297      * name.
 298      *
 299      * @param nodeName the name of the node, as a <code>String</code>.
 300      */
 301     public IIOMetadataNode(String nodeName) {
 302         this.nodeName = nodeName;
 303     }
 304 
 305     /**
 306      * Check that the node is either <code>null</code> or an
 307      * <code>IIOMetadataNode</code>.
 308      *
 309      * @throws DOMException if {@code node} is not {@code null} and not an
 310      * instance of {@code IIOMetadataNode}
 311      */
 312     private void checkNode(Node node) throws DOMException {
 313         if (node == null) {
 314             return;
 315         }
 316         if (!(node instanceof IIOMetadataNode)) {
 317             throw new IIODOMException(DOMException.WRONG_DOCUMENT_ERR,
 318                                       "Node not an IIOMetadataNode!");
 319         }
 320     }
 321 
 322     // Methods from Node
 323 
 324     /**
 325      * Returns the node name associated with this node.
 326      *
 327      * @return the node name, as a <code>String</code>.
 328      */
 329     public String getNodeName() {
 330         return nodeName;