Package rife.cmf.loader
Interface ContentLoaderBackend<InternalType>
- All Known Implementing Classes:
ImageContentLoaderBackend
,ImageIOLoader
,ImageJLoader
,SAXLoader
,XhtmlContentLoaderBackend
public interface ContentLoaderBackend<InternalType>
This is an interface that should be implemented by all content loader
back-ends.
All content loader back-ends that are fronted by the same ContentLoader
should handle the same InternalType
, which is
returned by the load
method.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether the back-end is present.Loads any kind of raw data and tries to accommodate as much as possible to return an instance ofInternalType
after successful loading and handling.
-
Method Details
-
isBackendPresent
boolean isBackendPresent()Indicates whether the back-end is present.This can be important for optional libraries that should only actually try to load the data when the required classes are available in the classpath.
- Returns:
true
if the back-end is present; orfalse
if this is not the case- Since:
- 1.0
-
load
Loads any kind of raw data and tries to accommodate as much as possible to return an instance ofInternalType
after successful loading and handling.Should any errors occur, then they will be added as text messages to the
errors
collection.- Parameters:
data
- the raw data that has to be loadedfragment
-true
if the raw data is a fragment; orfalse
if the raw data is a complete document or fileerrors
- a set to which possible error messages will be added- Returns:
- an instance of the
LoadedContent
with theInternalType
; ornull
if the raw data couldn't be loaded - Since:
- 1.4
-