@@ -2284,6 +2284,10 @@ class ElementAnnotationImpl implements ElementAnnotation {
22842284 /// deprecated.
22852285 static const String _DEPRECATED_VARIABLE_NAME = "deprecated" ;
22862286
2287+ /// The name of the top-level variable used to mark an element as not to be
2288+ /// stored.
2289+ static const String _DO_NOT_STORE_VARIABLE_NAME = "doNotStore" ;
2290+
22872291 /// The name of the top-level variable used to mark a method as being a
22882292 /// factory.
22892293 static const String _FACTORY_VARIABLE_NAME = "factory" ;
@@ -2411,6 +2415,12 @@ class ElementAnnotationImpl implements ElementAnnotation {
24112415 return false ;
24122416 }
24132417
2418+ @override
2419+ bool get isDoNotStore =>
2420+ element is PropertyAccessorElement &&
2421+ element.name == _DO_NOT_STORE_VARIABLE_NAME &&
2422+ element.library? .name == _META_LIB_NAME ;
2423+
24142424 @override
24152425 bool get isFactory =>
24162426 element is PropertyAccessorElement &&
@@ -2674,6 +2684,18 @@ abstract class ElementImpl implements Element {
26742684 return false ;
26752685 }
26762686
2687+ @override
2688+ bool get hasDoNotStore {
2689+ var metadata = this .metadata;
2690+ for (var i = 0 ; i < metadata.length; i++ ) {
2691+ var annotation = metadata[i];
2692+ if (annotation.isDoNotStore) {
2693+ return true ;
2694+ }
2695+ }
2696+ return false ;
2697+ }
2698+
26772699 @override
26782700 bool get hasFactory {
26792701 var metadata = this .metadata;
@@ -5957,6 +5979,9 @@ class MultiplyDefinedElementImpl implements MultiplyDefinedElement {
59575979 @override
59585980 bool get hasDeprecated => false ;
59595981
5982+ @override
5983+ bool get hasDoNotStore => false ;
5984+
59605985 @override
59615986 bool get hasFactory => false ;
59625987
0 commit comments