Class AnnotationContainer
java.lang.Object
io.protostuff.parser.AnnotationContainer
- All Implemented Interfaces:
HasAnnotations, HasProto
- Direct Known Subclasses:
EnumGroup, EnumGroup.Value, Extension, Field, Message, Proto, Service, Service.RpcMethod
Base class for components that contain annotations.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(Annotation annotation) Adds the annoation.booleanaddAnnotations(Map<String, Annotation> source, boolean clearSource) Adds all the annotations to this container.voidstatic IllegalStateExceptionfinal Map<String, Annotation> getA()Short-hand forgetAnnotationMap().getAnnotation(String name) Gets the annotation by key/name.Gets the annotation map.Gets the annotations.getDocs()booleanhasAnnotation(String name) final booleanisEmptyA()Shorthand for annotations.isEmpty().
-
Field Details
-
annotations
-
docs
-
-
Constructor Details
-
AnnotationContainer
public AnnotationContainer()
-
-
Method Details
-
getDocs
-
addDoc
-
add
Description copied from interface:HasAnnotationsAdds the annoation.- Specified by:
addin interfaceHasAnnotations
-
getAnnotationMap
Description copied from interface:HasAnnotationsGets the annotation map.- Specified by:
getAnnotationMapin interfaceHasAnnotations
-
getA
-
getAnnotations
Description copied from interface:HasAnnotationsGets the annotations.- Specified by:
getAnnotationsin interfaceHasAnnotations
-
getAnnotation
Description copied from interface:HasAnnotationsGets the annotation by key/name.- Specified by:
getAnnotationin interfaceHasAnnotations
-
hasAnnotation
-
addAnnotations
Description copied from interface:HasAnnotationsAdds all the annotations to this container. IfclearSourceis true, thesourcearg is cleared.- Specified by:
addAnnotationsin interfaceHasAnnotations
-
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
-