org.jboss.jsfunit.analysis.util
Class ConfigUtils

java.lang.Object
  extended by org.jboss.jsfunit.analysis.util.ConfigUtils

public class ConfigUtils
extends Object

Collect methods that deal with JSF configuration.

Version:
$Revision: 1.1 $
Author:
Alexander Jesse

Nested Class Summary
static class ConfigUtils.ConfigItemType
          Enumeration to specify the type of a configuration item.
 
Constructor Summary
ConfigUtils()
           
 
Method Summary
 List<String> extractRenderkitIdsDefined(Document configFile, String configFilePath)
          Extract a list of renderkits defined in the config file.
 Map<String,Document> getConfigFileDoms()
          Get the configFileDoms.
 List<String> getConfigFilePaths()
          Get the configFilePaths.
 StreamProvider getStreamProvider()
          Accessor for the streamProvider attribute
 boolean isConfigured(ConfigUtils.ConfigItemType elementType, String elementName, boolean includeClassPath)
          Verify whether a config item is configured in one of the config files that exist in the setup.
 boolean isConfiguredConfigItemType(ConfigUtils.ConfigItemType elementType, String elementName, Document configFile, String configFilePath)
          Verify whether a config item is configured in one of the config files that exist in the setup.
 void setConfigFileDoms(Map<String,Document> configFileDoms)
          Set the configFileDoms.
 void setConfigFilePaths(List<String> configFilePaths)
          Set the configFilePaths.
 void setStreamProvider(StreamProvider streamProvider)
          Accessor for the streamProvider attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigUtils

public ConfigUtils()
Method Detail

isConfigured

public boolean isConfigured(ConfigUtils.ConfigItemType elementType,
                            String elementName,
                            boolean includeClassPath)
Verify whether a config item is configured in one of the config files that exist in the setup.

Parameters:
elementType - the configuration element type
elementName - name of the configuration element
includeClassPath - if true, then the config-files within the classpath's jar files are also searched
Returns:
true if the configuration element is configured within the setup, false otherwise

isConfiguredConfigItemType

public boolean isConfiguredConfigItemType(ConfigUtils.ConfigItemType elementType,
                                          String elementName,
                                          Document configFile,
                                          String configFilePath)
Verify whether a config item is configured in one of the config files that exist in the setup.

Parameters:
elementType - the configuration element type
elementName - name of the configuration element
configFile - the preparsed config file
configFilePath - the path to the config file
Returns:
true if the configuration element is configured within the setup, false otherwise

extractRenderkitIdsDefined

public List<String> extractRenderkitIdsDefined(Document configFile,
                                               String configFilePath)
Extract a list of renderkits defined in the config file.

Parameters:
configFile - the preparsed config file
configFilePath - the path to the config file
Returns:
a list of renderkits ids

getConfigFilePaths

public List<String> getConfigFilePaths()
Get the configFilePaths.

Returns:
the configFilePaths

setConfigFilePaths

public void setConfigFilePaths(List<String> configFilePaths)
Set the configFilePaths.

Parameters:
configFilePaths - The configFilePaths to set.

getConfigFileDoms

public Map<String,Document> getConfigFileDoms()
Get the configFileDoms.

Returns:
the configFileDoms.

setConfigFileDoms

public void setConfigFileDoms(Map<String,Document> configFileDoms)
Set the configFileDoms.

Parameters:
configFileDoms - The configFileDoms to set.

getStreamProvider

public StreamProvider getStreamProvider()
Accessor for the streamProvider attribute

Returns:
the streamprovider

setStreamProvider

public void setStreamProvider(StreamProvider streamProvider)

Accessor for the streamProvider attribute. Usually used to set a special StreamProvider. By default a DefaultStreamProvider is created.

Parameters:
streamProvider - the new StreamProvider


Copyright © 2007-2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.