Package io.protostuff.compiler
Class ProtoToProtoCompiler
- java.lang.Object
-
- io.protostuff.compiler.STCodeGenerator
-
- io.protostuff.compiler.ProtoToProtoCompiler
-
- All Implemented Interfaces:
ProtoCompiler
public class ProtoToProtoCompiler extends STCodeGenerator
Kind of preprocessor for proto files. Able to extend one messages with fields from other ones.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
LINE_SEPARATOR
-
Fields inherited from class io.protostuff.compiler.STCodeGenerator
DEFAULT_FORMATTERS, DEFAULT_RENDERERS, ERROR_LISTENER, errorCount, FORMAT_DELIM, GROUP_LOADER, id, STRING_ATTRIBUTE_RENDERER, TEMPLATE_BASE
-
-
Constructor Summary
Constructors Constructor Description ProtoToProtoCompiler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
compile(ProtoModule module, Proto proto)
static java.lang.String
extendBy(org.antlr.stringtemplate.StringTemplateGroup group, Message extend, Message by)
static java.lang.String
generateIndentation(java.lang.String indentation, int length)
static java.lang.String
generateTimestamp(Message extend, Message by)
static java.lang.String
injectAfterAnnotation(Message extend, Message by, java.lang.String extendProto, java.lang.String byContent)
static java.lang.String
injectAfterOption(Message extend, Message by, java.lang.String extendProto, java.lang.String byContent)
static java.lang.String
insertIndentation(java.lang.String content, java.lang.String indent)
-
Methods inherited from class io.protostuff.compiler.STCodeGenerator
chainedFormat, collect, compile, compile, format, getOutputId, getST, getSTG, override, parseProto, postCompile, setAttributeRenderer, setFormatter, setGroupLoader
-
-
-
-
Method Detail
-
compile
public void compile(ProtoModule module, Proto proto) throws java.io.IOException
- Specified by:
compile
in classSTCodeGenerator
- Throws:
java.io.IOException
-
extendBy
public static java.lang.String extendBy(org.antlr.stringtemplate.StringTemplateGroup group, Message extend, Message by) throws java.io.IOException
- Throws:
java.io.IOException
-
injectAfterAnnotation
public static java.lang.String injectAfterAnnotation(Message extend, Message by, java.lang.String extendProto, java.lang.String byContent)
-
injectAfterOption
public static java.lang.String injectAfterOption(Message extend, Message by, java.lang.String extendProto, java.lang.String byContent)
-
insertIndentation
public static java.lang.String insertIndentation(java.lang.String content, java.lang.String indent)
-
generateIndentation
public static java.lang.String generateIndentation(java.lang.String indentation, int length)
-
-