org.tinyjee.maven.dim.sources
Class SourceClassAdapter
java.lang.Object
org.tinyjee.maven.dim.spi.AbstractSource
org.tinyjee.maven.dim.sources.AbstractBufferedSource
org.tinyjee.maven.dim.sources.SourceClassAdapter
- All Implemented Interfaces:
- Source
public class SourceClassAdapter
- extends AbstractBufferedSource
Adapts a source class to the source interface.
- Version:
- 1.0
- Author:
- Juergen_Kellerer, 2010-09-04
Field Summary |
static String |
LEGACY_CONTENT_MAP_KEY
Defines the map key to use for retrieving the source content from the Map defined with the wrapped class. |
LEGACY_CONTENT_MAP_KEY
public static final String LEGACY_CONTENT_MAP_KEY
- Defines the map key to use for retrieving the source content from the Map defined with the wrapped class.
Note: A source class can decide to return an instance of
Map<Integer, List<String>>
when queried for the key defined by this constant.
- See Also:
- Constant Field Values
SourceClassAdapter
public SourceClassAdapter(File basePath,
Map requestParams,
String className)
- Creates a new instance of SourceClassAdapter.
- Parameters:
basePath
- the base path containing the "target/classes" folder.requestParams
- the params of the macro request (are optionally passed to the object instance).className
- the name of the class to adapt.
getContent
public Source.Content getContent()
- Description copied from interface:
Source
- Retrieves the source content.
- Specified by:
getContent
in interface Source
- Overrides:
getContent
in class AbstractBufferedSource
- Returns:
- the source content.
writeSourceContent
protected void writeSourceContent(Writer writer)
throws IOException
- Description copied from class:
AbstractBufferedSource
- Is called when the source content has to be created.
- Specified by:
writeSourceContent
in class AbstractBufferedSource
- Parameters:
writer
- the writer to write the source content to.
- Throws:
IOException
- in case of writing failed.