Class ProtoSchemaBuilder

    • Constructor Detail

      • ProtoSchemaBuilder

        public ProtoSchemaBuilder()
        Deprecated.
    • Method Detail

      • fileName

        public ProtoSchemaBuilder fileName​(String fileName)
        Deprecated.
        Set the name of the Protobuf schema file to generate. This is mandatory. The resulting file will be registered in the SerializationContext with this given name.
        Parameters:
        fileName - the name of the file to generate
        Returns:
        itself
      • packageName

        public ProtoSchemaBuilder packageName​(String packageName)
        Deprecated.
        Set the name of the Protobuf package to generate. This is optional.
        Parameters:
        packageName - the package name
        Returns:
        itself, to help chaining calls
      • generator

        public ProtoSchemaBuilder generator​(String generator)
        Deprecated.
        Sets the 'generated by' comment. This is useful for documentation purposes.
        Parameters:
        generator - a string to be added as a comment in the generated schema
      • addClass

        public ProtoSchemaBuilder addClass​(Class<?> clazz)
        Deprecated.
        Add a @ProtoXyz annotated class to be analyzed. Proto schema and marshaller will be generated for it.

        Its superclass and superinterfaces will be also included in the analysis but no separate Protobuf types and marshallers will be generated for them as Protobuf does not have any notion of type hierarchy and inheritance. The fields defined by the superclass or superinterfaces will be just included in the schema of the derived class.

        Its inner classes will also be automatically processed if they are referenced by the outer class. If you want to make sure an inner class is processed regardless if referenced or not you will have to add it explicitly using #addClass or addClasses(java.lang.Class<?>...).

        Parameters:
        clazz - the class to analyze
        Returns:
        itself, to help chaining calls
      • addClasses

        public ProtoSchemaBuilder addClasses​(Class<?>... classes)
        Deprecated.
        Add several @ProtoXyz annotated classes to be analyzed. Proto schema and marshaller will be generated for them.

        Their superclasses and superinterfaces will be also included in the analysis but no separate Protobuf types and marshallers will be generated for them as Protobuf does not have any notion of type hierarchy and inheritance. The fields defined by the superclass or superinterfaces will be just included in the schema of the derived class.

        Inner classes will also be automatically processed if they are referenced by the outer class. If you want to make sure an inner class is processed regardless if referenced or not you will have to add it explicitly using addClass(java.lang.Class<?>) or #addClasses.

        Parameters:
        classes - the classes to analyze
        Returns:
        itself, to help chaining calls
      • autoImportClasses

        public ProtoSchemaBuilder autoImportClasses​(boolean autoImportClasses)
        Deprecated.
        A flag to control processing of classes that were not directly added but were discovered by analyzing the annotated fields/properties of the added classes. When such a class is found an error will be generated if autoImportClasses is disabled. This flag is true by default to simplify usability (and also for backward compatibility) but can be turned off whenever you need to be very specific about which classes are to be processed. We encourage you to turn it off for maximum control.
        Parameters:
        autoImportClasses -
        Returns:
        itself, to help chaining calls