Lines Matching full:annotations
23 # Annotations dict format:
37 Annotations = namedtuple('Annotations', variable
58 'annotations': <Annotations>
83 # Constructors are referenced as "<init>" in our annotations
88 annotations = _ParseAnnotations(clean_xml)
92 annotations))
113 def _ParseAnnotations(dexRaw: str) -> Dict[int, Annotations]:
114 """ Parse XML strings and return a list of Annotations mapped to
117 Annotations are written to the dex dump as human readable blocks of text
120 It is simpler to parse for all the annotations and then associate them
125 Class #12 annotations:
126 Annotations on class
128 Annotations on method #512 'example'
135 # We want to find the lines matching the annotations header pattern
136 # Eg: Class #12 annotations -> true
137 annotationsBlockMatcher = re.compile(u'^Class #.*annotations:$')
139 # Eg: Class #12 annotations -> 12
142 # of the annotations line
143 # Eg: Annotations on method #512 'example' -> example
149 annotations = {}
154 # 1. It looks for a line telling us we are describing annotations for
156 # 2. It looks for a line telling us if the annotations we find will be
159 # 3. It adds the annotations to whatever we are holding reference to
166 # This lets us know that we are storing annotations for a new class
169 currentAnnotationsForClass = Annotations(classAnnotations={},
171 annotations[currentClassIndex] = currentAnnotationsForClass
174 # If we find a descriptor indicating we are tracking annotations
177 if line.startswith(u'Annotations on class'):
179 elif line.startswith(u'Annotations on method'):
185 # If we match against any other type of annotations
187 elif line.startswith(u'Annotations on'):
191 # We are only adding runtime annotations as those are the types
211 return annotations
214 def _ParseRootNode(root, annotations: Dict[int, Annotations]): argument
238 # Annotations are referenced by the class order
247 annotations)
256 annotations: Dict[int, Annotations]): argument
267 'annotations': <Annotations or None>
273 'annotations': <Annotations or None>
282 annotations)
288 annotations: Dict[int, Annotations]): argument
310 'annotations':
311 annotations.get(classIndex,
312 Annotations(classAnnotations={}, methodsAnnotations={}))