com.uwyn.rife.cmf.loader
Class ContentLoader<InternalType>

java.lang.Object
  extended by com.uwyn.rife.cmf.loader.ContentLoader<InternalType>
Direct Known Subclasses:
ImageContentLoader, XhtmlContentLoader

public abstract class ContentLoader<InternalType>
extends Object

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
Version:
$Revision: 3634 $
Author:
Geert Bevin (gbevin[remove] at uwyn dot com)
See Also:
ContentLoaderBackend

Constructor Summary
ContentLoader()
           
 
Method Summary
abstract  List<ContentLoaderBackend<InternalType>> getBackends()
          Returns a list of support content loading back-ends.
 InternalType load(Object data, boolean fragment, Set<String> errors)
          Loads raw data and returns the internal type after successful loading and handling.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentLoader

public ContentLoader()
Method Detail

load

public 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 loaded
fragment - true if the raw data is a fragment; or

false if the raw data is a complete document or file

errors - a set to which possible error messages will be added
Returns:
an instance of the internal type that is common for all loaders for the handled content type, for instance java.awt.Image for loaders that handle images; or

null if the raw data couldn't be loaded

Throws:
ContentManagerException
Since:
1.0

getBackends

public abstract List<ContentLoaderBackend<InternalType>> 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


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.