org.foray.core
Class SessionConfig

java.lang.Object
  extended by org.foray.common.Configuration
      extended by org.foray.core.SessionConfig

public class SessionConfig
extends Configuration

Configuration implementation for those configuration items that are related to the FOraySession.


Field Summary
 
Fields inherited from class org.foray.common.Configuration
PRECEDENCE_COMMAND_LINE, PRECEDENCE_CONFIG_FILE, PRECEDENCE_DEFAULT
 
Constructor Summary
SessionConfig()
          Constructor.
 
Method Summary
 URL getBaseDocument()
          Returns the path to the base document that should be used for finding resources with relative URLs.
 String getMode()
          Returns the "mode" configuration item.
 String getName()
          Supplies a name for this configuration.
 boolean isModeRender()
          Indicates whether the "mode" is "render".
 boolean isModeValidate()
          Indicates whether the "mode" is "validate".
 EntityResolver makeEntityResolver()
          Creates and returns an entity resolver.
 URL optionBaseDirectory()
          Returns the "base-directory" configuration item.
 boolean optionCacheGraphics()
          Returns the "cache-graphics" configuration item.
 boolean optionDumpConfiguration()
          Returns the "dump-configuration" configuration item.
 URL optionFontBaseDirectory()
          Returns the "font-base-directory" configuration item.
 URL optionFontConfiguration()
          Returns the URL to the font-configuration file.
 URL optionHyphenationBaseDirectory()
          Returns the "hyphenation-base-directory" configuration item.
 String optionLanguage()
          Returns the "language" configuration item.
 URL optionNaturalLanguageBaseDirectory()
          Returns the "natural-language-base-directory" configuration item.
 boolean optionStrokeSVGText()
          Returns the "stroke-svg-text" configuration item.
 String optionVerbosity()
          Returns the "verbosity" configuration item.
 String optionXMLCatalog()
          Returns the "xml-catalog" configuration item.
 boolean parseOption(String key, String value, int precedenceValue)
          Attempt to add the configuration option.
 void setBaseDirectory(URL newBaseDir, int precedence)
          Sets the "base-directory" configuration item.
 void setBaseDocument(URL baseDocument)
          Sets the path to the base document that should be used for finding resources with relative URLs.
protected  void setDefaults()
          Sets any default configuration values.
 
Methods inherited from class org.foray.common.Configuration
addUnvalidatedOption, dumpConfiguration, getBooleanValue, getIntValue, getListValue, getStringValue, getValue, parseBoolean, parseSpaceDelimitedList, parseURL, parseURLDirectory, parseURLFile, put
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionConfig

public SessionConfig()
Constructor.

Method Detail

getName

public String getName()
Description copied from class: Configuration
Supplies a name for this configuration.

Specified by:
getName in class Configuration
Returns:
A name for this configuration, suitable to be used in logging messages.

setDefaults

protected void setDefaults()
Description copied from class: Configuration
Sets any default configuration values.

Specified by:
setDefaults in class Configuration

parseOption

public boolean parseOption(String key,
                           String value,
                           int precedenceValue)
                    throws ConfigurationException
Description copied from class: Configuration
Attempt to add the configuration option.

Specified by:
parseOption in class Configuration
Parameters:
key - A string containing the key value for the configuration value.
value - The string containing the configuration value.
precedenceValue - The precedence with which this option should be treated. Entries with a higher precedence value override entries with a lower value.
Returns:
True if the option was successfully added, false if it does not belong in this Configuration implementation.
Throws:
ConfigurationException - For an invalid value for the given key.

optionBaseDirectory

public URL optionBaseDirectory()
Returns the "base-directory" configuration item.

Returns:
The "base-directory" configuration item.

setBaseDirectory

public void setBaseDirectory(URL newBaseDir,
                             int precedence)
Sets the "base-directory" configuration item.

Parameters:
newBaseDir - The new "base-directory".
precedence - The precedence asserted by the setter.

optionCacheGraphics

public boolean optionCacheGraphics()
Returns the "cache-graphics" configuration item.

Returns:
The "cache-graphics" configuration item.

optionDumpConfiguration

public boolean optionDumpConfiguration()
Returns the "dump-configuration" configuration item.

Returns:
The "dump-configuration" configuration item.

optionFontBaseDirectory

public URL optionFontBaseDirectory()
Returns the "font-base-directory" configuration item.

Returns:
The "font-base-directory" configuration item.

optionFontConfiguration

public URL optionFontConfiguration()
Returns the URL to the font-configuration file.

Returns:
The URL to the font-configuration file specified, or null if none was specified.

optionHyphenationBaseDirectory

public URL optionHyphenationBaseDirectory()
Returns the "hyphenation-base-directory" configuration item.

Returns:
The "hyphenation-base-directory" configuration item.

optionNaturalLanguageBaseDirectory

public URL optionNaturalLanguageBaseDirectory()
Returns the "natural-language-base-directory" configuration item.

Returns:
The "natural-language-base-directory" configuration item.

optionLanguage

public String optionLanguage()
Returns the "language" configuration item.

Returns:
The "language" configuration item.

optionStrokeSVGText

public boolean optionStrokeSVGText()
Returns the "stroke-svg-text" configuration item.

Returns:
The "stroke-svg-text" configuration item.

optionVerbosity

public String optionVerbosity()
Returns the "verbosity" configuration item.

Returns:
The "verbosity" configuration item.

optionXMLCatalog

public String optionXMLCatalog()
Returns the "xml-catalog" configuration item.

Returns:
The "xml-catalog" configuration item.

makeEntityResolver

public EntityResolver makeEntityResolver()
Creates and returns an entity resolver.

Returns:
The entity resolver, if a catalog has been specified, or null if not.

setBaseDocument

public void setBaseDocument(URL baseDocument)
Sets the path to the base document that should be used for finding resources with relative URLs.

Parameters:
baseDocument - The path to the base document.

getBaseDocument

public URL getBaseDocument()
Returns the path to the base document that should be used for finding resources with relative URLs. This is not really a configuration option, but is a permanent record of the original fo or xml file that was passed on the command line, if any.

Returns:
The base FO or XML document.

getMode

public String getMode()
Returns the "mode" configuration item.

Returns:
The "mode" configuration item.

isModeRender

public boolean isModeRender()
Indicates whether the "mode" is "render".

Returns:
True iff the "mode" is "render".

isModeValidate

public boolean isModeValidate()
Indicates whether the "mode" is "validate".

Returns:
True iff the "mode" is "validate".


Copyright © 2017. All rights reserved.