Java Code Examples for javax.imageio.metadata.IIOMetadataNode#setNodeValue()

The following examples show how to use javax.imageio.metadata.IIOMetadataNode#setNodeValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Box.java    From healthcare-dicom-dicomweb-adapter with Apache License 2.0 6 votes vote down vote up
/** Creates an <code>IIOMetadataNode</code> from this
   *  box.  The format of this node is defined in the XML dtd and xsd
   *  for the JP2 image file.
   *
   *  This method is designed for the types of boxes whose XML tree
   *  only has 2 levels.
   */
  protected IIOMetadataNode getNativeNodeForSimpleBox() {
      try {
          Method m = this.getClass().getMethod("getElementNames",
                                               (Class[])null);
          String[] elementNames = (String[])m.invoke(null, (Object[])null);

          IIOMetadataNode node = new IIOMetadataNode(Box.getName(getType()));
          setDefaultAttributes(node);
          for (int i = 0; i < elementNames.length; i++) {
              IIOMetadataNode child = new IIOMetadataNode(elementNames[i]);
              m = this.getClass().getMethod("get" + elementNames[i],
                                            (Class[])null);
Object obj = m.invoke(this, (Object[])null);
              child.setUserObject(obj);
child.setNodeValue(ImageUtil.convertObjectToString(obj));
              node.appendChild(child);
          }
          return node;
      } catch (Exception e) {
          throw new IllegalArgumentException(I18N.getString("Box0"));
      }
  }
 
Example 2
Source File: WBMPMetadata.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private IIOMetadataNode addChildNode(IIOMetadataNode root,
                                     String name,
                                     Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(ImageUtil.convertObjectToString(object));
    }
    root.appendChild(child);
    return child;
}
 
Example 3
Source File: WBMPMetadata.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private IIOMetadataNode addChildNode(IIOMetadataNode root,
                                     String name,
                                     Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(ImageUtil.convertObjectToString(object));
    }
    root.appendChild(child);
    return child;
}
 
Example 4
Source File: WBMPMetadata.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private IIOMetadataNode addChildNode(IIOMetadataNode root,
                                     String name,
                                     Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(ImageUtil.convertObjectToString(object));
    }
    root.appendChild(child);
    return child;
}
 
Example 5
Source File: WBMPMetadata.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private IIOMetadataNode addChildNode(IIOMetadataNode root,
                                     String name,
                                     Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(ImageUtil.convertObjectToString(object));
    }
    root.appendChild(child);
    return child;
}
 
Example 6
Source File: SIMPMetadata.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private IIOMetadataNode addChildNode(IIOMetadataNode root,
                                     String name,
                                     Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(object.toString());
    }
    root.appendChild(child);
    return child;
}
 
Example 7
Source File: BMPMetadata.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private IIOMetadataNode addChildNode(IIOMetadataNode root,
                                     String name,
                                     Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(ImageUtil.convertObjectToString(object));
    }
    root.appendChild(child);
    return child;
}
 
Example 8
Source File: BMPMetadata.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private IIOMetadataNode addChildNode(IIOMetadataNode root,
                                     String name,
                                     Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(ImageUtil.convertObjectToString(object));
    }
    root.appendChild(child);
    return child;
}
 
Example 9
Source File: WBMPMetadata.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private IIOMetadataNode addChildNode(IIOMetadataNode root,
                                     String name,
                                     Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(ImageUtil.convertObjectToString(object));
    }
    root.appendChild(child);
    return child;
}
 
Example 10
Source File: BMPMetadata.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
private IIOMetadataNode addChildNode(IIOMetadataNode root,
                                     String name,
                                     Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(ImageUtil.convertObjectToString(object));
    }
    root.appendChild(child);
    return child;
}
 
Example 11
Source File: WBMPMetadata.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private IIOMetadataNode addChildNode(IIOMetadataNode root,
                                     String name,
                                     Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(ImageUtil.convertObjectToString(object));
    }
    root.appendChild(child);
    return child;
}
 
Example 12
Source File: WBMPMetadata.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private IIOMetadataNode addChildNode(IIOMetadataNode root,
                                     String name,
                                     Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(ImageUtil.convertObjectToString(object));
    }
    root.appendChild(child);
    return child;
}
 
Example 13
Source File: BMPMetadata.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private IIOMetadataNode addChildNode(IIOMetadataNode root,
                                     String name,
                                     Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(ImageUtil.convertObjectToString(object));
    }
    root.appendChild(child);
    return child;
}
 
Example 14
Source File: BMPMetadata.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private IIOMetadataNode addChildNode(IIOMetadataNode root,
                                     String name,
                                     Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(ImageUtil.convertObjectToString(object));
    }
    root.appendChild(child);
    return child;
}
 
Example 15
Source File: WBMPMetadata.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private IIOMetadataNode addChildNode(IIOMetadataNode root,
                                     String name,
                                     Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(ImageUtil.convertObjectToString(object));
    }
    root.appendChild(child);
    return child;
}
 
Example 16
Source File: Box.java    From healthcare-dicom-dicomweb-adapter with Apache License 2.0 5 votes vote down vote up
/** Creates an <code>IIOMetadataNode</code> from this
    *  box.  The format of this node is defined in the XML dtd and xsd
    *  for the JP2 image file.
    */
   public IIOMetadataNode getNativeNode() {
       String name = Box.getName(getType());
       if (name == null)
           name = "unknown";

       IIOMetadataNode node = new IIOMetadataNode(name);
       setDefaultAttributes(node);
       IIOMetadataNode child = new IIOMetadataNode("Content");
       child.setUserObject(data);
child.setNodeValue(ImageUtil.convertObjectToString(data));
       node.appendChild(child);

       return node;
   }
 
Example 17
Source File: BMPMetadata.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private IIOMetadataNode addChildNode(IIOMetadataNode root,
                                     String name,
                                     Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(ImageUtil.convertObjectToString(object));
    }
    root.appendChild(child);
    return child;
}
 
Example 18
Source File: WBMPMetadata.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private IIOMetadataNode addChildNode(IIOMetadataNode root,
                                     String name,
                                     Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(ImageUtil.convertObjectToString(object));
    }
    root.appendChild(child);
    return child;
}
 
Example 19
Source File: WBMPMetadata.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private IIOMetadataNode addChildNode(IIOMetadataNode root,
                                     String name,
                                     Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(ImageUtil.convertObjectToString(object));
    }
    root.appendChild(child);
    return child;
}
 
Example 20
Source File: BMPMetadata.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private IIOMetadataNode addChildNode(IIOMetadataNode root,
                                     String name,
                                     Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(ImageUtil.convertObjectToString(object));
    }
    root.appendChild(child);
    return child;
}