|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfnug.resource.DefaultBundle
public class DefaultBundle
Default implementation of Bundle
.
Field Summary |
---|
Fields inherited from interface fnug.resource.Bundle |
---|
BUNDLE_ALLOWED_CHARS |
Constructor Summary | |
---|---|
DefaultBundle(BundleConfig config)
Constructs a bundle from the given config object. |
Method Summary | |
---|---|
boolean |
checkModified()
Checks whether this bundle is modified by calling checkModified() on the Bundle.getResourceCollections() . |
BundleConfig |
getConfig()
Returns the config that this bundle was built from. |
JSLintWrapper |
getJsLinter()
Returns the configured JSLint instance for the bundle. |
long |
getLastModified()
Returns the last modified date of this bundle which comprises the most recent date of the Bundle.getConfig()
and all the Bundle.getResourceCollections() resources last modified dates. |
String |
getName()
The name of this bundle. |
ResourceCollection[] |
getResourceCollections()
Each bundle configures up a number of resources (files) that comprises the bundle, see BundleConfig.files() . |
protected Resource |
makeResource(String path)
Can be overridden to provide other implementations of Resource than the DefaultBundleResource . |
Resource |
resolve(String path)
Resolves a resource under this bundle's base path (see BundleConfig.basePath()
Resource.getBasePath() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultBundle(BundleConfig config)
config
- config to construct from.Method Detail |
---|
public BundleConfig getConfig()
getConfig
in interface Bundle
public String getName()
getName
in interface Bundle
public Resource resolve(String path)
BundleConfig.basePath()
Resource.getBasePath()
. The bundle returns the corresponding Resource
regardless of whether it
exists or not (never return null). If the underlying file does not exist, the resource returned have an empty
array of bytes in Resource.getBytes()
and a Resource.getLastModified()
of -1.
resolve
in interface Bundle
path
- The path to resolve under this bundle. This must never start with /. See Resource.getPath()
.
protected Resource makeResource(String path)
Resource
than the DefaultBundleResource
.
path
- the path to construct a resource around.
DefaultBundleResource
.public ResourceCollection[] getResourceCollections()
BundleConfig.files()
. Each of these resources may in turn have dependencies on other resources,
potentially from other bundles. This method returns an array where each element holds resolved dependent
resources for a bundle, the order is important, since that's the resolved order in which the resources/bundles
must be loaded to satisfy the dependency chains.
getResourceCollections
in interface Bundle
public long getLastModified()
Bundle.getConfig()
and all the Bundle.getResourceCollections()
resources last modified dates.
getLastModified
in interface Bundle
public boolean checkModified()
Bundle.getResourceCollections()
. This
does not call checkModified() on the BundleConfig.configResource()
since that is being checked by the
Resolver
. If any resource is found to have changed, the built Bundle.getResourceCollections()
are
dropped and (lazily) rebuilt.
checkModified
in interface Bundle
public JSLintWrapper getJsLinter()
BundleConfig.jsLintArgs()
is an non-empty array.
getJsLinter
in interface Bundle
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |