com.arsdigita.persistence.pdl
Class PDL

java.lang.Object
  extended bycom.arsdigita.persistence.pdl.PDL

public class PDL
extends Object

The main class that is used to process PDL files. It takes any number of PDL files as arguments on the command line, then processes them all into a single XML file (the first command line argument).

Version:
$Revision: #32 $ $Date: 2004/04/07 $
Author:
rhs@mit.edu

Field Summary
protected static CommandLine CMD
           
static String versionId
           
 
Constructor Summary
PDL()
           
 
Method Summary
static MetadataRoot compilePDLFiles(Collection files)
          Compiles PDL to Persistence Metadata
static List findPDLFiles(File dir)
          Finds all PDL files in a given directory
static List findPDLFiles(File[] path)
          Finds all the PDL files in a given path.
static void findPDLFiles(File base, Collection files)
          Searches a directory for all PDL files
static void findSQLFiles(File base, Collection files)
           
 void generateMetadata(MetadataRoot root)
          Generates the metadata that corresponds to the AST generated from the various PDL files, all beneath the given metadata root node.
static String getDebugDirectory()
           
 void load(File f)
          Parse a PDL file into an AST.
 void load(Reader r, String filename)
          Parses a PDL file into an AST.
 void load(String filename)
          Parse a PDL file into an AST.
static MetadataRoot loadDirectory(File dir)
          Loads all the PDL files in a given directory
 void loadResource(String s)
           
static void main(String[] args)
          Compiles pdl files into one xml file.
static void setDebugDirectory(File directory)
           
static void setDebugDirectory(String directory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

CMD

protected static final CommandLine CMD
Constructor Detail

PDL

public PDL()
Method Detail

generateMetadata

public void generateMetadata(MetadataRoot root)
Generates the metadata that corresponds to the AST generated from the various PDL files, all beneath the given metadata root node.

Parameters:
root - the metadata root node to build the metadata beneath

load

public void load(Reader r,
                 String filename)
          throws PDLException
Parses a PDL file into an AST.

Parameters:
r - a Reader open to the PDL file
filename - the name of the PDL file read by "r"
Throws:
PDLException - thrown on a parsing error.

load

public void load(File f)
          throws PDLException
Parse a PDL file into an AST.

Parameters:
f - a File object that references a PDL file to parse
Throws:
PDLException - thrown when the file is not found or on a parse error

load

public void load(String filename)
          throws PDLException
Parse a PDL file into an AST.

Parameters:
filename - the name of the PDL file to parse
Throws:
PDLException - on file not found or a parse error.

loadResource

public void loadResource(String s)
                  throws PDLException
Parameters:
s -
Throws:
PDLException

main

public static final void main(String[] args)
                       throws PDLException
Compiles pdl files into one xml file. The target xml file is the first argument. All other arguments refer to pdl files that need to be loaded.

Throws:
PDLException - if we have too few input files or if we detect an error while parsing an input file. The reason we use an exception is for the build process within ant to fail on error.

setDebugDirectory

public static void setDebugDirectory(File directory)

setDebugDirectory

public static void setDebugDirectory(String directory)

getDebugDirectory

public static String getDebugDirectory()

loadDirectory

public static MetadataRoot loadDirectory(File dir)
Loads all the PDL files in a given directory


findPDLFiles

public static List findPDLFiles(File[] path)
Finds all the PDL files in a given path.


findPDLFiles

public static List findPDLFiles(File dir)
Finds all PDL files in a given directory


findPDLFiles

public static void findPDLFiles(File base,
                                Collection files)
Searches a directory for all PDL files


findSQLFiles

public static void findSQLFiles(File base,
                                Collection files)

compilePDLFiles

public static MetadataRoot compilePDLFiles(Collection files)
                                    throws PDLException
Compiles PDL to Persistence Metadata

Parameters:
files - array of PDL files to process
Throws:
PDLException


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC