/** * 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()); }
/** * 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()); }