Annotation Type ProtoAdapter


  • @Target(TYPE)
    @Retention(RUNTIME)
    @Documented
    public @interface ProtoAdapter
    A marshalling adapter for a target class or enum that cannot be annotated for various reasons. This class will handle the schema definition and marshalling for the target by declaring a protobuf schema via annotations.
    This class will not become marshallable! It is the target class that becomes marshallable.

    When used on classes:
    The class bearing this annotation will have an annotated factory method for the marshalled class and annotated accessor methods for each field. These methods can be instance or static methods and their first argument must be the marshalled class. Annotations must be placed only on methods. Direct field annotations are not allowed.

    This class must be thread-safe and stateless and must have an accessible no argument constructor. A single instance of it will be created per SerializationContext.

    When used on enums:
    For each enum value in this enum there must exist en identically named enum value in the target enum.

    Since:
    4.4
    Author:
    anistor@redhat.com
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      Class<?> value
      The actual class being marshalled.
    • Element Detail

      • value

        Class<?> value
        The actual class being marshalled.