/** * Adds a field annotations item to this class. * * @param field {@code non-null;} field in question * @param annotations {@code non-null;} associated annotations to add * @param dexFile {@code non-null;} dex output */ public void addFieldAnnotations(CstFieldRef field, Annotations annotations, DexFile dexFile) { annotationsDirectory.addFieldAnnotations(field, annotations, dexFile); }
/** * Adds a method annotations item to this class. * * @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) { annotationsDirectory.addMethodAnnotations(method, annotations, dexFile); }
/** * Adds a parameter annotations item to this class. * * @param method {@code non-null;} method in question * @param list {@code non-null;} associated list of annotation sets to add */ public void addParameterAnnotations(CstMethodRef method, AnnotationsList list) { annotationsDirectory.addParameterAnnotations(method, list); }
/** {@inheritDoc} */ @Override protected void place0(Section addedTo, int offset) { // We just need to set the write size here. int elementCount = listSize(fieldAnnotations) + listSize(methodAnnotations) + listSize(parameterAnnotations); setWriteSize(HEADER_SIZE + (elementCount * ELEMENT_SIZE)); }
if (! annotationsDirectory.isEmpty()) { if (annotationsDirectory.isInternable()) { annotationsDirectory = wordData.intern(annotationsDirectory); } else {
typeIds.indexOf(superclass); int interOff = OffsettedItem.getAbsoluteOffsetOr0(interfaces); int annoOff = annotationsDirectory.isEmpty() ? 0 : annotationsDirectory.getAbsoluteOffset(); int sourceFileIdx = (sourceFile == null) ? -1 : file.getStringIds().indexOf(sourceFile);
boolean annotates = out.annotates(); int classOff = OffsettedItem.getAbsoluteOffsetOr0(classAnnotations); int fieldsSize = listSize(fieldAnnotations); int methodsSize = listSize(methodAnnotations); int parametersSize = listSize(parameterAnnotations); out.annotate(0, offsetString() + " annotations directory"); out.annotate(4, " class_annotations_off: " + Hex.u4(classOff)); out.annotate(4, " fields_size: " +
/** * Gets the parameter 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 parameter annotations, if any */ public AnnotationsList getParameterAnnotations(CstMethodRef method) { return annotationsDirectory.getParameterAnnotations(method); }
/** * 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) { return annotationsDirectory.getMethodAnnotations(method); }
/** * {@inheritDoc} * * <p><b>Note:</b>: This throws an exception if this item is not * internable.</p> * * @see #isInternable */ @Override public int compareTo0(OffsettedItem other) { if (! isInternable()) { throw new UnsupportedOperationException("uninternable instance"); } AnnotationsDirectoryItem otherDirectory = (AnnotationsDirectoryItem) other; return classAnnotations.compareTo(otherDirectory.classAnnotations); }
this.classData = new ClassDataItem(thisClass); this.staticValuesItem = null; this.annotationsDirectory = new AnnotationsDirectoryItem();
/** {@inheritDoc} */ @Override protected void place0(Section addedTo, int offset) { // We just need to set the write size here. int elementCount = listSize(fieldAnnotations) + listSize(methodAnnotations) + listSize(parameterAnnotations); setWriteSize(HEADER_SIZE + (elementCount * ELEMENT_SIZE)); }
if (! annotationsDirectory.isEmpty()) { if (annotationsDirectory.isInternable()) { annotationsDirectory = wordData.intern(annotationsDirectory); } else {
typeIds.indexOf(superclass); int interOff = OffsettedItem.getAbsoluteOffsetOr0(interfaces); int annoOff = annotationsDirectory.isEmpty() ? 0 : annotationsDirectory.getAbsoluteOffset(); int sourceFileIdx = (sourceFile == null) ? -1 : file.getStringIds().indexOf(sourceFile);
boolean annotates = out.annotates(); int classOff = OffsettedItem.getAbsoluteOffsetOr0(classAnnotations); int fieldsSize = listSize(fieldAnnotations); int methodsSize = listSize(methodAnnotations); int parametersSize = listSize(parameterAnnotations); out.annotate(0, offsetString() + " annotations directory"); out.annotate(4, " class_annotations_off: " + Hex.u4(classOff)); out.annotate(4, " fields_size: " +
/** * Gets the parameter 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 parameter annotations, if any */ public AnnotationsList getParameterAnnotations(CstMethodRef method) { return annotationsDirectory.getParameterAnnotations(method); }
/** * 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) { return annotationsDirectory.getMethodAnnotations(method); }
/** * {@inheritDoc} * * <p><b>Note:</b>: This throws an exception if this item is not * internable.</p> * * @see #isInternable */ @Override public int compareTo0(OffsettedItem other) { if (! isInternable()) { throw new UnsupportedOperationException("uninternable instance"); } AnnotationsDirectoryItem otherDirectory = (AnnotationsDirectoryItem) other; return classAnnotations.compareTo(otherDirectory.classAnnotations); }
this.classData = new ClassDataItem(thisClass); this.staticValuesItem = null; this.annotationsDirectory = new AnnotationsDirectoryItem();
/** {@inheritDoc} */ @Override protected void place0(Section addedTo, int offset) { // We just need to set the write size here. int elementCount = listSize(fieldAnnotations) + listSize(methodAnnotations) + listSize(parameterAnnotations); setWriteSize(HEADER_SIZE + (elementCount * ELEMENT_SIZE)); }