com.lutris.ant.taskdefs
Class DefaultXmlcUtilsImpl

java.lang.Object
  |
  +--com.lutris.ant.taskdefs.XmlcUtils
        |
        +--com.lutris.ant.taskdefs.DefaultXmlcUtilsImpl

public class DefaultXmlcUtilsImpl
extends XmlcUtils

Default implementation of the XmlcUtils class


Fields inherited from class com.lutris.ant.taskdefs.XmlcUtils
DEFAULT_OPTIONS_FILENAME, DEFAULT_OPTIONS_FILETYPE, DEFAULT_UTILS_CLASS_KEY, DEFAULT_UTILS_CLASS_NAME
 
Constructor Summary
protected DefaultXmlcUtilsImpl()
          Construct default DefaultXmlcUtilsImpl (protected to force the use of XmlcUtils.create() factory method).
 
Method Summary
 java.lang.String buildClassName(java.lang.String theFullBaseFileName, java.lang.String theModifier)
          Build a Java class name out of the specified components
 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.
 java.lang.String[] getOptionFiles(java.io.File theDirectory)
          Get a list of options files for the specified directory.
 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.
 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.
 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.
 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 com.lutris.ant.taskdefs.XmlcUtils
, create
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultXmlcUtilsImpl

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

buildClassName

public java.lang.String buildClassName(java.lang.String theFullBaseFileName,
                                       java.lang.String theModifier)
Build a Java class name out of the specified components
Overrides:
buildClassName in class XmlcUtils
Parameters:
theFullBaseFileName - - The full base file name (specified with '/' separators) and no file type. e.g. "com.lutris.test"
theModifier - - The file modifier to append to the class name e.g. HTML
Returns:
A Java class name string

buildFullBaseFileName

public 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"
Overrides:
buildFullBaseFileName in class XmlcUtils
Parameters:
thePackageName - - The name of the package to prepend to the file name. This should be specified using the Java naming convention i.e. com.lutris.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 '/'

getOptionFiles

public 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.
Overrides:
getOptionFiles in class XmlcUtils
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 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.
Overrides:
getOptionFiles in class XmlcUtils
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 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.
Overrides:
getOptionFiles in class XmlcUtils
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 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.
Overrides:
getOptionFiles in class XmlcUtils
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 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.
Overrides:
getOptionFiles in class XmlcUtils
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.