private void attachAnnotations(NdType type, IBinaryAnnotation[] annotations) { if (annotations != null) { type.allocateAnnotations(annotations.length); for (IBinaryAnnotation next : annotations) { NdAnnotation annotation = type.createAnnotation(); initAnnotation(annotation, next); } } }
type = new NdType(getNd(), this.resource); type.allocateTypeAnnotations(typeAnnotations.length); for (IBinaryTypeAnnotation typeAnnotation : typeAnnotations) { NdTypeAnnotation annotation = type.createTypeAnnotation(); type.setTypeId(name); type.setFieldDescriptorFromClass(fieldDescriptorFromClass); type.setFlag(NdType.FLG_GENERIC_SIGNATURE_PRESENT, true); type.setModifiers(binaryType.getModifiers()); type.setDeclaringType(createTypeIdFromBinaryName(binaryType.getEnclosingTypeName())); type.setSuperclass(createTypeSignature(signatureWrapper, superclassFieldDescriptor)); type.setDeclaringMethod(binaryType.getEnclosingMethod()); type.allocateVariables(fields.length); for (IBinaryField nextField : fields) { addField(type, nextField); type.allocateMethods(methods.length); for (int idx = 0; idx < methods.length; idx++) { NdMethod newMethod = type.createMethod(); int position = sortedElementIndices[idx]; newMethod.setDeclarationPosition(position);
/** * Adds the given field to the given type */ private void addField(NdType type, IBinaryField nextField) throws CoreException { NdVariable variable = type.createVariable(); variable.setName(nextField.getName()); if (nextField.getGenericSignature() != null) { variable.setVariableFlag(NdVariable.FLG_GENERIC_SIGNATURE_PRESENT); } attachAnnotations(variable, nextField.getAnnotations()); variable.setConstant(NdConstant.create(getNd(), nextField.getConstant())); variable.setModifiers(nextField.getModifiers()); SignatureWrapper nextTypeSignature = GenericSignatures.getGenericSignatureFor(nextField); IBinaryTypeAnnotation[] typeAnnotations = nextField.getTypeAnnotations(); if (typeAnnotations != null) { variable.allocateTypeAnnotations(typeAnnotations.length); for (IBinaryTypeAnnotation next : typeAnnotations) { NdTypeAnnotation annotation = variable.createTypeAnnotation(); initTypeAnnotation(annotation, next); } } variable.setType(createTypeSignature(nextTypeSignature, nextField.getTypeName())); variable.setTagBits(nextField.getTagBits()); }
type = new NdType(getNd(), this.resource); type.allocateTypeAnnotations(typeAnnotations.length); for (IBinaryTypeAnnotation typeAnnotation : typeAnnotations) { NdTypeAnnotation annotation = type.createTypeAnnotation(); type.setTypeId(name); type.setFieldDescriptorFromClass(fieldDescriptorFromClass); type.setFlag(NdType.FLG_GENERIC_SIGNATURE_PRESENT, true); type.setModifiers(binaryType.getModifiers()); type.setDeclaringType(createTypeIdFromBinaryName(binaryType.getEnclosingTypeName())); type.setSuperclass(createTypeSignature(signatureWrapper, superclassFieldDescriptor)); type.setDeclaringMethod(binaryType.getEnclosingMethod()); type.allocateVariables(fields.length); for (IBinaryField nextField : fields) { addField(type, nextField); type.allocateMethods(methods.length); for (int idx = 0; idx < methods.length; idx++) { NdMethod newMethod = type.createMethod(); int position = sortedElementIndices[idx]; newMethod.setDeclarationPosition(position);
/** * Adds the given field to the given type */ private void addField(NdType type, IBinaryField nextField) throws CoreException { NdVariable variable = type.createVariable(); variable.setName(nextField.getName()); if (nextField.getGenericSignature() != null) { variable.setVariableFlag(NdVariable.FLG_GENERIC_SIGNATURE_PRESENT); } attachAnnotations(variable, nextField.getAnnotations()); variable.setConstant(NdConstant.create(getNd(), nextField.getConstant())); variable.setModifiers(nextField.getModifiers()); SignatureWrapper nextTypeSignature = GenericSignatures.getGenericSignatureFor(nextField); IBinaryTypeAnnotation[] typeAnnotations = nextField.getTypeAnnotations(); if (typeAnnotations != null) { variable.allocateTypeAnnotations(typeAnnotations.length); for (IBinaryTypeAnnotation next : typeAnnotations) { NdTypeAnnotation annotation = variable.createTypeAnnotation(); initTypeAnnotation(annotation, next); } } variable.setType(createTypeSignature(nextTypeSignature, nextField.getTypeName())); variable.setTagBits(nextField.getTagBits()); }
private void attachAnnotations(NdType type, IBinaryAnnotation[] annotations) { if (annotations != null) { type.allocateAnnotations(annotations.length); for (IBinaryAnnotation next : annotations) { NdAnnotation annotation = type.createAnnotation(); initAnnotation(annotation, next); } } }