|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.samskivert.jdbc.depot.tools.GenRecordTask
public class GenRecordTask
An ant task that updates the column constants for a persistent record.
| Field Summary | |
|---|---|
protected ClassLoader |
_cloader
Used to do our own classpath business. |
protected ArrayList<org.apache.tools.ant.types.FileSet> |
_filesets
A list of filesets that contain tile images. |
protected Class<?> |
_prclass
PersistentRecord resolved with the proper classloader so that we can compare it to
loaded derived classes. |
protected org.apache.velocity.app.VelocityEngine |
_velocity
Used to generate source files from templates. |
protected static String |
COL_TMPL
Specifies the path to the column code template. |
protected static String |
FIELDS_END
|
protected static String |
FIELDS_START
|
protected static String |
KEY_TMPL
Specifies the path to the key code template. |
protected static String |
MARKER
|
protected static String |
METHODS_END
|
protected static String |
METHODS_START
|
protected static Pattern |
NAME_PATTERN
A regular expression for matching the class or interface declaration. |
protected static String |
NAME_TMPL
Specifies the path to the name code template. |
protected static Pattern |
PACKAGE_PATTERN
A regular expression for matching the package declaration. |
| Fields inherited from class org.apache.tools.ant.Task |
|---|
target, taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
|---|
description, location, project |
| Constructor Summary | |
|---|---|
GenRecordTask()
|
|
| Method Summary | |
|---|---|
void |
addFileset(org.apache.tools.ant.types.FileSet set)
Adds a nested fileset element which enumerates record source files. |
protected boolean |
check(File source,
String mname,
int mline,
String fname,
int fline)
Helper function for sanity checking marker existence. |
void |
execute()
|
protected String |
get(String[] lines,
int index)
Safely gets the indexth line, returning the empty string if we exceed the
length of the array. |
protected static boolean |
hasAnnotation(Field field,
Class<?> annotation)
|
protected boolean |
isPersistentField(Field field)
Returns true if the supplied field is part of a persistent record (is a public, non-static, non-transient field). |
protected String |
mergeTemplate(String tmpl,
org.apache.velocity.VelocityContext ctx)
Helper function for generating our boilerplate code. |
protected void |
processRecord(File source)
Processes a distributed object source file. |
protected void |
processRecord(File source,
Class<?> rclass)
Processes a resolved persistent record class instance. |
protected static String |
readClassName(File source)
Reads in the supplied source file and locates the package and class or interface name and returns a fully qualified class name. |
void |
setClasspathref(org.apache.tools.ant.types.Reference pathref)
Configures that classpath that we'll use to load record classes. |
protected void |
writeln(BufferedWriter bout,
String line)
Helper function for writing a string and a newline to a writer. |
| Methods inherited from class org.apache.tools.ant.Task |
|---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
|---|
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ArrayList<org.apache.tools.ant.types.FileSet> _filesets
protected ClassLoader _cloader
protected org.apache.velocity.app.VelocityEngine _velocity
protected Class<?> _prclass
PersistentRecord resolved with the proper classloader so that we can compare it to
loaded derived classes.
protected static final String NAME_TMPL
protected static final String COL_TMPL
protected static final String KEY_TMPL
protected static final String MARKER
protected static final String FIELDS_START
protected static final String FIELDS_END
protected static final String METHODS_START
protected static final String METHODS_END
protected static final Pattern PACKAGE_PATTERN
protected static final Pattern NAME_PATTERN
| Constructor Detail |
|---|
public GenRecordTask()
| Method Detail |
|---|
public void addFileset(org.apache.tools.ant.types.FileSet set)
public void setClasspathref(org.apache.tools.ant.types.Reference pathref)
public void execute()
throws org.apache.tools.ant.BuildException
execute in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildExceptionprotected void processRecord(File source)
protected void processRecord(File source,
Class<?> rclass)
protected boolean isPersistentField(Field field)
protected String get(String[] lines,
int index)
indexth line, returning the empty string if we exceed the
length of the array.
protected boolean check(File source,
String mname,
int mline,
String fname,
int fline)
protected void writeln(BufferedWriter bout,
String line)
throws IOException
IOException
protected String mergeTemplate(String tmpl,
org.apache.velocity.VelocityContext ctx)
protected static boolean hasAnnotation(Field field,
Class<?> annotation)
protected static String readClassName(File source)
throws IOException
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||