fnug.resource
Class DustCompiledResource

java.lang.Object
  extended by fnug.resource.AbstractResource
      extended by fnug.resource.DefaultResource
          extended by fnug.resource.AbstractCompiledResource
              extended by fnug.resource.DustCompiledResource
All Implemented Interfaces:
HasBundle, HasLastModifiedBytes, Resource

public class DustCompiledResource
extends AbstractCompiledResource


Nested Class Summary
 
Nested classes/interfaces inherited from class fnug.resource.AbstractResource
AbstractResource.Entry
 
Field Summary
 
Fields inherited from class fnug.resource.DefaultResource
DEFAULT_CHECK_MODIFIED_INTERVAL
 
Fields inherited from class fnug.resource.AbstractResource
CONTENT_TYPE_TEXT_CSS, CONTENT_TYPE_TEXT_JAVASCRIPT
 
Constructor Summary
DustCompiledResource(String basePath, String path)
          Constructs setting base path and path.
 
Method Summary
protected  byte[] compile(byte[] source)
          Subclasses must implement to do the compilation of this resource.
 boolean isJs()
          Dust templates are JS.
 
Methods inherited from class fnug.resource.AbstractCompiledResource
checkModified, getBundle, getBytes, getBytesForFindRequires, setBundle
 
Methods inherited from class fnug.resource.DefaultResource
decode, doGetResourceURL, extractJarFile, findRequiresTags, getResourceURL, readEntry, readLastModified, readLastModifiedAllowed
 
Methods inherited from class fnug.resource.AbstractResource
contentTypeForPath, ensureReadEntry, getBasePath, getContentType, getFullPath, getLastModified, getPath, isCss, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DustCompiledResource

public DustCompiledResource(String basePath,
                            String path)
Constructs setting base path and path.

Parameters:
basePath - The base path of the resource. See AbstractResource.getBasePath().
path - The path of the resource. See AbstractResource.getPath().
Method Detail

isJs

public boolean isJs()
Dust templates are JS. So return true.

Specified by:
isJs in interface Resource
Overrides:
isJs in class AbstractResource
Returns:
true

compile

protected byte[] compile(byte[] source)
Subclasses must implement to do the compilation of this resource.

Specified by:
compile in class AbstractCompiledResource
Parameters:
source - the source bytes.
Returns:
the compiled bytes`


Copyright © 2012. All Rights Reserved.