public class Compiler extends Object
| Constructor and Description |
|---|
Compiler()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
compile()
Merge Tesla schemas and generate source code use the current settings.
|
String |
getAppSchemaClassName()
Get the full name the generated serializer class name.
|
String |
getAppSchemaTemplatePath()
Get the path of user serializer source code template.
|
String |
getClasspath()
Get the classpath where compiler load Java classes for user extensions.
|
String |
getClassTemplatePath()
Get the user class source code template.
|
String |
getEnumTemplatePath()
Get the user enum source code template.
|
Map<String,String> |
getExtension()
Get user extensions.
|
String |
getLanguage()
Get the name of programming language we are generation source code.
|
String |
getOutputDir()
Get the base output directory of the generated source code.
|
List<String> |
getSchemaFiles()
Get the list of schema file paths.
|
boolean |
isNotGenerateUserTypes()
Check if it is configured to not generate source code for user types.
|
static void |
main(String[] args) |
void |
setAppSchemaClassName(String appSchemaClassName)
Set the full name the generated serializer class name.
|
void |
setAppSchemaTemplatePath(String appSchemaTemplatePath)
Set the path of user serializer source code template.
|
void |
setClasspath(String classpath)
Set the classpath where compiler load Java classes for user extensions.
|
void |
setClassTemplatePath(String classTemplatePath)
Set the user class source code template.
|
void |
setEnumTemplatePath(String enumTemplatePath)
Set the user enum source code template.
|
void |
setExtension(Map<String,String> extension)
Set user extensions.
|
void |
setLanguage(String language)
Set the name of programming language we are generation source code
|
void |
setNotGenerateUserTypes(boolean notGenerateUserTypes)
Configure compiler to not generate source code for user types.
|
void |
setOutputDir(String outputDir)
Set the base output directory of the generated source code.
|
void |
setSchemaFiles(List<String> schemaFiles)
Set input schema file paths.
|
public String getLanguage()
public String getAppSchemaClassName()
public String getOutputDir()
public String getClassTemplatePath()
public String getEnumTemplatePath()
public String getAppSchemaTemplatePath()
public boolean isNotGenerateUserTypes()
public Map<String,String> getExtension()
public List<String> getSchemaFiles()
public String getClasspath()
public void setLanguage(String language)
language - the name of programming language we are generation source codepublic void setAppSchemaClassName(String appSchemaClassName)
appSchemaClassName - the full name the generated serializer class name.public void setOutputDir(String outputDir)
outputDir - the base output directory of the generated source code.public void setClassTemplatePath(String classTemplatePath)
classTemplatePath - the user class source code template.public void setEnumTemplatePath(String enumTemplatePath)
enumTemplatePath - the user enum source code template.public void setAppSchemaTemplatePath(String appSchemaTemplatePath)
appSchemaTemplatePath - the path of user serializer source code template.public void setNotGenerateUserTypes(boolean notGenerateUserTypes)
This is false by default.
notGenerateUserTypes - set this to true for partial code generation which doesn't generate source code for user
classes and enums.public void setExtension(Map<String,String> extension)
The keys are extension names while the values are full class names of the extensions.
extension - the extension to setpublic void setSchemaFiles(List<String> schemaFiles)
schemaFiles - the list of schema file paths.public void setClasspath(String classpath)
Tesla compiler will search for user extensions from both system class path and class paths specified here.
classpath - the Java classpath where compiler load Java classes for user extensions.public void compile()
throws Exception
ExceptionCopyright © 2015. All Rights Reserved.