public abstract class JavaGeneratingProcessor extends AbstractProcessor
Modifier and Type | Field and Description |
---|---|
protected CodeGeneratorContext |
context |
processingEnv
Constructor and Description |
---|
JavaGeneratingProcessor() |
Modifier and Type | Method and Description |
---|---|
<T> TypeDef |
createTypeFromTemplate(T model,
String[] parameters,
String content)
Generate a
TypeDef from the specified model, parameters and template. |
void |
generateFromResources(TypeDef model,
JavaFileObject fileObject,
String resourceName)
Generates a source file from the specified
TypeDef . |
void |
generateFromResources(TypeDef model,
String resourceName)
Generates a source file from the specified
TypeDef . |
<T> void |
generateFromStringTemplate(T model,
String[] parameters,
FileObject fileObject,
String content)
Generates a source file from the specified
TypeDef . |
<T> void |
generateFromStringTemplate(T model,
String[] parameters,
String outputPath,
String content)
Generates a source file from the specified
TypeDef . |
<T> void |
generateFromStringTemplate(T model,
String outputPath,
String content)
Generates a source file from the specified
TypeDef . |
void |
generateFromStringTemplate(TypeDef model,
String[] parameters,
String content)
Generates a source file from the specified
TypeDef . |
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, init, isInitialized, process
protected CodeGeneratorContext context
public void generateFromResources(TypeDef model, String resourceName) throws IOException
TypeDef
.model
- The model of the class to generate.resourceName
- The template to use.IOException
- If it fails to create the source file.public void generateFromResources(TypeDef model, JavaFileObject fileObject, String resourceName) throws IOException
TypeDef
.model
- The model of the class to generate.fileObject
- Where to save the generated class.resourceName
- The template to use.IOException
- If it fails to create the source file.public void generateFromStringTemplate(TypeDef model, String[] parameters, String content) throws IOException
TypeDef
.model
- The model of the class to generate.content
- The template to use.IOException
- If it fails to create the source file.public <T> void generateFromStringTemplate(T model, String[] parameters, FileObject fileObject, String content) throws IOException
TypeDef
.model
- The model of the class to generate.parameters
- The external parameters to pass to the template.fileObject
- Where to save the generated class.content
- The template to use.IOException
- If it fails to create the source file.public <T> void generateFromStringTemplate(T model, String outputPath, String content) throws IOException
TypeDef
.model
- The model of the class to generate.outputPath
- Where to save the generated class.content
- The template to use.IOException
- If it fails to create the source file.public <T> void generateFromStringTemplate(T model, String[] parameters, String outputPath, String content) throws IOException
TypeDef
.model
- The model of the class to generate.outputPath
- Where to save the generated class.content
- The template to use.IOException
- If it fails to create the source file.Copyright © 2019 JBoss by Red Hat. All rights reserved.