|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfnug.resource.AbstractResource
fnug.resource.DefaultResource
fnug.resource.AbstractCompiledResource
public abstract class 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 | |
---|---|
AbstractCompiledResource(String basePath,
String path)
Constructs setting base path and path. |
Method Summary | |
---|---|
boolean |
checkModified()
Ditches the compiled bytes if the superclass indicates that modified has changed. |
protected abstract byte[] |
compile(byte[] source)
Subclasses must implement to do the compilation of this resource. |
Bundle |
getBundle()
Returns the associated bundle. |
byte[] |
getBytes()
Returns the compiled bytes. |
protected byte[] |
getBytesForFindRequires()
Overridden to return the uncompiled bytes. |
void |
setBundle(Bundle bundle)
(Optionally) sets the bundle. |
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, isJs, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractCompiledResource(String basePath, String path)
basePath
- The base path of the resource. See AbstractResource.getBasePath()
.path
- The path of the resource. See AbstractResource.getPath()
.Method Detail |
---|
public Bundle getBundle()
getBundle
in interface HasBundle
public void setBundle(Bundle bundle)
bundle
- the bundle to associate resource with.public byte[] getBytes()
Resource.checkModified()
.
Notice that for resources pointing to non-existant files Resource.getBytes()
return an empty array, never null
(but Resource.getLastModified()
returns -1).
getBytes
in interface HasLastModifiedBytes
getBytes
in interface Resource
getBytes
in class AbstractResource
protected byte[] getBytesForFindRequires()
getBytesForFindRequires
in class DefaultResource
AbstractResource.getBytes()
public boolean checkModified()
Resource.getBytes()
or Resource.getLastModified()
.
checkModified
in interface Resource
checkModified
in class AbstractResource
protected abstract byte[] compile(byte[] source)
source
- the source bytes.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |