public abstract class AnnotationContainer extends Object implements HasAnnotations, HasProto
| Constructor and Description |
|---|
AnnotationContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Annotation annotation)
Adds the annoation.
|
boolean |
addAnnotations(Map<String,Annotation> source,
boolean clearSource)
Adds all the annotations to this container.
|
void |
addDoc(String doc) |
static IllegalStateException |
err(String msg,
Proto proto) |
Map<String,Annotation> |
getA()
Short-hand for
getAnnotationMap(). |
Annotation |
getAnnotation(String name)
Gets the annotation by key/name.
|
Map<String,Annotation> |
getAnnotationMap()
Gets the annotation map.
|
Collection<Annotation> |
getAnnotations()
Gets the annotations.
|
ArrayList<String> |
getDocs() |
boolean |
hasAnnotation(String name) |
boolean |
isEmptyA()
Shorthand for annotations.isEmpty().
|
public void addDoc(String doc)
public void add(Annotation annotation)
HasAnnotationsadd in interface HasAnnotationspublic Map<String,Annotation> getAnnotationMap()
HasAnnotationsgetAnnotationMap in interface HasAnnotationspublic final Map<String,Annotation> getA()
public Collection<Annotation> getAnnotations()
HasAnnotationsgetAnnotations in interface HasAnnotationspublic Annotation getAnnotation(String name)
HasAnnotationsgetAnnotation in interface HasAnnotationspublic boolean hasAnnotation(String name)
public boolean addAnnotations(Map<String,Annotation> source, boolean clearSource)
HasAnnotationsclearSource is true, the source arg is cleared.addAnnotations in interface HasAnnotationspublic final boolean isEmptyA()
You can then use: <if(message.emptyA)>
Note that this does not work on stringtemplate:
<if(message.annotationMap.empty)>
Even though Map.isEmpty() exists.
public static IllegalStateException err(String msg, Proto proto)
Copyright © 2009–2021. All rights reserved.