Examples of UnsupportedDataTypeException


Examples of au.net.causal.projo.prefs.UnsupportedDataTypeException

  @Override
  protected <T> void putValueImpl(String key, T value, PreferenceKeyMetadata<T> metadata) throws UnsupportedDataTypeException, PreferencesException
  {
    if (!isDataTypeSupported(metadata))
      throw new UnsupportedDataTypeException(metadata.getDataType());
   
    putNativeValue(key, valueDataType.cast(value));
  }
View Full Code Here

Examples of au.net.causal.projo.prefs.UnsupportedDataTypeException

  @Override
  protected <T> void removeValueImpl(String key, PreferenceKeyMetadata<T> metadata) throws UnsupportedDataTypeException, PreferencesException
  {
    if (!isDataTypeSupported(metadata))
      throw new UnsupportedDataTypeException(metadata.getDataType());
   
    keyValueMap.remove(key);
  }
View Full Code Here

Examples of com.foundationdb.server.error.UnsupportedDataTypeException

            if (columnName != null) {
                throw new UnsupportedColumnDataTypeException(schemaName, tableName, columnName,
                                                             sqlType.toString());
            }
            else {
                throw new UnsupportedDataTypeException(sqlType.toString());
            }
        }
    }
View Full Code Here

Examples of com.foundationdb.server.error.UnsupportedDataTypeException

            if (columnName != null) {
                throw new UnsupportedColumnDataTypeException(schemaName, tableName, columnName,
                                                             jdbcTypeName(jdbcType));
            }
            else {
                throw new UnsupportedDataTypeException(jdbcTypeName(jdbcType));
            }
        }       
    }
View Full Code Here

Examples of javax.activation.UnsupportedDataTypeException

    }

    public Object getContent(DataSource ds) throws IOException {
        Iterator i = ImageIO.getImageReadersByMIMEType(ds.getContentType());
        if (!i.hasNext()) {
            throw new UnsupportedDataTypeException();
        }
        ImageReader reader = (ImageReader) i.next();
        return reader.read(0);
    }
View Full Code Here

Examples of javax.activation.UnsupportedDataTypeException

    }

    public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException {
        Iterator i = ImageIO.getImageWritersByMIMEType(mimeType);
        if (!i.hasNext()) {
            throw new UnsupportedDataTypeException();
        }
        ImageWriter writer = (ImageWriter) i.next();
        writer.setOutput(os);

        if (obj instanceof RenderedImage) {
            writer.write((RenderedImage) obj);
        } else if (obj instanceof BufferedImage) {
            BufferedImage buffered = (BufferedImage) obj;
            writer.write(new IIOImage(buffered.getRaster(), null, null));
        } else if (obj instanceof Image) {
            Image image = (Image) obj;
            BufferedImage buffered = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB);
            Graphics2D graphics = buffered.createGraphics();
            graphics.drawImage(image, 0, 0, null, null);
            writer.write(new IIOImage(buffered.getRaster(), null, null));
        } else {
            throw new UnsupportedDataTypeException();
        }
        os.flush();
    }
View Full Code Here

Examples of javax.activation.UnsupportedDataTypeException

    }

    public Object getContent(DataSource ds) throws IOException {
        Iterator i = ImageIO.getImageReadersByMIMEType(ds.getContentType());
        if (!i.hasNext()) {
            throw new UnsupportedDataTypeException();
        }
        ImageReader reader = (ImageReader) i.next();
        return reader.read(0);
    }
View Full Code Here

Examples of javax.activation.UnsupportedDataTypeException

    }

    public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException {
        Iterator i = ImageIO.getImageWritersByMIMEType(mimeType);
        if (!i.hasNext()) {
            throw new UnsupportedDataTypeException();
        }
        ImageWriter writer = (ImageWriter) i.next();
        writer.setOutput(os);

        if (obj instanceof RenderedImage) {
            writer.write((RenderedImage) obj);
        } else if (obj instanceof BufferedImage) {
            BufferedImage buffered = (BufferedImage) obj;
            writer.write(new IIOImage(buffered.getRaster(), null, null));
        } else if (obj instanceof Image) {
            Image image = (Image) obj;
            BufferedImage buffered = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB);
            Graphics2D graphics = buffered.createGraphics();
            graphics.drawImage(image, 0, 0, null, null);
            writer.write(new IIOImage(buffered.getRaster(), null, null));
        } else {
            throw new UnsupportedDataTypeException();
        }
        os.flush();
    }
View Full Code Here

Examples of javax.activation.UnsupportedDataTypeException

    }

    public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException {
        Iterator i = ImageIO.getImageWritersByMIMEType(mimeType);
        if (!i.hasNext()) {
            throw new UnsupportedDataTypeException("Unknown image type " + mimeType);
        }
        ImageWriter writer = (ImageWriter) i.next();
        writer.setOutput(os);

        if (obj instanceof RenderedImage) {
            writer.write((RenderedImage) obj);
        } else if (obj instanceof BufferedImage) {
            BufferedImage buffered = (BufferedImage) obj;
            writer.write(new IIOImage(buffered.getRaster(), null, null));
        } else if (obj instanceof Image) {
            Image image = (Image) obj;
            BufferedImage buffered = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB);
            Graphics2D graphics = buffered.createGraphics();
            graphics.drawImage(image, 0, 0, null, null);
            writer.write(new IIOImage(buffered.getRaster(), null, null));
        } else {
            throw new UnsupportedDataTypeException("Unknown image type " + obj.getClass().getName());
        }
        os.flush();
    }
View Full Code Here

Examples of javax.activation.UnsupportedDataTypeException

    }

    public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException {
        Iterator i = ImageIO.getImageWritersByMIMEType(mimeType);
        if (!i.hasNext()) {
            throw new UnsupportedDataTypeException("Unknown image type " + mimeType);
        }
        ImageWriter writer = (ImageWriter) i.next();
        writer.setOutput(os);

        if (obj instanceof RenderedImage) {
            writer.write((RenderedImage) obj);
        } else if (obj instanceof BufferedImage) {
            BufferedImage buffered = (BufferedImage) obj;
            writer.write(new IIOImage(buffered.getRaster(), null, null));
        } else if (obj instanceof Image) {
            Image image = (Image) obj;
            BufferedImage buffered = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB);
            Graphics2D graphics = buffered.createGraphics();
            graphics.drawImage(image, 0, 0, null, null);
            writer.write(new IIOImage(buffered.getRaster(), null, null));
        } else {
            throw new UnsupportedDataTypeException("Unknown image type " + obj.getClass().getName());
        }
        os.flush();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.