org.apache.openjpa.meta
Class MetaDataTool

java.lang.Object
  extended by org.apache.openjpa.meta.MetaDataTool
All Implemented Interfaces:
MetaDataModes

public class MetaDataTool
extends Object
implements MetaDataModes

Tool for generating default metadata.

Since:
0.3.0
Author:
Abe White

Nested Class Summary
static class MetaDataTool.Flags
          Run flags.
 
Field Summary
static String ACTION_ADD
           
static String ACTION_DROP
           
static String[] ACTIONS
           
 
Fields inherited from interface org.apache.openjpa.meta.MetaDataModes
MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY
 
Constructor Summary
MetaDataTool(OpenJPAConfiguration conf, String action)
          Constructor.
 
Method Summary
 void clear()
          Reset state.
 String getAction()
          The action supplied on construction.
 File getFile()
          The file to generate metadata to.
 MetaDataRepository getRepository()
          The repository to use to hold metadata.
 Writer getWriter()
          The writer to generate metadata to.
static void main(String[] args)
          Usage: java org.apache.openjpa.meta.MetaDataTool [option]* [-action/-a <add | drop>] <class name | .java file | .class file>+ Where the following options are recognized.
protected  MetaDataRepository newRepository()
          Create a new metadata repository.
 void record()
          Record metadata changes.
 void run(Class cls)
          Generate new metadata for the given class.
static boolean run(OpenJPAConfiguration conf, String[] args, MetaDataTool.Flags flags, MetaDataRepository repos, ClassLoader loader)
          Run the tool.
static boolean run(OpenJPAConfiguration conf, String[] args, Options opts)
          Run the tool.
 void setFile(File file)
          The file to generate metadata to.
 void setRepository(MetaDataRepository repos)
          The repository to use to hold metadata.
 void setWriter(Writer writer)
          The writer to generate metadata to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_ADD

public static final String ACTION_ADD
See Also:
Constant Field Values

ACTION_DROP

public static final String ACTION_DROP
See Also:
Constant Field Values

ACTIONS

public static final String[] ACTIONS
Constructor Detail

MetaDataTool

public MetaDataTool(OpenJPAConfiguration conf,
                    String action)
Constructor. Supply configuration and action.

Method Detail

getAction

public String getAction()
The action supplied on construction.


getFile

public File getFile()
The file to generate metadata to.


setFile

public void setFile(File file)
The file to generate metadata to.


getWriter

public Writer getWriter()
The writer to generate metadata to.


setWriter

public void setWriter(Writer writer)
The writer to generate metadata to.


getRepository

public MetaDataRepository getRepository()
The repository to use to hold metadata.


newRepository

protected MetaDataRepository newRepository()
Create a new metadata repository.


setRepository

public void setRepository(MetaDataRepository repos)
The repository to use to hold metadata.


clear

public void clear()
Reset state. This is called automatically after every record().


run

public void run(Class cls)
Generate new metadata for the given class.


record

public void record()
Record metadata changes.


main

public static void main(String[] args)
                 throws IOException
Usage: java org.apache.openjpa.meta.MetaDataTool [option]* [-action/-a <add | drop>] <class name | .java file | .class file>+ Where the following options are recognized. The available actions are:

Throws:
IOException

run

public static boolean run(OpenJPAConfiguration conf,
                          String[] args,
                          Options opts)
                   throws IOException
Run the tool. Returns false if any invalid options were given.

Throws:
IOException

run

public static boolean run(OpenJPAConfiguration conf,
                          String[] args,
                          MetaDataTool.Flags flags,
                          MetaDataRepository repos,
                          ClassLoader loader)
                   throws IOException
Run the tool. Return false if invalid options were given. The given repository may be null.

Throws:
IOException


Copyright © 2006 Apache Software Foundation. All Rights Reserved.