Class AnnotationContainer

    • Field Detail

      • annotations

        final java.util.LinkedHashMap<java.lang.String,​Annotation> annotations
      • docs

        final java.util.ArrayList<java.lang.String> docs
    • Constructor Detail

      • AnnotationContainer

        public AnnotationContainer()
    • Method Detail

      • getDocs

        public java.util.ArrayList<java.lang.String> getDocs()
      • addDoc

        public void addDoc​(java.lang.String doc)
      • getA

        public final java.util.Map<java.lang.String,​Annotation> getA()
        Short-hand for getAnnotationMap().

        You then can use:

         <if(message.a.("SomeAnnotation"))>
         
      • hasAnnotation

        public boolean hasAnnotation​(java.lang.String name)
      • addAnnotations

        public boolean addAnnotations​(java.util.Map<java.lang.String,​Annotation> source,
                                      boolean clearSource)
        Description copied from interface: HasAnnotations
        Adds all the annotations to this container. If clearSource is true, the source arg is cleared.
        Specified by:
        addAnnotations in interface HasAnnotations
      • isEmptyA

        public final boolean isEmptyA()
        Shorthand for annotations.isEmpty().

         You can then use:
         <if(message.emptyA)>
         

         Note that this does not work on stringtemplate:
         <if(message.annotationMap.empty)>
         
         Even though Map.isEmpty() exists.
         
      • err

        public static java.lang.IllegalStateException err​(java.lang.String msg,
                                                          Proto proto)