com.cedarsoft.codegen
Class AbstractGenerator

java.lang.Object
  extended by com.cedarsoft.codegen.AbstractGenerator

public abstract class AbstractGenerator
extends Object

Abstract base class for Generators. Handles options and classloader issues


Nested Class Summary
static interface AbstractGenerator.Runner
          The runner interface
 
Field Summary
static String GENERATE_METHOD_NAME
           
 
Constructor Summary
AbstractGenerator()
           
 
Method Summary
protected static String calculateRelativePath(File dir, File serializerFile)
           
 com.sun.tools.xjc.api.util.APTClassLoader createAptClassLoader()
           
 com.sun.tools.xjc.api.util.APTClassLoader createAptClassLoader(ClassLoader defaultClassLoader)
           
static File createEmptyTmpDir()
           
 Object createRunner()
           
 Object createRunner(Class<?> runnerType)
           
 ClassLoader getDefaultClassLoader()
           
protected  List<? extends String> getPackagePrefixes()
           
protected abstract  String getRunnerClassName()
           
 Class<?> getRunnerType()
           
 void run(Class<?> runnerType, GeneratorConfiguration configuration)
           
protected  void run(Collection<? extends File> domainSourceFiles, File destination, File resourcesDestination, File testDestination, File testResourcesDestination, Classpath classpath, PrintWriter logOut)
           
 void run(GeneratorConfiguration configuration)
           
 void run(GeneratorConfiguration configuration, Object runner)
           
protected  void transferFiles(File sourceDir, File destination, PrintWriter logOut)
           
 void transferFiles(GeneratorConfiguration tmpConfiguration, GeneratorConfiguration configuration)
          Transfers the files
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GENERATE_METHOD_NAME

@NonNls
public static final String GENERATE_METHOD_NAME
See Also:
Constant Field Values
Constructor Detail

AbstractGenerator

public AbstractGenerator()
Method Detail

run

protected void run(@NotNull
                   Collection<? extends File> domainSourceFiles,
                   @NotNull
                   File destination,
                   @NotNull
                   File resourcesDestination,
                   @NotNull
                   File testDestination,
                   @NotNull
                   File testResourcesDestination,
                   @Nullable
                   Classpath classpath,
                   @NotNull
                   PrintWriter logOut)
            throws com.sun.tools.xjc.api.util.ToolsJarNotFoundException,
                   ClassNotFoundException,
                   IOException,
                   InterruptedException
Throws:
com.sun.tools.xjc.api.util.ToolsJarNotFoundException
ClassNotFoundException
IOException
InterruptedException

run

public void run(@NotNull
                GeneratorConfiguration configuration)
         throws com.sun.tools.xjc.api.util.ToolsJarNotFoundException,
                ClassNotFoundException
Throws:
com.sun.tools.xjc.api.util.ToolsJarNotFoundException
ClassNotFoundException

run

public void run(@NotNull
                Class<?> runnerType,
                @NotNull
                GeneratorConfiguration configuration)
         throws com.sun.tools.xjc.api.util.ToolsJarNotFoundException,
                ClassNotFoundException
Throws:
com.sun.tools.xjc.api.util.ToolsJarNotFoundException
ClassNotFoundException

run

public void run(@NotNull
                GeneratorConfiguration configuration,
                @NotNull
                Object runner)

createRunner

@NotNull
public Object createRunner()
                    throws com.sun.tools.xjc.api.util.ToolsJarNotFoundException,
                           ClassNotFoundException
Throws:
com.sun.tools.xjc.api.util.ToolsJarNotFoundException
ClassNotFoundException

createRunner

public Object createRunner(@NotNull
                           Class<?> runnerType)

getRunnerType

@NotNull
public Class<?> getRunnerType()
                       throws com.sun.tools.xjc.api.util.ToolsJarNotFoundException,
                              ClassNotFoundException
Throws:
com.sun.tools.xjc.api.util.ToolsJarNotFoundException
ClassNotFoundException

transferFiles

public void transferFiles(@NotNull
                          GeneratorConfiguration tmpConfiguration,
                          @NotNull
                          GeneratorConfiguration configuration)
                   throws IOException,
                          InterruptedException
Transfers the files

Parameters:
tmpConfiguration - the temporary configuration (the source)
configuration - the configuration (the target)
Throws:
IOException
InterruptedException

createAptClassLoader

@NotNull
public com.sun.tools.xjc.api.util.APTClassLoader createAptClassLoader()
                                                               throws com.sun.tools.xjc.api.util.ToolsJarNotFoundException
Throws:
com.sun.tools.xjc.api.util.ToolsJarNotFoundException

createAptClassLoader

@NotNull
public com.sun.tools.xjc.api.util.APTClassLoader createAptClassLoader(@NotNull
                                                                              ClassLoader defaultClassLoader)
                                                               throws com.sun.tools.xjc.api.util.ToolsJarNotFoundException
Throws:
com.sun.tools.xjc.api.util.ToolsJarNotFoundException

getDefaultClassLoader

@NotNull
public ClassLoader getDefaultClassLoader()

getPackagePrefixes

@NotNull
@NonNls
protected List<? extends String> getPackagePrefixes()

transferFiles

protected void transferFiles(@NotNull
                             File sourceDir,
                             @NotNull
                             File destination,
                             @NotNull
                             PrintWriter logOut)
                      throws IOException,
                             InterruptedException
Throws:
IOException
InterruptedException

calculateRelativePath

@NotNull
@NonNls
protected static String calculateRelativePath(@NotNull
                                                             File dir,
                                                             @NotNull
                                                             File serializerFile)
                                       throws IOException
Throws:
IOException

createEmptyTmpDir

@NotNull
public static File createEmptyTmpDir()

getRunnerClassName

@NotNull
@NonNls
protected abstract String getRunnerClassName()


Copyright © 2010 cedarsoft GmbH. All Rights Reserved.