public Imports getImports(ClassFile cf) {
		Imports imports = new Imports(cf.getPackageName());
		ConstantPool pool = cf.getPool();

		for (int i = 0; i < pool.size(); i++) {
			ConstantPoolInfo cpi = pool.get(i);
			if (cpi != null) {
				if (cpi.getType() == ConstantPoolInfo.CLASS) {
					// there can be array definitions here, too
					JavaType cls = new JavaType(cpi.getValue());
					imports.addType(cls.getType());
				} else if (cpi.getType() == ConstantPoolInfo.NAME_AND_TYPE) {
					NameAndTypeInfo nati = (NameAndTypeInfo) cpi;
					Descriptor desc = nati.getDescriptor();
					if (!desc.getReturn().isPrimitive()) {
						imports.addType(desc.getReturn().getType());
					}

					List al = desc.getParamList();
					for (int j = 0; j < al.size(); j++) {
						JavaType item = (JavaType) al.get(j);
						if (!item.isPrimitive()) {
							imports.addType(item.getType());
						}
					}
				}

			}
		}
		
		getAnnotationTypeImports(imports, cf.getAttributes());
		getSignatureImports(imports, cf.getAttributes());
		for (Field field : cf.getFields()) {
			getAnnotationTypeImports(imports, field.getAttributes());
			getDescriptorImports(imports, field.getDescriptor());
			getSignatureImports(imports, field.getAttributes());
		}
		
		for (Method method : cf.getMethods()) {
			getAnnotationTypeImports(imports, method.getAttributes());
			getDescriptorImports(imports, method.getDescriptor());
			getSignatureImports(imports, method.getAttributes());
			getLocalVariableTypeTableImports(imports, method.getAttributes());
		}

		return imports;
	}