1:
37:
38:
39: package ;
40:
41: import ;
42:
43: import ;
44: import ;
45:
46:
49: public abstract class ImageReaderSpi extends ImageReaderWriterSpi
50: {
51: public static final Class[] STANDARD_INPUT_TYPE =
52: { ImageInputStream.class };
53:
54: protected Class[] inputTypes;
55: protected String[] writerSpiNames;
56:
57: protected ImageReaderSpi()
58: {
59:
60: }
61:
62: public ImageReaderSpi(String vendorName, String version, String[] names,
63: String[] suffixes, String[] MIMETypes,
64: String readerClassName, Class[] inputTypes,
65: String[] writerSpiNames,
66: boolean supportsStandardStreamMetadataFormat,
67: String nativeStreamMetadataFormatName,
68: String nativeStreamMetadataFormatClassName,
69: String[] extraStreamMetadataFormatNames,
70: String[] extraStreamMetadataFormatClassNames,
71: boolean supportsStandardImageMetadataFormat,
72: String nativeImageMetadataFormatName,
73: String nativeImageMetadataFormatClassName,
74: String[] extraImageMetadataFormatNames,
75: String[] extraImageMetadataFormatClassNames)
76: {
77: super(vendorName, version, names, suffixes, MIMETypes, readerClassName,
78: supportsStandardStreamMetadataFormat, nativeStreamMetadataFormatName,
79: nativeStreamMetadataFormatClassName, extraStreamMetadataFormatNames,
80: extraStreamMetadataFormatClassNames, supportsStandardImageMetadataFormat,
81: nativeImageMetadataFormatName, nativeImageMetadataFormatClassName,
82: extraImageMetadataFormatNames, extraImageMetadataFormatClassNames);
83:
84: if (inputTypes == null
85: || inputTypes.length == 0)
86: throw new IllegalArgumentException("inputTypes may not be null or empty");
87:
88: this.inputTypes = inputTypes;
89: this.writerSpiNames = writerSpiNames;
90: }
91:
92: public abstract boolean canDecodeInput(Object source)
93: throws IOException;
94:
95: public ImageReader createReaderInstance()
96: throws IOException
97: {
98: return createReaderInstance(null);
99: }
100:
101: public abstract ImageReader createReaderInstance(Object extension)
102: throws IOException;
103:
104: public String[] getImageWriterSpiNames()
105: {
106: return writerSpiNames;
107: }
108:
109: public Class[] getInputTypes()
110: {
111: return inputTypes;
112: }
113:
114: public boolean isOwnReader(ImageReader reader)
115: {
116: if (reader == null)
117: throw new IllegalArgumentException("reader may not be null");
118:
119: return pluginClassName.equals(reader.getClass().getName());
120: }
121: }