Enum PAnnotation

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<PAnnotation>

    public enum PAnnotation
    extends java.lang.Enum<PAnnotation>
    Enum containing known "general" providence annotations. Note that annotation tags are case sensitive, values depends on the implementation details.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ARGUMENTS_TYPE
      Annotated on a struct field, sets the target struct as arguments that can be used to have argument field content.
      CONTAINER
      Whether a set-like container are normal (hash-), ordered (linked-hash-) or sorted (tree-).
      DEPRECATED
      If the field, message, service or method is not supposed to be used any more.
      JAVA_EXCEPTION_CLASS
      Specify exception class to extend for exception structs.
      JAVA_HAZELCAST_CLASS_ID
      Specify if a struct should be generated using hazelcast.portable interface to be compatible with serialization and deserialization of hazelcast portable.
      JAVA_HAZELCAST_FACTORY_ID
      Specify if a file should generate with support with hazelcast portable implementation.
      JAVA_IMPLEMENTS
      Add extra interfaces to a struct.
      JAVA_PUBLIC_CONSTRUCTOR
      For struct and exception.
      JAVA_SERVICE_METHOD_THROWS
      Specify an exception class to throw instead of the default declared exceptions.
      JSON_COMPACT
      If a struct can use a compact serialized format.
      MESSAGE_FIELD
      Specify which field to use for the exception message.
      NONE  
      REF_ENUM
      Annotated on numeric fields (i8m i16 i32) will make methods to set field from enum value, and get field as enum value.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String tag  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static PAnnotation forTag​(java.lang.String tag)  
      static PAnnotation valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static PAnnotation[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • CONTAINER

        public static final PAnnotation CONTAINER
        Whether a set-like container are normal (hash-), ordered (linked-hash-) or sorted (tree-). Valid for set and map type fields.

        container = "sorted"

        See the PContainer.Type enum for valid values, and how it is handled.

      • DEPRECATED

        public static final PAnnotation DEPRECATED
        If the field, message, service or method is not supposed to be used any more. Whatever is in the value part may be used as the 'deprecated' reason.

        deprecated = "For some reason"

      • JSON_COMPACT

        public static final PAnnotation JSON_COMPACT
        If a struct can use a compact serialized format. Only valid for struct, not for union or exception.

        json.compact
        json.compact = ""

      • ARGUMENTS_TYPE

        public static final PAnnotation ARGUMENTS_TYPE
        Annotated on a struct field, sets the target struct as arguments that can be used to have argument field content. See implementation for GraphQL, which uses it for argument field values, and for adding connecting content.

        arguments.type = "some.Struct"

      • MESSAGE_FIELD

        public static final PAnnotation MESSAGE_FIELD
        Specify which field to use for the exception message. The default is to use the 'message' field, and if neither is set, then a toString variant will be used as the message.

        message.field = "field_name"

      • REF_ENUM

        public static final PAnnotation REF_ENUM
        Annotated on numeric fields (i8m i16 i32) will make methods to set field from enum value, and get field as enum value. If generated language does not truly distinguish between enum and numbers, this does nothing.
      • JAVA_IMPLEMENTS

        public static final PAnnotation JAVA_IMPLEMENTS
        Add extra interfaces to a struct. Not allowed on unions or exceptions. The interface methods must either match the methods implemented by the struct, or have a default implementation.

        java.implements = "my.package.MyInterface"

      • JAVA_EXCEPTION_CLASS

        public static final PAnnotation JAVA_EXCEPTION_CLASS
        Specify exception class to extend for exception structs. The default is to extend Exception, this will override that verbatim. The exception class must be available at compile time, and it *must* have a constructor accepting string message only.

        java.exception.class = "my.package.MyException"

      • JAVA_PUBLIC_CONSTRUCTOR

        public static final PAnnotation JAVA_PUBLIC_CONSTRUCTOR
        For struct and exception. If true will add a public create constructor with all fields available as parameters. Default is not.

        java.public.constructor
        java.public.constructor = ""

      • JAVA_SERVICE_METHOD_THROWS

        public static final PAnnotation JAVA_SERVICE_METHOD_THROWS
        Specify an exception class to throw instead of the default declared exceptions. This is only valid for the Service.Iface interface, and not for the Service.Client implementation.

        Non-declared exceptions, even if extending the declared exception, will be handled as a system failure, and wrapped in an IOException or sent as an application exception.

        java.service.methods.throws = "my.package.MyException"

      • JAVA_HAZELCAST_FACTORY_ID

        public static final PAnnotation JAVA_HAZELCAST_FACTORY_ID
        Specify if a file should generate with support with hazelcast portable implementation.

        The id needs to be a unique int id for each program that is generated with support for hazelcast.

        hazelcast.factory.id = "1"
      • JAVA_HAZELCAST_CLASS_ID

        public static final PAnnotation JAVA_HAZELCAST_CLASS_ID
        Specify if a struct should be generated using hazelcast.portable interface to be compatible with serialization and deserialization of hazelcast portable.

        The id needs to be a unique int id for each struct in the program.

        hazelcast.factory.id = "1"
    • Field Detail

      • tag

        public final java.lang.String tag
    • Method Detail

      • values

        public static PAnnotation[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (PAnnotation c : PAnnotation.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static PAnnotation valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • forTag

        @Nonnull
        public static PAnnotation forTag​(@Nonnull
                                         java.lang.String tag)