com.mkdoc.io
Class FileApplicationContext

java.lang.Object
  |
  +--com.mkdoc.util.AbstractApplicationContext
        |
        +--com.mkdoc.io.FileApplicationContext
All Implemented Interfaces:
ApplicationContext, net.javacoding.jspider.core.util.config.PropertySet

public class FileApplicationContext
extends AbstractApplicationContext
implements ApplicationContext, net.javacoding.jspider.core.util.config.PropertySet

A simple context for file system applications.

Version:
0.2 2005-12-09
Author:
Philip Shaw

Field Summary
 
Fields inherited from class com.mkdoc.util.AbstractApplicationContext
parameters
 
Fields inherited from interface com.mkdoc.util.ApplicationContext
ABSOLUTE, DIRECTORY, REPOSITORY
 
Constructor Summary
FileApplicationContext(java.lang.String managerClass)
          Create a context with a store manager class.
 
Method Summary
 boolean getBoolean(java.lang.String name, boolean defaultValue)
          Get a boolean or default value if not found.
 boolean getBooleanParameter(java.lang.String name)
          Get a boolean parameter.
 java.lang.Class getClass(java.lang.String name, java.lang.Class defaultValue)
          Get a class reference or default value if not found.
 java.lang.Class getClassParameter(java.lang.String name)
          Get a class parameter.
 java.io.File getDefaultStoreDirectory()
          A template method to get a default store directory.
 int getInteger(java.lang.String name, int defaultValue)
          Get an integer or default value if not found.
 java.lang.String getString(java.lang.String name, java.lang.String defaultValue)
          Get a string or default value if not found.
 java.lang.String getStringParameter(java.lang.String name)
          Get a string parameter.
 
Methods inherited from class com.mkdoc.util.AbstractApplicationContext
getMappedClass, getMappedParameter, getStoreDirectory, getStorePath, setParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.mkdoc.util.ApplicationContext
getStoreDirectory, getStorePath, setParameter
 

Constructor Detail

FileApplicationContext

public FileApplicationContext(java.lang.String managerClass)
Create a context with a store manager class.

Parameters:
managerClass - The name of a store manager type.
Since:
Version 0.1 2005-12-06
Method Detail

getStringParameter

public final java.lang.String getStringParameter(java.lang.String name)
Get a string parameter.

Specified by:
getStringParameter in interface ApplicationContext
Parameters:
name - The name of the parameter to get.
Returns:
The value associated with the given parameter.
Since:
Version 0.1 2005-12-06

getClassParameter

public final java.lang.Class getClassParameter(java.lang.String name)
Get a class parameter.

Specified by:
getClassParameter in interface ApplicationContext
Parameters:
name - The name of the parameter to get.
Returns:
The class associated with the given parameter.
Since:
Version 0.1 2005-12-06

getBooleanParameter

public final boolean getBooleanParameter(java.lang.String name)
Get a boolean parameter.

Specified by:
getBooleanParameter in interface ApplicationContext
Parameters:
name - The name of the parameter to get.
Returns:
The boolean associated with the given parameter.
Since:
Version 0.1 2005-12-06

getString

public final java.lang.String getString(java.lang.String name,
                                        java.lang.String defaultValue)
Get a string or default value if not found.

Specified by:
getString in interface net.javacoding.jspider.core.util.config.PropertySet
Parameters:
name - The name of the parameter to look-up.
defaultValue - The default value if the look-up fails.
Returns:
The named value or the default value if not found.
Since:
Version 0.1 2005-12-06

getClass

public final java.lang.Class getClass(java.lang.String name,
                                      java.lang.Class defaultValue)
Get a class reference or default value if not found.

Specified by:
getClass in interface net.javacoding.jspider.core.util.config.PropertySet
Parameters:
name - The name of the parameter to look-up.
defaultValue - The default value if the look-up fails.
Returns:
The named value or the default value if not found.
Since:
Version 0.1 2005-12-06

getInteger

public final int getInteger(java.lang.String name,
                            int defaultValue)
Get an integer or default value if not found.

Specified by:
getInteger in interface net.javacoding.jspider.core.util.config.PropertySet
Parameters:
name - The name of the parameter to look-up.
defaultValue - The default value if the look-up fails.
Returns:
The named value or the default value if not found.
Since:
Version 0.1 2005-12-06

getBoolean

public final boolean getBoolean(java.lang.String name,
                                boolean defaultValue)
Get a boolean or default value if not found.

Specified by:
getBoolean in interface net.javacoding.jspider.core.util.config.PropertySet
Parameters:
name - The name of the parameter to look-up.
defaultValue - The default value if the look-up fails.
Returns:
The named value or the default value if not found.
Since:
Version 0.1 2005-12-06

getDefaultStoreDirectory

public final java.io.File getDefaultStoreDirectory()
A template method to get a default store directory.

Specified by:
getDefaultStoreDirectory in class AbstractApplicationContext
Returns:
A reference to the default output directory.
Since:
Version 0.1 2005-12-06