com.ccg.macros.at
Class All

java.lang.Object
  extended by com.ccg.util.Convert
      extended by com.ccg.util.TagLookup
          extended by com.ccg.util.CommandLineUtility
              extended by com.ccg.macros.at.All
All Implemented Interfaces:
Lookup, Runnable

public class All
extends CommandLineUtility

A simple command line utility that can be used to test all Base classes in the package.

This simple test utility creates a AtMacros object, registers and installs ALL (Core, Html, etc) of the Base derived macro handlers defined in the package. And then processes the standard input out to the standard output.

The end result is a fairly powerful macro processing language (I use it all the time to generate/tweak HTML code).

The following command line options are recognized:

You can use many of the standard command line options which the CommandLineUtility class recognizes. In addtion, the following command line options are recognized:

-Dname=val
This allows one to define macros on the command line. You may include zero or more definitions. For example "-Dfirst=Paul -Dlast=Blankenbaker" on the command line is equivalent to '@define("first","Paul")@define("last","Blankenbaker")' in a source file. This allows one to pass/define values outside of the source files.
-nodefaults [true|false]
Specify this option to turn off the loading of the user's default macro definitions. By default, this application first tries to load the file "$HOME/.etc/com/ccg/macros/default.At" (discarding all output) to allow one to load a set of custom definitions (if this file isn't found, it isn't loaded). Use the "-nodefaults" option to disable this feature.

To get a rough idea of ALL of the available macros, try running it in the following manner:

 echo "@htmlDumpDefinitions()" | java com.ccg.macros.at.All > defs.html
 

Since:
1.0
Version:
$Revision: 1.1.1.1 $
Author:
$Author: pkb $
See Also:
AtMacros, Base

Constructor Summary
All(String[] args)
          Initializes object with a set of command line arguments.
 
Method Summary
static AtMacros createAtMacros()
          Create a new AtMacros object and install all standard macros.
static void installAll(AtMacros am)
          Global static method to install ALL of the macro handler objects available in this package.
static void main(String[] args)
          Main entry point into the application.
 void run()
          Runs the macro processor.
 
Methods inherited from class com.ccg.util.CommandLineUtility
getFiles, getInputStream, getLineNumberReader, getOutputStream, getPrintWriter, getStrings, setInputStream, setOutputStream
 
Methods inherited from class com.ccg.util.TagLookup
get, getBoolean, getChoice, getColor, getDate, getDate, getFont, getIndexedList, getInputStream, getLocale, getLookup, getNumber, getNumber, getOutputStream, getString, getString, getStrings, getTag, getTimeSpan, getTimeSpan, setLookup, setTag
 
Methods inherited from class com.ccg.util.Convert
choiceValue, getDateFormat, getNumberFormat, setDateFormat, setNumberFormat, toBoolean, toColor, toDate, toFont, toInputStream, toLocale, toNumber, toOutputStream, toString, toTimeSpan
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

All

public All(String[] args)
Initializes object with a set of command line arguments.

This constructor initializes the object with the set of command line arguments to use when its run(). However, this is about all that is done (we don't actually verify the arguments at this point).

Since:
1.0
Method Detail

run

public void run()
Runs the macro processor.

This method checks the command line arguments, and then runs the source file through the macro processor writing the results to the standard output device.

Specified by:
run in interface Runnable
Specified by:
run in class CommandLineUtility
Since:
1.0

installAll

public static void installAll(AtMacros am)
Global static method to install ALL of the macro handler objects available in this package.

This method installs ALL of the Base derived macro handlers which one can find in this class. This is an easy way to make sure that ALL of the macros defined in the com.ccg.macros.at package are loaded and available to your interpreter.

Parameters:
am - The AtMacros object to register all of the macros with. Must not be null.
Since:
1.0

createAtMacros

public static AtMacros createAtMacros()
Create a new AtMacros object and install all standard macros.

This is a convenience method. It constructs and initializes a AtMacros object for you in one shot.

Returns:
A newly created AtMacros object with ALL of the standard macros installed.
Since:
1.0
See Also:
AtMacros

main

public static void main(String[] args)
Main entry point into the application.

Parameters:
args - Array of command line arguments.


Copyright 1998-1998-2006 null. All Rights Reserved.