public final class ProtoSchemaBuilder extends Object
ProtoMessage
, ProtoField
, ProtoEnum
, ProtoEnumValue
, ProtoDoc
and ProtoUnknownFieldSet
.Modifier and Type | Field and Description |
---|---|
static String |
FILE_LONG_OPT |
static String |
FILE_OPT |
static boolean |
generateSchemaDebugComments
Set this flag to
true to enable output of debug comments in the generated protobuf schema. |
static String |
HELP_LONG_OPT |
static String |
HELP_OPT |
static String |
MARSHALLER_LONG_OPT |
static String |
MARSHALLER_OPT |
static String |
PACKAGE_LONG_OPT |
static String |
PACKAGE_OPT |
static String |
SCHEMA_LONG_OPT |
static String |
SCHEMA_OPT |
Constructor and Description |
---|
ProtoSchemaBuilder() |
Modifier and Type | Method and Description |
---|---|
ProtoSchemaBuilder |
addClass(Class<?> clazz)
Add a @ProtoXyz annotated class to be analyzed.
|
String |
build(SerializationContext serializationContext)
Builds the Protocol Buffers schema file defining the types and generates marshaller implementations for these
types and registers everything with the given
SerializationContext . |
ProtoSchemaBuilder |
fileName(String fileName)
Set the name of the protobuf schema file to generate.
|
static void |
main(String[] args) |
ProtoSchemaBuilder |
packageName(String packageName)
Set the name of the protobuf package to generate.
|
public static final String FILE_OPT
public static final String FILE_LONG_OPT
public static final String PACKAGE_OPT
public static final String PACKAGE_LONG_OPT
public static final String HELP_OPT
public static final String HELP_LONG_OPT
public static final String MARSHALLER_OPT
public static final String MARSHALLER_LONG_OPT
public static final String SCHEMA_OPT
public static final String SCHEMA_LONG_OPT
public static boolean generateSchemaDebugComments
true
to enable output of debug comments in the generated protobuf schema.public ProtoSchemaBuilder fileName(String fileName)
SerializationContext
with this given name.fileName
- the name of the file to generatepublic ProtoSchemaBuilder packageName(String packageName)
packageName
- the package namepublic ProtoSchemaBuilder addClass(Class<?> clazz)
clazz
- the class to analyzepublic String build(SerializationContext serializationContext) throws ProtoSchemaBuilderException, IOException
SerializationContext
.serializationContext
- ProtoSchemaBuilderException
IOException
Copyright © 2017 JBoss, a division of Red Hat. All rights reserved.