org.tinyjee.maven.dim.spi
Class AbstractSource

java.lang.Object
  extended by org.tinyjee.maven.dim.spi.AbstractSource
All Implemented Interfaces:
Source
Direct Known Subclasses:
AbstractBufferedSource, FixedContentSource, UrlSource

public abstract class AbstractSource
extends Object
implements Source

Base implementation for sources.

Author:
Juergen_Kellerer, 2011-10-19

Nested Class Summary
protected  class AbstractSource.SourceContent
          Base implementation for source content.
 
Nested classes/interfaces inherited from interface org.tinyjee.maven.dim.spi.Source
Source.Content
 
Field Summary
protected  Map<String,Object> parameters
           
protected  URL sourceUrl
           
 
Constructor Summary
protected AbstractSource(URL sourceUrl, Map<String,Object> parameters)
          Constructs a new instance of AbstractSource.
 
Method Summary
 Source.Content getContent()
          Retrieves the source content.
 URL getUrl()
          Returns the underlying source URL or 'null' if this Source doesn't refer to an URL.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sourceUrl

protected final URL sourceUrl

parameters

protected final Map<String,Object> parameters
Constructor Detail

AbstractSource

protected AbstractSource(URL sourceUrl,
                         Map<String,Object> parameters)
Constructs a new instance of AbstractSource.

Parameters:
sourceUrl - the source 'url' or null if the source is not bound to an url.
parameters - the macro parameters assigned with this source.
Method Detail

getUrl

public URL getUrl()
Description copied from interface: Source
Returns the underlying source URL or 'null' if this Source doesn't refer to an URL.

Specified by:
getUrl in interface Source
Returns:
the underlying source URL or 'null' if this Source doesn't refer to an URL.

getContent

public Source.Content getContent()
Description copied from interface: Source
Retrieves the source content.

Specified by:
getContent in interface Source
Returns:
the source content.

toString

public String toString()
Overrides:
toString in class Object