org.weborganic.bastille.web
Class BundleConfig

java.lang.Object
  extended by org.weborganic.bastille.web.BundleConfig
All Implemented Interfaces:
Serializable

public final class BundleConfig
extends Object
implements Serializable

The configuration for the bundling for a given type.

Stores the bundles definitions and instantiate bundles.

See Also:
Serialized Form

Nested Class Summary
static class BundleConfig.Type
           
 
Method Summary
 WebBundleTool bundler()
           
 List<org.weborganic.bastille.web.BundleDefinition> definitions()
           
 List<File> getBundles(Service service)
           
 List<org.weborganic.bastille.web.BundleInstance> getInstances(Service service)
          Creates new instance of a bundle configuration for the specific service.
 long getLastModifiedBundle(Service service)
           
 List<String> getPaths(Service service)
           
 String location()
           
 boolean minimize()
           
static BundleConfig newInstance(String name, BundleConfig.Type type, File root)
          Creates new instance of a bundle configuration.
 File root()
           
 File store()
           
 BundleConfig.Type type()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

definitions

public List<org.weborganic.bastille.web.BundleDefinition> definitions()
Returns:
bundle definitions.

type

public BundleConfig.Type type()
Returns:
the type of bundle.

minimize

public boolean minimize()
Returns:
true to minimize the code; false otherwise.

location

public String location()
Returns:
Path to where the bundles should be stored.

root

public File root()
Returns:
The root of the web application.

store

public File store()
Returns:
Where the bundles are stored

bundler

public WebBundleTool bundler()
Returns:
The bundler.

getBundles

public List<File> getBundles(Service service)
Parameters:
service - The service.
Returns:
the list of bundles for this service

getLastModifiedBundle

public long getLastModifiedBundle(Service service)
Parameters:
service - The service.
Returns:
the last modified bundle file for this service

getPaths

public List<String> getPaths(Service service)
Parameters:
service - The service.
Returns:
the list of paths for this service

getInstances

public List<org.weborganic.bastille.web.BundleInstance> getInstances(Service service)
Creates new instance of a bundle configuration for the specific service.

Returns:
the corresponding configuration.

newInstance

public static BundleConfig newInstance(String name,
                                       BundleConfig.Type type,
                                       File root)
Creates new instance of a bundle configuration.

Parameters:
name - The name of the config.
type - The type "js" or "css".
root - The root of the web application.
Returns:
the corresponding configuration.