01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: RawContentTransformer.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.cmf.transform;
09:
10: import com.uwyn.rife.cmf.dam.exceptions.ContentManagerException;
11: import java.io.InputStream;
12: import java.util.Map;
13:
14: /**
15: * This interface defines the API that has to be implemented by classes that
16: * are capable of transforming raw content data after it's initially loaded.
17: * <p>The content attributes are provided to the {@link
18: * #transform(InputStream data, Map attributes) transform} method and can be
19: * used to provide hints for the transformation.
20: *
21: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
22: * @version $Revision: 3634 $
23: * @since 1.0
24: * @see ContentTransformer
25: */
26: public interface RawContentTransformer extends
27: ContentTransformer<InputStream> {
28: /**
29: * Transforms the raw content data and returns the transformed data as an
30: * array of bytes.
31: *
32: * @param data the raw data that has to be transformed
33: * @param attributes a map of content attributes that can be used to
34: * provide hints or parameters for the transformation
35: * @return the transformed data
36: * @since 1.0
37: */
38: public InputStream transform(InputStream data,
39: Map<String, String> attributes)
40: throws ContentManagerException;
41: }
|