org.millscript.millscript.conf
Class AbstractConfiguration

java.lang.Object
  extended by org.millscript.millscript.conf.AbstractConfiguration
All Implemented Interfaces:
Configuration
Direct Known Subclasses:
ApiConf, WebsiteConf

public abstract class AbstractConfiguration
extends java.lang.Object
implements Configuration

This class is a starting point for implementing a configuration object. You will still need to implement several methods, but basic properties and print methods are handled.


Field Summary
protected  org.millscript.commons.vfs.VFolder cwd
          The current working direcotry.
protected  CharacterEntity htmlCharacterEntities
          Holds the HTML character entities configuration.
protected  LoaderBuilder loaderBuilder
          Holds the configured loaders for this MillScript configuration.
protected  Logger logger
          Holds the logger for this MillScript configuration
protected  java.nio.charset.Charset outputCharset
          The current output character set.
protected  org.millscript.commons.util.EMap<java.lang.String,java.lang.Object> properties
          Holds the basic properties defined in the configuration files.
protected  org.millscript.commons.vfs.VFS vfs
          Holds the VFS for this configuration.
protected  CharacterEntity xmlCharacterEntities
          Holds the XML character entities configuration.
 
Fields inherited from interface org.millscript.millscript.conf.Configuration
CACHE_NAME, CONF_NAME, DOT_WEBSITE_NAME, INVENTORY_NAME, LIB_NAME, OUTPUT_NAME, PACKAGE_CONF_FILE, USER_CONF_FILE, VAR_NAME, WEBSITE_CONF_FILE, WEBSITE_FAILURE_FILE, WEBSITE_LOCK_FILE, WEBSITE_SUCCESSS_FILE
 
Constructor Summary
AbstractConfiguration()
           
 
Method Summary
 boolean getBooleanProperty(java.lang.String key)
          Returns the boolean configuration value associated with the specified key.
 org.millscript.commons.vfs.VFolder getCurrentWorkingFolder()
          Returns the current working folder.
 CharacterEntity getHTMLCharacterEntity()
          Returns the HTML character entity encoder/decoder object.
 LoaderBuilder getLoaderBuilder()
          Returns the LoaderBuilder for this configuration.
 Logger getLogger()
          Returns the logger for this configuration.
 java.nio.charset.Charset getOutputCharset()
          Returns the current output character set.
 org.millscript.commons.vfs.VFile getPackageConfFile(org.millscript.commons.vfs.VFolder packageDir)
          Returns the location of the package configuration file for the specified package location.
 java.lang.String getProperty(java.lang.String key)
          Returns the configuration value associated with the specified key.
 Engine getStandardEngine()
          Returns the standard engine for this configuration.
 Package getStandardPackage(Engine engine)
          Returns the standard package for this configuration.
 org.millscript.commons.vfs.VFS getVFS()
          Returns the VFS this configuration is using.
 CharacterEntity getXMLCharacterEntity()
          Returns the XML character entity encoder/decoder object.
 void reportAlertAsMishap(org.millscript.commons.alert.Alert alert)
          Reports the specified Alert as a mishap.
 void reportAlertAsWarning(org.millscript.commons.alert.Alert alert)
          Reports the specified Alert as a warning.
 void reportException(java.lang.Exception exception)
          Reports the specified Exception.
 void setLogger(Logger l)
          Sets the logger for this configuration.
 void setOutputCharset(java.nio.charset.Charset cs)
          Sets the output character set.
 void setProperty(java.lang.String key, java.lang.Object value)
          Associated the configuration value with the specified key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.millscript.millscript.conf.Configuration
getInteractivePrompt, getStandardConfFolder, getStandardConfigurationFile, getStandardInventoryFolder, getStandardLibFolder, getWebsiteCacheFolder, getWebsiteConfFolder, getWebsiteConfigurationFile, getWebsiteFailureFile, getWebsiteInventoryFolder, getWebsiteLibFolder, getWebsiteLockFile, getWebsiteOutputFolder, getWebsiteSuccessFile, getWebsiteVarFolder
 

Field Detail

vfs

protected final org.millscript.commons.vfs.VFS vfs
Holds the VFS for this configuration.


cwd

protected final org.millscript.commons.vfs.VFolder cwd
The current working direcotry.


htmlCharacterEntities

protected final CharacterEntity htmlCharacterEntities
Holds the HTML character entities configuration.


loaderBuilder

protected final LoaderBuilder loaderBuilder
Holds the configured loaders for this MillScript configuration.


logger

protected Logger logger
Holds the logger for this MillScript configuration


outputCharset

protected java.nio.charset.Charset outputCharset
The current output character set.


properties

protected final org.millscript.commons.util.EMap<java.lang.String,java.lang.Object> properties
Holds the basic properties defined in the configuration files.


xmlCharacterEntities

protected final CharacterEntity xmlCharacterEntities
Holds the XML character entities configuration.

Constructor Detail

AbstractConfiguration

public AbstractConfiguration()
Method Detail

getBooleanProperty

public boolean getBooleanProperty(java.lang.String key)
Description copied from interface: Configuration
Returns the boolean configuration value associated with the specified key.

Specified by:
getBooleanProperty in interface Configuration
Parameters:
key - the key to retrieve a value for
Returns:
the boolean value associated with the specified key.
See Also:
Configuration.getBooleanProperty(java.lang.String)

getCurrentWorkingFolder

public final org.millscript.commons.vfs.VFolder getCurrentWorkingFolder()
Description copied from interface: Configuration
Returns the current working folder.

Specified by:
getCurrentWorkingFolder in interface Configuration
Returns:
a VFolder object for the current working folder.
See Also:
Configuration.getCurrentWorkingFolder()

getHTMLCharacterEntity

public CharacterEntity getHTMLCharacterEntity()
Description copied from interface: Configuration
Returns the HTML character entity encoder/decoder object.

Specified by:
getHTMLCharacterEntity in interface Configuration
Returns:
the HTML character entity encoder/decoder.
See Also:
Configuration.getHTMLCharacterEntity()

getLoaderBuilder

public LoaderBuilder getLoaderBuilder()
Description copied from interface: Configuration
Returns the LoaderBuilder for this configuration.

Specified by:
getLoaderBuilder in interface Configuration
Returns:
the LoaderBuilder for this configuration
See Also:
Configuration.getLoaderBuilder()

getLogger

public Logger getLogger()
Description copied from interface: Configuration
Returns the logger for this configuration.

Specified by:
getLogger in interface Configuration
Returns:
the logger for this configuration
See Also:
Configuration.getLogger()

getOutputCharset

public java.nio.charset.Charset getOutputCharset()
Description copied from interface: Configuration
Returns the current output character set.

Specified by:
getOutputCharset in interface Configuration
Returns:
the current Charset to use for output
See Also:
Configuration.getOutputCharset()

getPackageConfFile

public org.millscript.commons.vfs.VFile getPackageConfFile(org.millscript.commons.vfs.VFolder packageDir)
Description copied from interface: Configuration
Returns the location of the package configuration file for the specified package location.

Specified by:
getPackageConfFile in interface Configuration
Parameters:
packageDir - the location of a package
Returns:
the VFile for the package configuration file, for the specified pacakge.
See Also:
Configuration.getPackageConfFile(org.millscript.commons.vfs.VFolder)

getProperty

public java.lang.String getProperty(java.lang.String key)
Description copied from interface: Configuration
Returns the configuration value associated with the specified key.

Specified by:
getProperty in interface Configuration
Parameters:
key - the key to retrieve a value for
Returns:
a String holding the value associated with the specified key.
See Also:
Configuration.getProperty(java.lang.String)

getStandardEngine

public Engine getStandardEngine()
Description copied from interface: Configuration
Returns the standard engine for this configuration. The standard engine may contain a number of builtin packages, e.g. the "standard" Package.

Specified by:
getStandardEngine in interface Configuration
Returns:
the standard Engine for this configuration
See Also:
Configuration.getStandardEngine()

getStandardPackage

public Package getStandardPackage(Engine engine)
Description copied from interface: Configuration
Returns the standard package for this configuration. This includes all the builtin variables and functions that are appropriate.

Specified by:
getStandardPackage in interface Configuration
Parameters:
engine - the engine this package is associated with
Returns:
the standard Package for this configuration
See Also:
Configuration.getStandardPackage(org.millscript.millscript.vm.Engine)

getVFS

public org.millscript.commons.vfs.VFS getVFS()
Description copied from interface: Configuration
Returns the VFS this configuration is using.

Specified by:
getVFS in interface Configuration
Returns:
the VFS this configuration is using
See Also:
Configuration.getVFS()

getXMLCharacterEntity

public CharacterEntity getXMLCharacterEntity()
Description copied from interface: Configuration
Returns the XML character entity encoder/decoder object.

Specified by:
getXMLCharacterEntity in interface Configuration
Returns:
the XML character entity encoder/decoder.
See Also:
Configuration.getXMLCharacterEntity()

reportAlertAsMishap

public void reportAlertAsMishap(org.millscript.commons.alert.Alert alert)
Description copied from interface: Configuration
Reports the specified Alert as a mishap. This is the general purpose method of reporting an Alert.

Specified by:
reportAlertAsMishap in interface Configuration
Parameters:
alert - the Alert to report as a mishap
See Also:
Configuration.reportAlertAsMishap(org.millscript.commons.alert.Alert)

reportAlertAsWarning

public void reportAlertAsWarning(org.millscript.commons.alert.Alert alert)
Description copied from interface: Configuration
Reports the specified Alert as a warning. This is the method to use when reporting an Alert as a warning. For general use, use Configuration.reportAlertAsMishap(Alert).

Specified by:
reportAlertAsWarning in interface Configuration
Parameters:
alert - the Alert to report as a warning
See Also:
Configuration.reportAlertAsWarning(org.millscript.commons.alert.Alert)

reportException

public void reportException(java.lang.Exception exception)
Description copied from interface: Configuration
Reports the specified Exception.

Specified by:
reportException in interface Configuration
Parameters:
exception - the Exception to report
See Also:
Configuration.reportException(java.lang.Exception)

setLogger

public void setLogger(Logger l)
Description copied from interface: Configuration
Sets the logger for this configuration.

Specified by:
setLogger in interface Configuration
Parameters:
l - the new logger for this configuration
See Also:
Configuration.setLogger(org.millscript.millscript.conf.logging.Logger)

setOutputCharset

public void setOutputCharset(java.nio.charset.Charset cs)
Description copied from interface: Configuration
Sets the output character set.

Specified by:
setOutputCharset in interface Configuration
Parameters:
cs - the Charset to use for output
See Also:
Configuration.setOutputCharset(java.nio.charset.Charset)

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object value)
Description copied from interface: Configuration
Associated the configuration value with the specified key.

Specified by:
setProperty in interface Configuration
Parameters:
key - the key to associate a value with
value - the value to associate with the key
See Also:
Configuration.setProperty(java.lang.String, java.lang.Object)


Copyright © 2001-2007 Open World Ltd. All Rights Reserved.