Examples of UnsupportedTypeException


Examples of net.sourceforge.jiu.codecs.UnsupportedTypeException

    if (!(image instanceof Paletted8Image ||
          image instanceof Gray8Image ||
          image instanceof BilevelImage ||
          image instanceof RGB24Image))
    {
      throw new UnsupportedTypeException("Unsupported image type: " + image.getClass().getName());
    }
    // 2 is output stream available?
    out = getOutputAsDataOutput();
    if (out == null)
    {
View Full Code Here

Examples of net.sourceforge.jiu.codecs.UnsupportedTypeException

    {
      save(out, (RGB24Image)image);
    }
    else
    {
      throw new UnsupportedTypeException("Unsupported image type: " + image.getClass().getName());
    }
  }
View Full Code Here

Examples of net.sourceforge.jiu.codecs.UnsupportedTypeException

      case(JPEGConstants.MARKER_SOFB):
      case(JPEGConstants.MARKER_SOFD):
      case(JPEGConstants.MARKER_SOFE):
      case(JPEGConstants.MARKER_SOFF):
      {
        throw new UnsupportedTypeException(
          "Unsupported JPEG SOF type: " + Integer.toHexString(marker));
      }
      case(JPEGConstants.MARKER_SOS):
      {
        JPEGMarkerReader.readStartOfScan(in, jpegData, length);
View Full Code Here

Examples of net.sourceforge.jiu.codecs.UnsupportedTypeException

    }
    if (colorMode != COLOR_MODE_RGB_TRUECOLOR &&
        colorMode != COLOR_MODE_GRAYSCALE &&
        colorMode != COLOR_MODE_INDEXED)
    {
      throw new UnsupportedTypeException("Cannot load image. Only RGB" +
        " truecolor and indexed color are supported for PSD files. " +
        "Found: " +getColorTypeName(colorMode));
    }
    if (depth != 8)
    {
      throw new UnsupportedTypeException("Cannot load image. Only a depth of 8 bits " +
        "per channel is supported (found " + depth +
        " bits).");
    }

    // COLOR MODE DATA
    int colorModeSize = in.readInt();
    //System.out.println("colorModeSize=" + colorModeSize);
    byte[] colorMap = null;
    if (colorMode == COLOR_MODE_INDEXED)
    {
      if (colorModeSize != 768)
      {
        throw new InvalidFileStructureException("Cannot load image." +
          " Color map length was expected to be 768 (found " +
          colorModeSize + ").");
      }
      colorMap = new byte[colorModeSize];
      in.readFully(colorMap);
      palette = new Palette(256, 255);
      for (int index = 0; index < 256; index++)
      {
        palette.putSample(Palette.INDEX_RED, index, colorMap[index] & 0xff);
        palette.putSample(Palette.INDEX_GREEN, index, colorMap[256 + index] & 0xff);
        palette.putSample(Palette.INDEX_BLUE, index, colorMap[512 + index] & 0xff);
      }
    }
    else
    {
      in.skipBytes(colorModeSize);
    }
    // IMAGE RESOURCES
    int resourceLength = in.readInt();
    in.skipBytes(resourceLength);
    //System.out.println("resourceLength=" + resourceLength);
    // LAYER AND MASK INFORMATION
    int miscLength = in.readInt();
    in.skipBytes(miscLength);
    //System.out.println("miscLength=" + miscLength);
    // IMAGE DATA
    compression = in.readShort();
    if (compression != COMPRESSION_NONE && compression != COMPRESSION_PACKBITS)
    {
      throw new UnsupportedTypeException("Cannot load image. Unsupported PSD " +
        "compression type (" + compression + ")");
    }
    //System.out.println("compression=" + compression);
    loadImageData();
  }
View Full Code Here

Examples of net.windwards.options.err.UnsupportedTypeException

        Class<? extends ValueParser> parserKlazz = annotation.valueParser();
        if (parserKlazz != NullValueParser.class) {
            try {
                this.valueParser = parserKlazz.newInstance();
            } catch (Exception e) {
                throw new UnsupportedTypeException("Failed to instantiate " +
                        "value parser " + parserKlazz.getName() +
                        " for option --" + this.longOptionName);
            }
        } else if (type.isEnum()) {
            this.valueParser = new EnumValueParser();
            Object[] constants = type.getEnumConstants();
            this.alternatives = new HashSet<String>();
            for (Object enumValue : constants) {
                this.alternatives.add(enumValue.toString());
            }
        } else {
            this.valueParser = parsers.get(type);
            if(this.valueParser == null)
                throw new UnsupportedTypeException("Internal error: Option --" +
                        this.longOptionName + " has unsupported type " + type.getName());
        }
    }
View Full Code Here

Examples of net.windwards.options.err.UnsupportedTypeException

/**
* Created by quest on 2013-06-06.
*/
public class NullValueParser implements ValueParser {
    public Object parse(OptionDescription desc, Class<?> type, String value) throws InvalidOptionValue {
        throw new UnsupportedTypeException("Internal error: Option --" +
                desc.longOptionName + " has unsupported type " + type.getName());
    }
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.model.UnsupportedTypeException

        String field = "urn:the.field:used.for.this.Test";
        Representation rep = createRepresentation(null);
        Object value = getUnsupportedValueInstance();
        if (value == null) { // any type is supported by the representation
            // this test is not needed therefore return an dummy Exception
            throw new UnsupportedTypeException(Object.class,
                    "dummy exception to successfully complete this unnecessary test");
        } else {
            Class<?> unsupported = value.getClass();
            rep.get(field, unsupported);
        }
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.model.UnsupportedTypeException

        String field = "urn:the.field:used.for.this.Test";
        Representation rep = createRepresentation(null);
        Object value = getUnsupportedValueInstance();
        if (value == null) { // any type is supported by the representation
            // this test is not needed therefore return an dummy Exception
            throw new UnsupportedTypeException(Object.class,
                    "dummy exception to successfully complete this unnecessary test");
        } else {
            Class<?> unsupported = value.getClass();
            rep.getFirst(field, unsupported);
        }
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.model.UnsupportedTypeException

            testRef(unsupported);
        } else {
            // no unsupported types ... this test is not necessary
            // -> create a dummy exception
            // TODO: is there a way to deactivate a test if not valid
            throw new UnsupportedTypeException(Object.class,
                    "dummy exception to successfully complete this unnecessary test");
        }
    }
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.model.UnsupportedTypeException

            getValueFactory().createText(unsupported);
        } else {
            // no unsupported types ... this test is not necessary
            // -> create a dummy exception
            // TODO: is there a way to deactivate a test if not valid
            throw new UnsupportedTypeException(Object.class,
                    "dummy exception to successfully complete this unnecessary test");
        }
    }
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.