@Target(value={TYPE,PACKAGE}) @Retention(value=CLASS) public @interface AutoProtoSchemaBuilder
SerializationContextInitializer
. Annotate a class or interface
extending from SerializationContextInitializer
with this annotation and a new concrete public class named
based on className()
, having a default no-arguments public constructor will be generated at compile time in
the same package. The implementations of the methods from SerializationContextInitializer
will be generated
based on the information provided in the attributes of this annotation.
This annotation is used at compile time annotation processing only and should not be relied upon at runtime, so its
retention is set to RetentionPolicy.CLASS
.
Modifier and Type | Optional Element and Description |
---|---|
boolean |
autoImportClasses
Indicates if we accept classes not explicitly included by
includeClasses() and basePackages() to be
auto-detected by reference from the already included classes and to be added automatically. |
String[] |
basePackages
The list of packages to scan (optional).
|
String |
className
The name of the generated Java implementation class (optional).
|
Class<? extends SerializationContextInitializer>[] |
dependsOn
The initializers to execute before this one.
|
Class<?>[] |
excludeClasses
Classes to be explicitly excluded.
|
Class<?>[] |
includeClasses
Annotated classes to process (optional).
|
String |
schemaFileName
The generated Protobuf schema file name (optional).
|
String |
schemaFilePath
Generated Protobuf schema resource file path (optional).
|
String |
schemaPackageName
Package of the generated Protobuf schema.
|
boolean |
service
Enable generation of a
META-INF/services file for the generated class of the SerializationContextInitializer implementation to be loadable by the ServiceLoader . |
String[] |
value
Alias for
basePackages() . |
public abstract String className
public abstract String schemaFileName
'/'
characters, so it might appear like
a relative name. Must end with ".proto" suffix. The schema will be registered under this name in the SerializationContext
. If missing, the simple name of the annotated class will be used
plus the ".proto" suffix.public abstract String schemaFilePath
public abstract String schemaPackageName
public abstract String[] value
public abstract String[] basePackages
basePackages
is empty then all packages are considered. The packages are filtered based on the includeClasses()
/excludeClasses()
filter. If neither includeClasses()
nor basePackages
was
specified then the entire source path will be scanned. This last option should only be used in very simple demo
projects.public abstract Class<?>[] includeClasses
basePackages()
(if specified) or they will be skipped. If includeClasses
is empty, all ProtoXyz
annotated classes that belong to the packages listed in basePackages()
will be scanned. If
neither includeClasses
nor basePackages()
was specified then the entire source path will be
scanned. This last option should only be used in very simple demo projects.public abstract Class<?>[] excludeClasses
public abstract boolean autoImportClasses
includeClasses()
and basePackages()
to be
auto-detected by reference from the already included classes and to be added automatically. If this is set to
false
it fails if such a case is encountered.public abstract boolean service
META-INF/services
file for the generated class of the SerializationContextInitializer
implementation to be loadable by the ServiceLoader
. This is
optional and provided for convenience.public abstract Class<? extends SerializationContextInitializer>[] dependsOn
AutoProtoSchemaBuilder
from which a SerializationContextInitializer
is being generated at compile-time
annotation processing.Copyright © 2019 JBoss, a division of Red Hat. All rights reserved.