public abstract class JavaPoetGenerator extends java.lang.Object implements JavaGenerator
| Modifier and Type | Field and Description |
|---|---|
protected com.squareup.javapoet.TypeSpec.Builder |
contentBuilder |
protected static java.lang.String |
DART_API_PACKAGE |
protected static java.lang.String |
DART_LIB_PACKAGE |
protected static com.squareup.javapoet.ClassName |
TOKEN_CLASS |
| Constructor and Description |
|---|
JavaPoetGenerator(java.lang.String classSuffix) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
className()
Return the simple name of the currently generated class.
|
protected com.squareup.javapoet.ClassName |
currentClass()
Return the name of the currently generated Dart.
|
protected java.lang.String |
dartName()
Return the dart name.
|
java.lang.String |
fileContent()
Return the generated file content.
|
protected java.lang.String |
generationPackage()
Compute the dart package from its name and the set output package.
|
protected boolean |
hasContent()
Determine if the generator has some content to generate.
|
protected void |
setDartName(java.lang.String dartName)
Set the dart name for the current generation
|
protected static final java.lang.String DART_LIB_PACKAGE
protected static final java.lang.String DART_API_PACKAGE
protected static final com.squareup.javapoet.ClassName TOKEN_CLASS
protected com.squareup.javapoet.TypeSpec.Builder contentBuilder
public java.lang.String fileContent()
JavaGeneratorfileContent in interface JavaGeneratorprotected boolean hasContent()
public java.lang.String className()
JavaGeneratorclassName in interface JavaGeneratorprotected java.lang.String generationPackage()
protected com.squareup.javapoet.ClassName currentClass()
ClassName of the dart.protected java.lang.String dartName()
java.lang.IllegalStateException - if the dart name is not set.protected void setDartName(java.lang.String dartName)
dartName - The name to set.