org.dhmp.util.stylesheet
Class ScriptCollection

java.lang.Object
  extended byorg.dhmp.util.stylesheet.ScriptCollection

public class ScriptCollection
extends java.lang.Object

Container for parsed template. If the scripts is not in the container, it looks for the template on searching directories, parse and stock the result.


Constructor Summary
ScriptCollection(java.io.File rootDirectory)
          Create a new ScriptCollection defining the directory where it looks for the template.
ScriptCollection(java.io.File rootDirectory, java.nio.charset.Charset cs)
          Create a new ScriptCollection defining the directory where it looks for the template.
ScriptCollection(java.io.File rootDirectory, java.io.File[] alternateRootDirectory)
          Create a new ScriptCollection defining the directory and alternate directories, where it looks for the template.
ScriptCollection(java.io.File rootDirectory, java.io.File[] alternateRootDirectory, java.nio.charset.Charset cs)
          Create a new ScriptCollection defining the directory and alternate directories, where it looks for the template.
ScriptCollection(java.net.URL rootURL)
          Create a new ScriptCollection defining the base url where it looks for the template.
ScriptCollection(java.net.URL rootURL, java.nio.charset.Charset cs)
          Create a new ScriptCollection defining the base url where it looks for the template.
ScriptCollection(java.net.URL rootURL, java.net.URL[] alternateURL)
           
ScriptCollection(java.net.URL rootURL, java.net.URL[] alternateURL, java.nio.charset.Charset cs)
           
 
Method Summary
 Script get(java.lang.String path)
          Retrieves the parsed template.
 Script get(java.lang.String path, java.nio.charset.Charset cs)
          Retrieves the parsed template.
 Script get(java.net.URL url)
          Retrieves the parsed template.
 Script get(java.net.URL url, java.nio.charset.Charset cs)
          Retrieves the parsed template.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptCollection

public ScriptCollection(java.net.URL rootURL)
Create a new ScriptCollection defining the base url where it looks for the template.

Parameters:
rootURL - base url where this container looks for the template

ScriptCollection

public ScriptCollection(java.net.URL rootURL,
                        java.nio.charset.Charset cs)
Create a new ScriptCollection defining the base url where it looks for the template.

Parameters:
rootURL - base url where this container looks for the template

ScriptCollection

public ScriptCollection(java.net.URL rootURL,
                        java.net.URL[] alternateURL)

ScriptCollection

public ScriptCollection(java.net.URL rootURL,
                        java.net.URL[] alternateURL,
                        java.nio.charset.Charset cs)

ScriptCollection

public ScriptCollection(java.io.File rootDirectory)
Create a new ScriptCollection defining the directory where it looks for the template.

Parameters:
rootDirectory - root directory where this container looks for the template

ScriptCollection

public ScriptCollection(java.io.File rootDirectory,
                        java.nio.charset.Charset cs)
Create a new ScriptCollection defining the directory where it looks for the template.

Parameters:
rootDirectory - root directory where this container looks for the template
cs - Charset to be used on reading script file

ScriptCollection

public ScriptCollection(java.io.File rootDirectory,
                        java.io.File[] alternateRootDirectory)
Create a new ScriptCollection defining the directory and alternate directories, where it looks for the template.

Parameters:
rootDirectory - primary root directory where this container looks for the template
alternateRootDirectory - alternate root directories where this container looks for the template

ScriptCollection

public ScriptCollection(java.io.File rootDirectory,
                        java.io.File[] alternateRootDirectory,
                        java.nio.charset.Charset cs)
Create a new ScriptCollection defining the directory and alternate directories, where it looks for the template.

Parameters:
rootDirectory - primary root directory where this container looks for the template
alternateRootDirectory - alternate root directories where this container looks for the template
cs - Charset to be used on reading script file
Method Detail

get

public Script get(java.net.URL url)
           throws ParserException
Retrieves the parsed template. If the template is not yet parsed, it tries to find the it from URL.

Parameters:
url - the URL for of template containing the script
Returns:
parsed script
Throws:
java.io.IOException - if IO exception occurs during template parsing
ParserException - if syntax error found during template parsing

get

public Script get(java.net.URL url,
                  java.nio.charset.Charset cs)
           throws ParserException
Retrieves the parsed template. If the template is not yet parsed, it tries to find the it from URL.

Parameters:
url - the URL for of template containing the script
Returns:
parsed script
Throws:
java.io.IOException - if IO exception occurs during template parsing
ParserException - if syntax error found during template parsing

get

public Script get(java.lang.String path)
           throws ParserException
Retrieves the parsed template. If the template is not yet parsed, it tries to find the it in either root directory or alternate directories.

Parameters:
path - the path of template containing the script relative to the root directory or to the alternate directories
Returns:
parsed script
Throws:
java.io.IOException - if IO exception occurs during template parsing
ParserException - if syntax error found during template parsing

get

public Script get(java.lang.String path,
                  java.nio.charset.Charset cs)
           throws ParserException
Retrieves the parsed template. If the template is not yet parsed, it tries to find the it in either root directory or alternate directories.

Parameters:
path - the path of template containing the script relative to the root directory or to the alternate directories
Returns:
parsed script
Throws:
java.io.IOException - if IO exception occurs during template parsing
ParserException - if syntax error found during template parsing