Class Annotation

java.lang.Object
io.protostuff.parser.Annotation
All Implemented Interfaces:
HasName

public class Annotation extends Object implements HasName
Annotation for messages, enums, services, rpc, fields
Author:
David Yu
  • Constructor Details

    • Annotation

      public Annotation(String name)
  • Method Details

    • getParams

      public LinkedHashMap<String,Object> getParams()
    • getP

      public final LinkedHashMap<String,Object> getP()
      Shorthand for getParams().

      If you have an annotation like @Foo(id = 1), you then can use:
      <if(message.a.("Foo")>
      <if(message.a.("Foo").p.("id")>
      ...
      <endif>
      <endif>
      
    • getValue

      public <T> T getValue(String key)
    • getName

      public String getName()
      Specified by:
      getName in interface HasName
    • isEmptyP

      public final boolean isEmptyP()
      Shorthand for params.isEmpty().

      You can then use:
      <if(message.a.("Foo").emptyP>
      

      Note that this does not work on stringtemplate:
      <if(message.a.("Foo").empty)>
      
      Even though Map.isEmpty() exists.
      
    • toString

      public String toString()
      Overrides:
      toString in class Object