private Annotation doAnnotation(DataInputStream in, ElementType member, RetentionPolicy policy, boolean collect) throws IOException { int type_index = in.readUnsignedShort(); if (annotations == null) annotations = new HashSet<String>(); annotations.add(pool[type_index].toString()); if (policy == RetentionPolicy.RUNTIME) { descriptors.add(new Integer(type_index)); hasRuntimeAnnotations = true; } else { hasClassAnnotations = true; } String name = (String) pool[type_index]; int num_element_value_pairs = in.readUnsignedShort(); Map<String, Object> elements = null; for (int v = 0; v < num_element_value_pairs; v++) { int element_name_index = in.readUnsignedShort(); String element = (String) pool[element_name_index]; Object value = doElementValue(in, member, policy, collect); if (collect) { if (elements == null) elements = new LinkedHashMap<String, Object>(); elements.put(element, value); } } if (collect) return new Annotation(name, elements, member, policy); else return null; }
private Annotation doAnnotation(DataInputStream in, ElementType member, RetentionPolicy policy, boolean collect) throws IOException { int type_index = in.readUnsignedShort(); if (annotations == null) annotations = new HashSet<String>(); annotations.add(pool[type_index].toString()); if (policy == RetentionPolicy.RUNTIME) { descriptors.add(new Integer(type_index)); hasRuntimeAnnotations = true; } else { hasClassAnnotations = true; } String name = (String) pool[type_index]; int num_element_value_pairs = in.readUnsignedShort(); Map<String, Object> elements = null; for (int v = 0; v < num_element_value_pairs; v++) { int element_name_index = in.readUnsignedShort(); String element = (String) pool[element_name_index]; Object value = doElementValue(in, member, policy, collect); if (collect) { if (elements == null) elements = new LinkedHashMap<String, Object>(); elements.put(element, value); } } if (collect) return new Annotation(name, elements, member, policy); else return null; }
Object[] result = new Object[num_values]; for (int i = 0; i < num_values; i++) { result[i] = doElementValue(in, member, policy, collect);
Object[] result = new Object[num_values]; for (int i = 0; i < num_values; i++) { result[i] = doElementValue(in, member, policy, collect);