public abstract class STCodeGenerator extends java.lang.Object implements ProtoCompiler
| Modifier and Type | Field and Description |
|---|---|
static org.antlr.stringtemplate.StringTemplateErrorListener |
ERROR_LISTENER |
static int |
errorCount |
static java.util.regex.Pattern |
FORMAT_DELIM |
static org.antlr.stringtemplate.CommonGroupLoader |
GROUP_LOADER |
protected java.lang.String |
id |
static org.antlr.stringtemplate.AttributeRenderer |
STRING_ATTRIBUTE_RENDERER |
static java.lang.String |
TEMPLATE_BASE |
| Constructor and Description |
|---|
STCodeGenerator(java.lang.String id) |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
chainedFormat(java.lang.String str,
java.lang.String[] formats)
Formats the string n times.
|
protected void |
collect(ProtoModule module,
Proto proto,
java.util.List<Proto> overridden,
boolean compile) |
void |
compile(ProtoModule module)
Compiles the proto configured/encapsulated in the module.
|
protected abstract void |
compile(ProtoModule module,
Proto proto) |
protected void |
compile(ProtoModule module,
Proto proto,
boolean compileImports,
boolean recursive) |
static java.lang.String |
format(java.lang.String str,
java.lang.String formatName)
Formats the string
str using the format formatName. |
java.lang.String |
getOutputId()
The unique id that basically is the target output.
|
static org.antlr.stringtemplate.StringTemplate |
getST(java.lang.String groupName,
java.lang.String name) |
static org.antlr.stringtemplate.StringTemplateGroup |
getSTG(java.lang.String groupName) |
protected static boolean |
override(ProtoModule module,
Proto proto) |
protected static Proto |
parseProto(java.io.File file,
ProtoModule module) |
protected static void |
postCompile(ProtoModule module,
Proto proto) |
static boolean |
setAttributeRenderer(java.lang.Class<?> typeClass,
org.antlr.stringtemplate.AttributeRenderer ar)
Returns true if there was no previous attribute renderer with the same class.
|
static boolean |
setFormatter(java.lang.String name,
Formatter f)
Returns true if there was no previous formatter with the same name.
|
static void |
setGroupLoader(org.antlr.stringtemplate.StringTemplateGroupLoader loader) |
public static final java.lang.String TEMPLATE_BASE
public static final java.util.regex.Pattern FORMAT_DELIM
public static int errorCount
public static final org.antlr.stringtemplate.StringTemplateErrorListener ERROR_LISTENER
public static final org.antlr.stringtemplate.CommonGroupLoader GROUP_LOADER
public static final org.antlr.stringtemplate.AttributeRenderer STRING_ATTRIBUTE_RENDERER
protected final java.lang.String id
public static java.lang.String chainedFormat(java.lang.String str,
java.lang.String[] formats)
For example: input = "some_foo" formatters = ["PCS", "UPPER"] Output: 1st pass: "Some Foo" 2nd pass: "SOME FOO"
public static java.lang.String format(java.lang.String str,
java.lang.String formatName)
str using the format formatName.
If the formatter with the name does not exist, the input string will be appended with the formatName.
public static boolean setAttributeRenderer(java.lang.Class<?> typeClass,
org.antlr.stringtemplate.AttributeRenderer ar)
public static boolean setFormatter(java.lang.String name,
Formatter f)
public static org.antlr.stringtemplate.StringTemplateGroup getSTG(java.lang.String groupName)
public static org.antlr.stringtemplate.StringTemplate getST(java.lang.String groupName,
java.lang.String name)
public static void setGroupLoader(org.antlr.stringtemplate.StringTemplateGroupLoader loader)
public java.lang.String getOutputId()
ProtoCompilergetOutputId in interface ProtoCompilerpublic void compile(ProtoModule module) throws java.io.IOException
ProtoCompilercompile in interface ProtoCompilerjava.io.IOExceptionprotected static Proto parseProto(java.io.File file, ProtoModule module)
protected void compile(ProtoModule module, Proto proto, boolean compileImports, boolean recursive) throws java.io.IOException
java.io.IOExceptionprotected void collect(ProtoModule module, Proto proto, java.util.List<Proto> overridden, boolean compile) throws java.io.IOException
java.io.IOExceptionprotected static boolean override(ProtoModule module, Proto proto)
protected static void postCompile(ProtoModule module, Proto proto)
protected abstract void compile(ProtoModule module, Proto proto) throws java.io.IOException
java.io.IOExceptionCopyright © 2009-2015. All Rights Reserved.