Package rife.cmf.loader
Class ImageContentLoaderBackend
java.lang.Object
rife.cmf.loader.ImageContentLoaderBackend
- All Implemented Interfaces:
ContentLoaderBackend<Image>
- Direct Known Subclasses:
ImageIOLoader,ImageJLoader
public abstract class ImageContentLoaderBackend
extends Object
implements ContentLoaderBackend<Image>
This is an abstract class that should be implemented by all image content
loader back-ends.
The load method simply checks the
type of the data and delegates the handling to typed methods that should be
implemented by the back-ends.
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionLoads any kind of raw data and tries to accommodate as much as possible to return an instance ofInternalTypeafter successful loading and handling.protected abstract LoadedContent<Image>loadFromBytes(byte[] data, Set<String> errors) Loads the data from a byte array.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface rife.cmf.loader.ContentLoaderBackend
isBackendPresent
-
Constructor Details
-
ImageContentLoaderBackend
public ImageContentLoaderBackend()
-
-
Method Details
-
loadFromBytes
protected abstract LoadedContent<Image> loadFromBytes(byte[] data, Set<String> errors) throws ContentManagerException Loads the data from a byte array.- Parameters:
data- the raw data that has to be loadederrors- a set to which possible error messages will be added- Returns:
- an instance of the
LoadedContentwithImagedata; ornullif the raw data couldn't be loaded - Throws:
ContentManagerException
-
load
public LoadedContent<Image> load(Object data, boolean fragment, Set<String> errors) throws ContentManagerException Description copied from interface:ContentLoaderBackendLoads any kind of raw data and tries to accommodate as much as possible to return an instance ofInternalTypeafter successful loading and handling.Should any errors occur, then they will be added as text messages to the
errorscollection.- Specified by:
loadin interfaceContentLoaderBackend<Image>- Parameters:
data- the raw data that has to be loadedfragment-trueif the raw data is a fragment; orfalseif the raw data is a complete document or fileerrors- a set to which possible error messages will be added- Returns:
- an instance of the
LoadedContentwith theInternalType; ornullif the raw data couldn't be loaded - Throws:
ContentManagerException
-