net.sf.xslthl
Class Config

java.lang.Object
  extended by net.sf.xslthl.Config

public class Config
extends Object

Contains the Xslthl configuration


Field Summary
static String CONFIG_PROPERTY
          System property that defines the path to the configuration file
static Map<String,Class<? extends Highlighter>> highlighterClasses
          Registered highlighter classes
protected  Map<String,MainHighlighter> highlighters
          Registered highlighters
protected  Logger logger
          The logging facility
static String LOGLEVEL_PROPERTY
          The log level for the xslthl logger
static String NO_EXTERNAL_PROPERTY
          Property set to disable external configuration loading
static String PLUGIN_PREFIX
          Prefix used for plug-able highlighters
protected  String prefix
          Prefix to use on created XML elements
protected  String uri
          The namespace uri
protected  boolean verbose
          Deprecated. 
static String VERBOSE_LOADING_PROPERTY
          Deprecated. since 2.1 XSLTHL uses the Java logging facility
 
Constructor Summary
protected Config()
           
protected Config(String configFilename)
           
 
Method Summary
protected  void createHighlighters(MainHighlighter main, Iterator<Element> elements)
          Creates the defined highlighters
static Config getInstance()
          Get the default config
static Config getInstance(String filename)
          Get the config from a given file
 MainHighlighter getMainHighlighter(String id)
          Get the highlighter for a given language id, URI or filename.
 String getPrefix()
           
 String getUri()
           
protected  void loadConfiguration(String configFilename)
          Load the configuration
protected  MainHighlighter loadHl(String id, String filename)
          Load a language highlighter configuration
protected  Class<? extends Highlighter> loadPlugin(MainHighlighter main, String type, String classpath)
          Load a plugin highlighter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_PROPERTY

public static final String CONFIG_PROPERTY
System property that defines the path to the configuration file

See Also:
Constant Field Values

VERBOSE_LOADING_PROPERTY

@Deprecated
public static final String VERBOSE_LOADING_PROPERTY
Deprecated. since 2.1 XSLTHL uses the Java logging facility
If set to true be verbose during loading of the configuration

See Also:
Constant Field Values

LOGLEVEL_PROPERTY

public static final String LOGLEVEL_PROPERTY
The log level for the xslthl logger

Since:
2.1
See Also:
Constant Field Values

NO_EXTERNAL_PROPERTY

public static final String NO_EXTERNAL_PROPERTY
Property set to disable external configuration loading

See Also:
Constant Field Values

highlighterClasses

public static final Map<String,Class<? extends Highlighter>> highlighterClasses
Registered highlighter classes


PLUGIN_PREFIX

public static final String PLUGIN_PREFIX
Prefix used for plug-able highlighters

Since:
2.1
See Also:
Constant Field Values

prefix

protected String prefix
Prefix to use on created XML elements


uri

protected String uri
The namespace uri


highlighters

protected Map<String,MainHighlighter> highlighters
Registered highlighters


logger

protected Logger logger
The logging facility


verbose

@Deprecated
protected boolean verbose
Deprecated. 
Constructor Detail

Config

protected Config()

Config

protected Config(String configFilename)
Method Detail

getInstance

public static Config getInstance()
Get the default config

Returns:

getInstance

public static Config getInstance(String filename)
Get the config from a given file

Parameters:
filename -
Returns:

getPrefix

public String getPrefix()
Returns:
the prefix

getUri

public String getUri()
Returns:
the uri

getMainHighlighter

public MainHighlighter getMainHighlighter(String id)
Get the highlighter for a given language id, URI or filename.

Parameters:
id -
Returns:
A highlighter, or null if no highlighter exists

loadHl

protected MainHighlighter loadHl(String id,
                                 String filename)
                          throws Exception
Load a language highlighter configuration

Parameters:
filename -
Returns:
Throws:
Exception

createHighlighters

protected void createHighlighters(MainHighlighter main,
                                  Iterator<Element> elements)
Creates the defined highlighters

Parameters:
main -
elements -

loadPlugin

protected Class<? extends Highlighter> loadPlugin(MainHighlighter main,
                                                  String type,
                                                  String classpath)
Load a plugin highlighter

Parameters:
type -
classpath -
Returns:
The plugin class
Since:
2.1

loadConfiguration

protected void loadConfiguration(String configFilename)
Load the configuration

Parameters:
configFilename - When null or empty the default system configuration will be used
Since:
2.1


Copyright © 2005-2014. All Rights Reserved.