Source
List<String> get annotations {
List<dynamic> metadata;
if (element.computeNode() is AnnotatedNode) {
AnnotatedNode node = element.computeNode() as AnnotatedNode;
// Declarations are contained inside FieldDeclarations, and that is where
// the actual annotations are.
while ((node is VariableDeclaration || node is VariableDeclarationList) &&
node is! FieldDeclaration) {
assert(null != node.parent);
node = node.parent;
}
metadata = node.metadata;
} else if (element.computeNode() is! FormalParameter) {
// TODO(jcollins-g): This is special cased to suppress annotations for
// parameters in constructor documentation. Do we
// want to do this?
metadata = element.metadata;
}
return annotationsFromMetadata(metadata);
}