/** * Adds a method annotations item to this instance. * * @param method {@code non-null;} method in question * @param annotations {@code non-null;} associated annotations to add */ public void addMethodAnnotations(CstMethodRef method, Annotations annotations) { if (methodAnnotations == null) { methodAnnotations = new ArrayList<MethodAnnotationStruct>(); } methodAnnotations.add(new MethodAnnotationStruct(method, new AnnotationSetItem(annotations))); }
/** * Gets the method annotations for a given method, if any. This is * meant for use by debugging / dumping code. * * @param method {@code non-null;} the method * @return {@code null-ok;} the method annotations, if any */ public Annotations getMethodAnnotations(CstMethodRef method) { if (methodAnnotations == null) { return null; } for (MethodAnnotationStruct item : methodAnnotations) { if (item.getMethod().equals(method)) { return item.getAnnotations(); } } return null; }
out.println(" method annotations:"); for (MethodAnnotationStruct item : methodAnnotations) { out.println(" " + item.toHuman());
/** {@inheritDoc} */ public void addContents(DexFile file) { MixedItemSection wordData = file.getWordData(); if (classAnnotations != null) { classAnnotations = wordData.intern(classAnnotations); } if (fieldAnnotations != null) { for (FieldAnnotationStruct item : fieldAnnotations) { item.addContents(file); } } if (methodAnnotations != null) { for (MethodAnnotationStruct item : methodAnnotations) { item.addContents(file); } } if (parameterAnnotations != null) { for (ParameterAnnotationStruct item : parameterAnnotations) { item.addContents(file); } } }
item.writeTo(file, out);
/** {@inheritDoc} */ public void addContents(DexFile file) { MixedItemSection wordData = file.getWordData(); if (classAnnotations != null) { classAnnotations = wordData.intern(classAnnotations); } if (fieldAnnotations != null) { for (FieldAnnotationStruct item : fieldAnnotations) { item.addContents(file); } } if (methodAnnotations != null) { for (MethodAnnotationStruct item : methodAnnotations) { item.addContents(file); } } if (parameterAnnotations != null) { for (ParameterAnnotationStruct item : parameterAnnotations) { item.addContents(file); } } }
item.writeTo(file, out);
/** * Gets the method annotations for a given method, if any. This is * meant for use by debugging / dumping code. * * @param method {@code non-null;} the method * @return {@code null-ok;} the method annotations, if any */ public Annotations getMethodAnnotations(CstMethodRef method) { if (methodAnnotations == null) { return null; } for (MethodAnnotationStruct item : methodAnnotations) { if (item.getMethod().equals(method)) { return item.getAnnotations(); } } return null; }
/** * Adds a method annotations item to this instance. * * @param method {@code non-null;} method in question * @param annotations {@code non-null;} associated annotations to add * @param dexFile {@code non-null;} dex output */ public void addMethodAnnotations(CstMethodRef method, Annotations annotations, DexFile dexFile) { if (methodAnnotations == null) { methodAnnotations = new ArrayList<MethodAnnotationStruct>(); } methodAnnotations.add(new MethodAnnotationStruct(method, new AnnotationSetItem(annotations, dexFile))); }
/** {@inheritDoc} */ public void addContents(DexFile file) { MixedItemSection wordData = file.getWordData(); if (classAnnotations != null) { classAnnotations = wordData.intern(classAnnotations); } if (fieldAnnotations != null) { for (FieldAnnotationStruct item : fieldAnnotations) { item.addContents(file); } } if (methodAnnotations != null) { for (MethodAnnotationStruct item : methodAnnotations) { item.addContents(file); } } if (parameterAnnotations != null) { for (ParameterAnnotationStruct item : parameterAnnotations) { item.addContents(file); } } }
out.println(" method annotations:"); for (MethodAnnotationStruct item : methodAnnotations) { out.println(" " + item.toHuman());
item.writeTo(file, out);
/** * Gets the method annotations for a given method, if any. This is * meant for use by debugging / dumping code. * * @param method {@code non-null;} the method * @return {@code null-ok;} the method annotations, if any */ public Annotations getMethodAnnotations(CstMethodRef method) { if (methodAnnotations == null) { return null; } for (MethodAnnotationStruct item : methodAnnotations) { if (item.getMethod().equals(method)) { return item.getAnnotations(); } } return null; }
/** * Adds a method annotations item to this instance. * * @param method {@code non-null;} method in question * @param annotations {@code non-null;} associated annotations to add */ public void addMethodAnnotations(CstMethodRef method, Annotations annotations) { if (methodAnnotations == null) { methodAnnotations = new ArrayList<MethodAnnotationStruct>(); } methodAnnotations.add(new MethodAnnotationStruct(method, new AnnotationSetItem(annotations))); }
/** {@inheritDoc} */ public void addContents(DexFile file) { MixedItemSection wordData = file.getWordData(); if (classAnnotations != null) { classAnnotations = wordData.intern(classAnnotations); } if (fieldAnnotations != null) { for (FieldAnnotationStruct item : fieldAnnotations) { item.addContents(file); } } if (methodAnnotations != null) { for (MethodAnnotationStruct item : methodAnnotations) { item.addContents(file); } } if (parameterAnnotations != null) { for (ParameterAnnotationStruct item : parameterAnnotations) { item.addContents(file); } } }
out.println(" method annotations:"); for (MethodAnnotationStruct item : methodAnnotations) { out.println(" " + item.toHuman());
item.writeTo(file, out);
/** * Gets the method annotations for a given method, if any. This is * meant for use by debugging / dumping code. * * @param method {@code non-null;} the method * @return {@code null-ok;} the method annotations, if any */ public Annotations getMethodAnnotations(CstMethodRef method) { if (methodAnnotations == null) { return null; } for (MethodAnnotationStruct item : methodAnnotations) { if (item.getMethod().equals(method)) { return item.getAnnotations(); } } return null; }
/** * Adds a method annotations item to this instance. * * @param method {@code non-null;} method in question * @param annotations {@code non-null;} associated annotations to add */ public void addMethodAnnotations(CstMethodRef method, Annotations annotations) { if (methodAnnotations == null) { methodAnnotations = new ArrayList<MethodAnnotationStruct>(); } methodAnnotations.add(new MethodAnnotationStruct(method, new AnnotationSetItem(annotations))); }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { MixedItemSection wordData = file.getWordData(); if (classAnnotations != null) { classAnnotations = wordData.intern(classAnnotations); } if (fieldAnnotations != null) { for (FieldAnnotationStruct item : fieldAnnotations) { item.addContents(file); } } if (methodAnnotations != null) { for (MethodAnnotationStruct item : methodAnnotations) { item.addContents(file); } } if (parameterAnnotations != null) { for (ParameterAnnotationStruct item : parameterAnnotations) { item.addContents(file); } } }