Package io.protostuff.parser
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 TypeMethodDescriptionvoid
add
(Annotation annotation) Adds the annoation.boolean
addAnnotations
(Map<String, Annotation> source, boolean clearSource) Adds all the annotations to this container.void
static IllegalStateException
final Map
<String, Annotation> getA()
Short-hand forgetAnnotationMap()
.getAnnotation
(String name) Gets the annotation by key/name.Gets the annotation map.Gets the annotations.getDocs()
boolean
hasAnnotation
(String name) final boolean
isEmptyA()
Shorthand for annotations.isEmpty().
-
Field Details
-
annotations
-
docs
-
-
Constructor Details
-
AnnotationContainer
public AnnotationContainer()
-
-
Method Details
-
getDocs
-
addDoc
-
add
Description copied from interface:HasAnnotations
Adds the annoation.- Specified by:
add
in interfaceHasAnnotations
-
getAnnotationMap
Description copied from interface:HasAnnotations
Gets the annotation map.- Specified by:
getAnnotationMap
in interfaceHasAnnotations
-
getA
-
getAnnotations
Description copied from interface:HasAnnotations
Gets the annotations.- Specified by:
getAnnotations
in interfaceHasAnnotations
-
getAnnotation
Description copied from interface:HasAnnotations
Gets the annotation by key/name.- Specified by:
getAnnotation
in interfaceHasAnnotations
-
hasAnnotation
-
addAnnotations
Description copied from interface:HasAnnotations
Adds all the annotations to this container. IfclearSource
is true, thesource
arg is cleared.- Specified by:
addAnnotations
in 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
-