aboutsummaryrefslogtreecommitdiff
path: root/library/src/main/java/com/davemorrissey/labs/subscaleview/decoder/DecoderFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'library/src/main/java/com/davemorrissey/labs/subscaleview/decoder/DecoderFactory.java')
-rw-r--r--library/src/main/java/com/davemorrissey/labs/subscaleview/decoder/DecoderFactory.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/library/src/main/java/com/davemorrissey/labs/subscaleview/decoder/DecoderFactory.java b/library/src/main/java/com/davemorrissey/labs/subscaleview/decoder/DecoderFactory.java
new file mode 100644
index 0000000..4b521c8
--- /dev/null
+++ b/library/src/main/java/com/davemorrissey/labs/subscaleview/decoder/DecoderFactory.java
@@ -0,0 +1,21 @@
+package com.davemorrissey.labs.subscaleview.decoder;
+
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * Interface for {@link ImageDecoder} and {@link ImageRegionDecoder} factories.
+ * @param <T> the class of decoder that will be produced.
+ */
+public interface DecoderFactory<T> {
+
+ /**
+ * Produce a new instance of a decoder with type {@link T}.
+ * @return a new instance of your decoder.
+ * @throws IllegalAccessException if the factory class cannot be instantiated.
+ * @throws InstantiationException if the factory class cannot be instantiated.
+ * @throws NoSuchMethodException if the factory class cannot be instantiated.
+ * @throws InvocationTargetException if the factory class cannot be instantiated.
+ */
+ T make() throws IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException;
+
+}