org.specrunner.source.resource
Interface IResourceManager

All Superinterfaces:
Collection<IResource>, Iterable<IResource>, List<IResource>
All Known Implementing Classes:
ResourceManagerImpl

public interface IResourceManager
extends List<IResource>

Generic resource manager.

Author:
Thiago Santos.

Field Summary
static Boolean DEFAULT_ADD_RESOURCES
          Add resources status.
static String FEATURE_ADD_RESOURCES
          Add resources (i.e. specrunner.js and specrunner.css) to final result.
 
Method Summary
 IResource addCss(String path, boolean classpath, EType ref)
          Adds a CSS to the head end.
 IResource addCss(String path, boolean classpath, EType ref, Position position)
          Adds a CSS specified by path to a given position.
 void addDefaultCss()
          Add default CSS files.
 void addDefaultJs()
          Add default JavaScript files.
 IResource addJs(String path, boolean classpath, EType ref)
          Adds a JS specified by path to a given position.
 IResource addJs(String path, boolean classpath, EType ref, Position position)
          Adds a JS specified by path to a given position.
 ISource getParent()
          The resource manager parent source.
 void merge(IResourceManager resources)
          Import resources from other manager.
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Field Detail

FEATURE_ADD_RESOURCES

static final String FEATURE_ADD_RESOURCES
Add resources (i.e. specrunner.js and specrunner.css) to final result.


DEFAULT_ADD_RESOURCES

static final Boolean DEFAULT_ADD_RESOURCES
Add resources status.

Method Detail

getParent

ISource getParent()
The resource manager parent source.

Returns:
The parent.

addDefaultCss

void addDefaultCss()
                   throws ResourceException
Add default CSS files. By default 'specrunner.css' and 'specrunner_debug.css' are added, the former always, and the remainder when debug log is enabled.

Throws:
ResourceException - On add errors.

addDefaultJs

void addDefaultJs()
                  throws ResourceException
Add default JavaScript files. By default 'specrunner.js' and 'jquery.js' are added.

Throws:
ResourceException - On add errors.

addCss

IResource addCss(String path,
                 boolean classpath,
                 EType ref)
                 throws ResourceException
Adds a CSS to the head end.

Parameters:
path - The reference to the resource.
classpath - true, to find in classpath, false, to find in file system.
ref - The resource type.
Returns:
The source after add changes are reflected.
Throws:
ResourceException - On add errors.

addCss

IResource addCss(String path,
                 boolean classpath,
                 EType ref,
                 Position position)
                 throws ResourceException
Adds a CSS specified by path to a given position.

Parameters:
path - The reference to the resource.
classpath - true, to find in classpath, false, to find in file system.
ref - The resource type.
position - The position to place the resource in the source reference.
Returns:
The source after add changes are reflected.
Throws:
ResourceException - On add errors.

addJs

IResource addJs(String path,
                boolean classpath,
                EType ref)
                throws ResourceException
Adds a JS specified by path to a given position.

Parameters:
path - The reference to the resource.
classpath - true, to find in classpath, false, to find in file system.
ref - The resource type.
Returns:
The source after add changes are reflected.
Throws:
ResourceException - On add errors.

addJs

IResource addJs(String path,
                boolean classpath,
                EType ref,
                Position position)
                throws ResourceException
Adds a JS specified by path to a given position.

Parameters:
path - The reference to the resource.
classpath - true, to find in classpath, false, to find in file system.
ref - The resource type.
position - The position to place the resource in the source reference.
Returns:
The source after add changes are reflected.
Throws:
ResourceException - On add errors.

merge

void merge(IResourceManager resources)
Import resources from other manager.

Parameters:
resources - Resources to the copied.


Copyright © 2014. All rights reserved.