org.codehaus.metaclass.tools.tasks
Class GenerateClassDescriptorsTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byorg.codehaus.metaclass.tools.tasks.GenerateClassDescriptorsTask
All Implemented Interfaces:
CompilerMonitor

public class GenerateClassDescriptorsTask
extends org.apache.tools.ant.Task
implements CompilerMonitor

A Task to generate Attributes descriptors from source files.

Version:
$Revision: 1.21 $ $Date: 2004/01/16 02:07:29 $
Author:
Peter Donald

Field Summary
static int BINARY_TYPE
          Constant indicating should write out binary descriptors.
static int CLASS_TYPE
          Constant indicating should write out binary descriptors.
static int XML_TYPE
          Constant indicating should write out serialized xml descriptors.
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
GenerateClassDescriptorsTask()
           
 
Method Summary
 void addFileset(org.apache.tools.ant.types.FileSet fileSet)
          Add fileset to list of files to be processed.
 void addFilter(PluginElement element)
          Add a filter definition that will create filter to process metadata.
 void addFilterSet(FilterSet set)
          Add a filter definition set.
 void addInterceptor(PluginElement element)
          Add an interceptor definition that will create interceptor to process metadata.
 void addInterceptorSet(InterceptorSet set)
          Add an interceptor definition set.
 void errorGeneratingDescriptor(java.lang.String classname, java.lang.Throwable t)
          Error generating descriptor for specified class.
 void errorWritingDescriptor(ClassDescriptor descriptor, java.lang.Exception e)
          Print error message and flag task as having failed.
 void execute()
          Generate classes and output.
protected  ClassDescriptorCompiler getCompiler()
          Return the Compiler used to create descriptors.
 void javaClassObjectsLoaded(java.util.Collection classes)
          * @see CompilerMonitor#javaClassObjectsLoaded
 void missingSourceFile(java.io.File file)
          Print error message and flag task as having failed.
 void postBuildDescriptorsList(java.util.Collection descriptors)
          Called to notify Monitor about the set of ClassDescriptors created.
 void postCompactDescriptorsList(java.util.Collection descriptors)
          Called to notify Monitor about the set of ClassDescriptors after compacting.
 void postFilterJavaClassList(java.util.Collection classes)
          * @see CompilerMonitor#postFilterJavaClassList
 void setDestDir(java.io.File destDir)
          Set the destination directory for generated files.
 void setFormat(FormatEnum format)
          Specify the output format.
 void setKeepEmptyMethods(boolean keepEmptyMethods)
          Set flag indicating whether Compacter should keep empty methods.
 void setNamespaceTagsOnly(boolean namespaceTagsOnly)
          Set the flag whether non-namespaced tags are filtered out.
 void setProject(org.apache.tools.ant.Project project)
          Setup project for task.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_TYPE

public static final int CLASS_TYPE
Constant indicating should write out binary descriptors.

See Also:
Constant Field Values

BINARY_TYPE

public static final int BINARY_TYPE
Constant indicating should write out binary descriptors.

See Also:
Constant Field Values

XML_TYPE

public static final int XML_TYPE
Constant indicating should write out serialized xml descriptors.

See Also:
Constant Field Values
Constructor Detail

GenerateClassDescriptorsTask

public GenerateClassDescriptorsTask()
Method Detail

setProject

public void setProject(org.apache.tools.ant.Project project)
Setup project for task.

Parameters:
project - the project

addFilter

public void addFilter(PluginElement element)
Add a filter definition that will create filter to process metadata.

Parameters:
element - the filter definition

addFilterSet

public void addFilterSet(FilterSet set)
Add a filter definition set.

Parameters:
set - a filter definition set.

addInterceptor

public void addInterceptor(PluginElement element)
Add an interceptor definition that will create interceptor to process metadata.

Parameters:
element - the interceptor definition

addInterceptorSet

public void addInterceptorSet(InterceptorSet set)
Add an interceptor definition set.

Parameters:
set - the interceptor set

addFileset

public void addFileset(org.apache.tools.ant.types.FileSet fileSet)
Add fileset to list of files to be processed.

Parameters:
fileSet - fileset to list of files to be processed.

setDestDir

public void setDestDir(java.io.File destDir)
Set the destination directory for generated files.

Parameters:
destDir - the destination directory for generated files.

setFormat

public void setFormat(FormatEnum format)
Specify the output format. Must be one of xml or serialized.

Parameters:
format - the output format

setKeepEmptyMethods

public void setKeepEmptyMethods(boolean keepEmptyMethods)
Set flag indicating whether Compacter should keep empty methods.

Parameters:
keepEmptyMethods - the flag

setNamespaceTagsOnly

public void setNamespaceTagsOnly(boolean namespaceTagsOnly)
Set the flag whether non-namespaced tags are filtered out.

Parameters:
namespaceTagsOnly - true to filter out non-namespaced tags

execute

public void execute()
Generate classes and output.


errorWritingDescriptor

public void errorWritingDescriptor(ClassDescriptor descriptor,
                                   java.lang.Exception e)
Print error message and flag task as having failed.

Specified by:
errorWritingDescriptor in interface CompilerMonitor
Parameters:
descriptor - the descriptor
e - the exception

missingSourceFile

public void missingSourceFile(java.io.File file)
Print error message and flag task as having failed.

Specified by:
missingSourceFile in interface CompilerMonitor
Parameters:
file - the source file

javaClassObjectsLoaded

public void javaClassObjectsLoaded(java.util.Collection classes)
* @see CompilerMonitor#javaClassObjectsLoaded

Specified by:
javaClassObjectsLoaded in interface CompilerMonitor
Parameters:
classes - the list of JavaClass objects

postFilterJavaClassList

public void postFilterJavaClassList(java.util.Collection classes)
* @see CompilerMonitor#postFilterJavaClassList

Specified by:
postFilterJavaClassList in interface CompilerMonitor
Parameters:
classes - the list of JavaClass objects

postBuildDescriptorsList

public void postBuildDescriptorsList(java.util.Collection descriptors)
Description copied from interface: CompilerMonitor
Called to notify Monitor about the set of ClassDescriptors created.

Specified by:
postBuildDescriptorsList in interface CompilerMonitor
Parameters:
descriptors - the ClassDescriptors compiled.
See Also:
CompilerMonitor.postBuildDescriptorsList(java.util.Collection)

postCompactDescriptorsList

public void postCompactDescriptorsList(java.util.Collection descriptors)
Description copied from interface: CompilerMonitor
Called to notify Monitor about the set of ClassDescriptors after compacting.

Specified by:
postCompactDescriptorsList in interface CompilerMonitor
Parameters:
descriptors - the ClassDescriptors post compacting.
See Also:
CompilerMonitor.postCompactDescriptorsList(java.util.Collection)

errorGeneratingDescriptor

public void errorGeneratingDescriptor(java.lang.String classname,
                                      java.lang.Throwable t)
Description copied from interface: CompilerMonitor
Error generating descriptor for specified class.

Specified by:
errorGeneratingDescriptor in interface CompilerMonitor
Parameters:
classname - the name of the class
t - the error
See Also:
CompilerMonitor.errorGeneratingDescriptor(java.lang.String, java.lang.Throwable)

getCompiler

protected final ClassDescriptorCompiler getCompiler()
Return the Compiler used to create descriptors.

Returns:
the Compiler used to create descriptors.


Copyright © 2003-2004 Codehaus. All Rights Reserved.