Examples of UnsupportedDataTypeException


Examples of javax.activation.UnsupportedDataTypeException

      }else if (GeneralConstants.TEXT.equals(type)){
        DomUtils.appendText(doc, parentElement, zoomInNode.getAttributes().getValue());
      }else if (GeneralConstants.RAW.equals(type)){
        DomUtils.appendRaw(doc, parentElement, zoomInNode.getAttributes().getValue());
      }else {
        warningHandler.handleThrowable(new UnsupportedDataTypeException("type " + type ));
      }
    }
     
  }
View Full Code Here

Examples of javax.activation.UnsupportedDataTypeException

                        this.dimension = Integer.parseInt(value);
                        hasDimension = true;
                       
                    } else if (key.equals("EDGE_WEIGHT_TYPE")) {
                        if (!value.equals("EUC_2D")) {
                            throw new UnsupportedDataTypeException("Only EUC_2D edge weights are supported for now");
                        }
                    } else if (key.equals("BEST_KNOWN")) {
                        this.bestKnown = Integer.parseInt(value);
                    }
                }
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

        //Создание файлового хранилища
        logger.info("Инициализация хранилища типа {}", new Object[]{storageOptions.getClassName()});
        Class<?> sourceClass = Class.forName(storageOptions.getClassName());
        Object object = sourceClass.newInstance();
        if (!(object instanceof PackageSource)) {
            throw new UnsupportedDataTypeException("Класс " + sourceClass + " не является хранилищем пакетов");
        }
        @SuppressWarnings("unchecked")
        PackageSource<Nupkg> newSource = (PackageSource) object;
        newSource.setName(storageOptions.getStorageName());
        setObjectProperties(storageOptions.getProperties(), object);
View Full Code Here

Examples of javax.activation.UnsupportedDataTypeException

     */
    protected <T> T createTrigger(TriggerOptions triggerOptions, Class<T> triggerClass) throws Exception {
        logger.info("Создание триггера типа {}", new Object[]{triggerOptions.getClassName()});
        Class<?> sourceClass = Class.forName(triggerOptions.getClassName());
        if (!triggerClass.isAssignableFrom(sourceClass)) {
            throw new UnsupportedDataTypeException("Класс " + sourceClass
                    + " не является " + BeforeTrigger.class.getCanonicalName());
        }
        Object object = sourceClass.newInstance();
        @SuppressWarnings("unchecked")
        T trigger = (T) object;
View Full Code Here

Examples of javax.activation.UnsupportedDataTypeException

    }

    @Override
    public InputStream getStream() throws IOException {
        if (file == null || !file.exists()) {
            throw new UnsupportedDataTypeException("Не найден файл пакета");
        } else {
            return new FileInputStream(file);
        }
    }
View Full Code Here

Examples of javax.activation.UnsupportedDataTypeException

      Object vbVal = vb.getValue(getFacesContext());
      if (vbVal instanceof Collection) {
        return (Collection<String>) vbVal;
      } else {
        try {
          throw new UnsupportedDataTypeException("Value is not a Collection");
        } catch (UnsupportedDataTypeException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }
View Full Code Here

Examples of javax.activation.UnsupportedDataTypeException

      Object vbVal = vb.getValue(getFacesContext());
      if (vbVal instanceof Map) {
        return (Map<String, String>) vbVal;
      } else {
        try {
          throw new UnsupportedDataTypeException("Value is not a map");
        } catch (UnsupportedDataTypeException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }
View Full Code Here

Examples of javax.activation.UnsupportedDataTypeException

        Enum[] enums = enumClass.getEnumConstants();
        for (Enum e : enums) {
          opts.put(e.name(), enumClass.getName() + " " + e.name());
        }
      } else {
        throw new UnsupportedDataTypeException("Value is not an Enum");
      }
    } catch (Throwable t) {
      DominoUtils.handleException(t);
    }
    super.setOptions(opts);
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.