package org.infinispan.protostream.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Collection;

import org.infinispan.protostream.descriptors.Type;

/**
 * Defines a Protocol Buffers message field. A class must have at least one field/property annotated with {@link
 * ProtoField} in order to be considered a Protocol Buffers message type.
 *
 * @author anistor@redhat.com
 * @since 3.0
 */
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ProtoField {

   /**
    * The Protocol Buffers tag number.
    */
   int number();

   Type type() default Type.MESSAGE;

   boolean required() default false;

   String name() default "";

   String defaultValue() default "";

   Class<?> javaType() default void.class;

   Class<? extends Collection> collectionImplementation() default Collection.class;
}

@@ -775,192 +775,2026 @@
 %0A   
-Type type() default Type.MESSAGE;%0A%0A   boolean required() default false;%0A%0A   String name() default %22%22;%0A%0A   String defaultValue() default %22%22;%0A%0A   Class%3C?%3E javaType() default void.class;%0A
+/**%0A    * The Protobuf type of the field. If not specified, then the field type will be inferred based on the Java property%0A    * type.%0A    */%0A   Type type() default Type.MESSAGE;%0A%0A   /**%0A    * Marks the field as required. Please use this sparingly as it will no longer be supported in Protobuf 3.0.%0A    */%0A   boolean required() default false;%0A%0A   /**%0A    * The name of the field. If not specified, then the name of the Java property is used instead.%0A    */%0A   String name() default %22%22;%0A%0A   /**%0A    * The default value to assign to this field if it is found %3Cem%3Emissing%3C/em%3E in the Protobuf data stream %3Cem%3Eduring%0A    * reading%3C/em%3E.%0A    * %3Cp%3E%0A    * The value is given in the form of a string that must obey correct syntax (as defined by Protobuf spec.) in order%0A    * to be parsed into the actual value which may be of a different type than string.%0A    * %3Cp%3E%0A    * This value has no significance during writing of a %7B@code null%7D field, ie. it does not get written into the data%0A    * stream as a substitute for the missing value. It is expected that the reader of this Protobuf stream will do that%0A    * when reading it back.%0A    */%0A   String defaultValue() default %22%22;%0A%0A   /**%0A    * The actual concrete and instantiable Java type. This Class should be assignable to the property type. It should be%0A    * used when the type is an interface or abstract class in order to designate the actual concrete class that must be%0A    * instantiated by the marshaling layer when reading this from a data stream.%0A    */%0A   Class%3C?%3E javaType() default void.class;%0A%0A   /**%0A    * The actual concrete and instantiable implementation type of the Collection. This Class should only be specified if%0A    * the Java property type is really a Collection and must be assignable to the property type. It should be used when%0A    * the type of the Collection is an interface or an abstract class in order to designate the actual concrete class%0A    * that must be instantiated by the marshaling layer when reading this from a data stream.%0A    */
 %0A   

Improve javadoc of @ProtoField