org.enhydra.barracuda.taskdefs
Class XmlcUtils

java.lang.Object
  |
  +--org.enhydra.barracuda.taskdefs.XmlcUtils
Direct Known Subclasses:
DefaultXmlcUtilsImpl, DummyXmlcUtils

public abstract class XmlcUtils
extends java.lang.Object

Abstract base xmlc utilities class

Version:
1.0
Author:
Robert Leftwich

Field Summary
static java.lang.String DEFAULT_OPTIONS_FILENAME
          The name of the default XMLC options file.
static java.lang.String DEFAULT_OPTIONS_FILETYPE
          The default extension for an XMLC options file.
static java.lang.String DEFAULT_UTILS_CLASS_KEY
          The system property holding the classname of the class to instantiate when XmlcUtils.create() is called.
static java.lang.String DEFAULT_UTILS_CLASS_NAME
          The default classname of the class to instantiate when XmlcUtils.create() is called.
 
Constructor Summary
protected XmlcUtils()
          Construct default XmlcUtils (protected to force the use of XmlcUtils.create() factory method).
 
Method Summary
abstract  java.lang.String buildClassName(java.lang.String theFullBaseFileName, java.lang.String theModifier)
          Build a Java class name out of the specified components.
abstract  java.lang.String buildFullBaseFileName(java.lang.String thePackageName, java.lang.String thePackageDir, java.lang.String theBaseFileName)
          Build a full base file name (i.e. with no file type) out of the specified components.
static XmlcUtils create()
          Factory method for creating instances of the XmlcUtils class.
abstract  java.lang.String[] getOptionFiles(java.io.File theDirectory)
          Get a list of options files for the specified directory.
abstract  java.lang.String[] getOptionFiles(java.io.File[] theDirectories, java.lang.String theOptionsFileName)
          Get a list of options files for the specified directories, having the specified name.
abstract  java.lang.String[] getOptionFiles(java.io.File[] theDirectories, java.lang.String[] theOptionsFileNames)
          Get a list of options files for the specified directories, having the specified names.
abstract  java.lang.String[] getOptionFiles(java.io.File theDirectory, java.lang.String theOptionsFileName)
          Get a list of options files for the specified directory, having the specified name.
abstract  java.lang.String[] getOptionFiles(java.io.File theDirectory, java.lang.String[] theOptionsFileNames)
          Get a list of options files for the specified directory, having the specified names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_OPTIONS_FILETYPE

public static final java.lang.String DEFAULT_OPTIONS_FILETYPE
The default extension for an XMLC options file.

See Also:
Constant Field Values

DEFAULT_OPTIONS_FILENAME

public static final java.lang.String DEFAULT_OPTIONS_FILENAME
The name of the default XMLC options file.

See Also:
Constant Field Values

DEFAULT_UTILS_CLASS_KEY

public static final java.lang.String DEFAULT_UTILS_CLASS_KEY
The system property holding the classname of the class to instantiate when XmlcUtils.create() is called.

See Also:
Constant Field Values

DEFAULT_UTILS_CLASS_NAME

public static final java.lang.String DEFAULT_UTILS_CLASS_NAME
The default classname of the class to instantiate when XmlcUtils.create() is called.

Constructor Detail

XmlcUtils

protected XmlcUtils()
Construct default XmlcUtils (protected to force the use of XmlcUtils.create() factory method).

Method Detail

getOptionFiles

public abstract java.lang.String[] getOptionFiles(java.io.File theDirectory)
Get a list of options files for the specified directory. This method will search for the default options file name (options.xmlc) in the specified directory and the user.dir directory as well. It will return them in that order.

Parameters:
theDirectory - The directory to look in for the options file.
Returns:
An array of options files with absolute paths. An empty array if none found.

getOptionFiles

public abstract java.lang.String[] getOptionFiles(java.io.File theDirectory,
                                                  java.lang.String theOptionsFileName)
Get a list of options files for the specified directory, having the specified name. This method will search for the specified options file name and the default options file name (options.xmlc) in the specified directory and the user.dir directory as well. It will return them in that order.

Parameters:
theDirectory - The directory to look in for the options file.
theOptionsFileName - The name of the options file to look for.
Returns:
An array of options files with absolute paths. An empty array if none found.

getOptionFiles

public abstract java.lang.String[] getOptionFiles(java.io.File theDirectory,
                                                  java.lang.String[] theOptionsFileNames)
Get a list of options files for the specified directory, having the specified names. This method will search for the specified options file names and the default options file name (options.xmlc) in the specified directory and the user.dir directory as well. It will return them in that order.

Parameters:
theDirectory - The directory to look in for the options file.
theOptionsFileNames - The list of names of the options file to look for.
Returns:
An array of options files with absolute paths. An empty array if none found.

getOptionFiles

public abstract java.lang.String[] getOptionFiles(java.io.File[] theDirectories,
                                                  java.lang.String theOptionsFileName)
Get a list of options files for the specified directories, having the specified name. This method will search for the specified options file name and the default options file name (options.xmlc) in the specified directories and the user.dir directory as well. It will return them in that order.

Parameters:
theDirectories - The list of directories to look in for the options files.
theOptionsFileName - The name of the options file to look for.
Returns:
An array of options files with absolute paths. An empty array if none found.

getOptionFiles

public abstract java.lang.String[] getOptionFiles(java.io.File[] theDirectories,
                                                  java.lang.String[] theOptionsFileNames)
Get a list of options files for the specified directories, having the specified names. This method will search for the specified options file names and the default options file name (options.xmlc) in the specified directories and the user.dir directory as well. It will return them in that order.

Parameters:
theDirectories - The list of directories to look in for the options files.
theOptionsFileNames - The list of names of the options file to look for.
Returns:
An array of options files with absolute paths. An empty array if none found.

buildFullBaseFileName

public abstract java.lang.String buildFullBaseFileName(java.lang.String thePackageName,
                                                       java.lang.String thePackageDir,
                                                       java.lang.String theBaseFileName)
Build a full base file name (i.e. with no file type) out of the specified components. Note that any directory prefix on the theBaseFileName file is stripped before thePackageDir is applied. So that the following call : buildFullBaseFileName("a.b.c", "foo/resources", "config/test.html"); will return a string of "a/b/c/foo/resources/test" and this call : buildFullBaseFileName("a.b.c", "", "config/test.html"); will return a string of "a/b/c/config/test"

Parameters:
thePackageName - The name of the package to prepend to the file name. This should be specified using the Java naming convention i.e. org.enhydra.xmlc
thePackageDir - The name of the directory to prepend to the file name. This is a directory path that can be specified using either '/' or '\' i.e. foo/resources
theBaseFileName - The base file name that the preceding strings are prepended to.
Returns:
A string representing the full path resulting from the specified components with all separators set to '/'

buildClassName

public abstract java.lang.String buildClassName(java.lang.String theFullBaseFileName,
                                                java.lang.String theModifier)
Build a Java class name out of the specified components.

Parameters:
theFullBaseFileName - The full base file name (specified with '/' separators) and no file type. e.g. "org.enhydra.test"
theModifier - The file modifier to append to the class name e.g. HTML
Returns:
A Java class name string

create

public static XmlcUtils create()
Factory method for creating instances of the XmlcUtils class. The actual implementation instantiated is controlled by setting the system property DEFAULT_UTILS_CLASSKEY (currently 'xmlcutils.classname') to the fully qualified class name of the sub-class of XmlcUtils that you want to use. By default (or if the value specified is invalid) this method will return an instance of DefaultXmlcUtilsImpl

Returns:
An instance of a XmlcUtils class


Copyright © 2001 Enhydra.org