/** * Creates a new TypeAnnotationAdder that will copy annotations into the given * target annotations attribute. */ public TypeAnnotationAdder(ProgramClass targetClass, AnnotationsAttribute targetAnnotationsAttribute) { this.targetClass = targetClass; this.targetAnnotationElementValue = null; this.annotationsAttributeEditor = new AnnotationsAttributeEditor(targetAnnotationsAttribute); constantAdder = new ConstantAdder(targetClass); }
public void visitAnnotation(Clazz clazz, Annotation annotation) { Annotation newAnnotation = new Annotation(constantAdder.addConstant(clazz, annotation.u2typeIndex), 0, annotation.u2elementValuesCount > 0 ? new ElementValue[annotation.u2elementValuesCount] : EMPTY_ELEMENT_VALUES); // TODO: Clone array. newAnnotation.referencedClasses = annotation.referencedClasses; // Add the element values. annotation.elementValuesAccept(clazz, new ElementValueAdder(targetClass, newAnnotation, false)); // What's the target? if (targetAnnotationElementValue != null) { // Simply set the completed annotation. targetAnnotationElementValue.annotationValue = newAnnotation; } else { // Add the completed annotation. annotationsAttributeEditor.addAnnotation(newAnnotation); } }
public void visitAnnotation(Clazz clazz, Annotation annotation) { Annotation newAnnotation = new Annotation(constantAdder.addConstant(clazz, annotation.u2typeIndex), 0, annotation.u2elementValuesCount > 0 ? new ElementValue[annotation.u2elementValuesCount] : EMPTY_ELEMENT_VALUES); // TODO: Clone array. newAnnotation.referencedClasses = annotation.referencedClasses; // Add the element values. annotation.elementValuesAccept(clazz, new ElementValueAdder(targetClass, newAnnotation, false)); // What's the target? if (targetAnnotationElementValue != null) { // Simply set the completed annotation. targetAnnotationElementValue.annotationValue = newAnnotation; } else { // Add the completed annotation. annotationsAttributeEditor.addAnnotation(newAnnotation); } }
/** * Creates a new AnnotationAdder that will copy annotations into the given * target annotations attribute. */ public AnnotationAdder(ProgramClass targetClass, AnnotationsAttribute targetAnnotationsAttribute) { this.targetClass = targetClass; this.targetAnnotationElementValue = null; this.annotationsAttributeEditor = new AnnotationsAttributeEditor(targetAnnotationsAttribute); this.parameterAnnotationsAttributeEditor = null; constantAdder = new ConstantAdder(targetClass); }
public void visitAnnotation(Clazz clazz, Annotation annotation) { Annotation newAnnotation = new Annotation(constantAdder.addConstant(clazz, annotation.u2typeIndex), 0, annotation.u2elementValuesCount > 0 ? new ElementValue[annotation.u2elementValuesCount] : EMPTY_ELEMENT_VALUES); // TODO: Clone array. newAnnotation.referencedClasses = annotation.referencedClasses; // Add the element values. annotation.elementValuesAccept(clazz, new ElementValueAdder(targetClass, newAnnotation, false)); // What's the target? if (targetAnnotationElementValue != null) { // Simply set the completed annotation. targetAnnotationElementValue.annotationValue = newAnnotation; } else { // Add the completed annotation. annotationsAttributeEditor.addAnnotation(newAnnotation); } }
/** * Creates a new TypeAnnotationAdder that will copy annotations into the given * target annotations attribute. */ public TypeAnnotationAdder(ProgramClass targetClass, AnnotationsAttribute targetAnnotationsAttribute) { this.targetClass = targetClass; this.targetAnnotationElementValue = null; this.annotationsAttributeEditor = new AnnotationsAttributeEditor(targetAnnotationsAttribute); constantAdder = new ConstantAdder(targetClass); }
public void visitAnnotation(Clazz clazz, Annotation annotation) { Annotation newAnnotation = new Annotation(constantAdder.addConstant(clazz, annotation.u2typeIndex), 0, annotation.u2elementValuesCount > 0 ? new ElementValue[annotation.u2elementValuesCount] : EMPTY_ELEMENT_VALUES); // TODO: Clone array. newAnnotation.referencedClasses = annotation.referencedClasses; // Add the element values. annotation.elementValuesAccept(clazz, new ElementValueAdder(targetClass, newAnnotation, false)); // What's the target? if (targetAnnotationElementValue != null) { // Simply set the completed annotation. targetAnnotationElementValue.annotationValue = newAnnotation; } else { // Add the completed annotation. annotationsAttributeEditor.addAnnotation(newAnnotation); } }
/** * Creates a new TypeAnnotationAdder that will copy annotations into the given * target annotations attribute. */ public TypeAnnotationAdder(ProgramClass targetClass, AnnotationsAttribute targetAnnotationsAttribute) { this.targetClass = targetClass; this.targetAnnotationElementValue = null; this.annotationsAttributeEditor = new AnnotationsAttributeEditor(targetAnnotationsAttribute); constantAdder = new ConstantAdder(targetClass); }
annotationsAttributeEditor.addAnnotation(newTypeAnnotation);
/** * Creates a new AnnotationAdder that will copy annotations into the given * target annotations attribute. */ public AnnotationAdder(ProgramClass targetClass, AnnotationsAttribute targetAnnotationsAttribute) { this.targetClass = targetClass; this.targetAnnotationElementValue = null; this.annotationsAttributeEditor = new AnnotationsAttributeEditor(targetAnnotationsAttribute); this.parameterAnnotationsAttributeEditor = null; constantAdder = new ConstantAdder(targetClass); }
annotationsAttributeEditor.addAnnotation(newTypeAnnotation);
/** * Creates a new AnnotationAdder that will copy annotations into the given * target annotations attribute. */ public AnnotationAdder(ProgramClass targetClass, AnnotationsAttribute targetAnnotationsAttribute) { this.targetClass = targetClass; this.targetAnnotationElementValue = null; this.annotationsAttributeEditor = new AnnotationsAttributeEditor(targetAnnotationsAttribute); this.parameterAnnotationsAttributeEditor = null; constantAdder = new ConstantAdder(targetClass); }
annotationsAttributeEditor.addAnnotation(newTypeAnnotation);
/** * Creates a new AnnotationAdder that will copy annotations into the given * target annotations attribute. */ public AnnotationAdder(ProgramClass targetClass, AnnotationsAttribute targetAnnotationsAttribute) { this.targetClass = targetClass; this.targetAnnotationElementValue = null; this.annotationsAttributeEditor = new AnnotationsAttributeEditor(targetAnnotationsAttribute); this.parameterAnnotationsAttributeEditor = null; constantAdder = new ConstantAdder(targetClass); }