com.uwyn.rife.cmf.loader
Interface ContentLoaderBackend<InternalType>

All Known Implementing Classes:
ImageContentLoaderBackend, ImageIOLoader, ImageJLoader, ImageroReaderLoader, JaiLoader, Jdk14Loader, JimiLoader, JMagickLoader, 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
Version:
$Revision: 3634 $
Author:
Geert Bevin (gbevin[remove] at uwyn dot com)

Method Summary
 boolean isBackendPresent()
          Indicates whether the back-end is present.
 InternalType load(Object data, boolean fragment, Set<String> errors)
          Loads any kind of raw data and tries to accommodate as much as possible to return an instance of InternalType after successful loading and handling.
 

Method Detail

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; or

false if this is not the case

Since:
1.0

load

InternalType load(Object data,
                  boolean fragment,
                  Set<String> errors)
Loads any kind of raw data and tries to accommodate as much as possible to return an instance of InternalType 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 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 InternalType; or

null if the raw data couldn't be loaded

Since:
1.0


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