Package rife.cmf.loader
Class ContentLoader<InternalType>
java.lang.Object
rife.cmf.loader.ContentLoader<InternalType>
- Direct Known Subclasses:
ImageContentLoader
,XhtmlContentLoader
This is an abstract class that needs to be extended by all the classes that
are able to load raw data and converted it to a common internal type.
Each content loader has a collection of back-ends that are able to
interpret the raw data. All that should be done by an extending class, is
implement the getBackends
method and return a
List
of supported loader back-ends.
- Since:
- 1.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract List<ContentLoaderBackend<InternalType>>
Returns a list of support content loading back-ends.Loads raw data and returns the internal type after successful loading and handling.
-
Constructor Details
-
ContentLoader
public ContentLoader()
-
-
Method Details
-
load
public LoadedContent<InternalType> load(Object data, boolean fragment, Set<String> errors) throws ContentManagerException Loads raw data and returns the internal type after successful loading and handling.Should any errors occur in the back-ends, 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 the internal type as data that is common for all loaders for the handled content type, for instancejava.awt.Image
for loaders that handle images; ornull
if the raw data couldn't be loaded - Throws:
ContentManagerException
- Since:
- 1.4
-
getBackends
Returns a list of support content loading back-ends.This method should be implemented by all concrete content loaders.
- Returns:
- the list of content loader back-ends
- Since:
- 1.0
-