private JClass getZclDataTypeJClass(JCodeModel jCodeModel, JPackage jPackage, JClass jClass, String type, Object o)
			throws Exception {

		if (type.equals("bitmap8")) {
			return jModel.ref(ZclDataTypeBitmap8.class);
		} else if (type.equals("bitmap16")) {
			return jModel.ref(ZclDataTypeBitmap16.class);
		} else if (type.equals("bitmap24")) {
			return jModel.ref(ZclDataTypeBitmap24.class);
		} else if (type.equals("bitmap32")) {
			return jModel.ref(ZclDataTypeBitmap32.class);
		} else if (type.equals("bitmap8")) {
			return jModel.ref(ZclDataTypeBitmap8.class);
		} else if (type.equals("enum8")) {
			return jModel.ref(ZclDataTypeEnum8.class);
		} else if (type.equals("enum16")) {
			return jModel.ref(ZclDataTypeEnum16.class);
		} else if (type.equals("uint8")) {
			return jModel.ref(ZclDataTypeUI8.class);
		} else if (type.equals("uint16")) {
			return jModel.ref(ZclDataTypeUI16.class);
		} else if (type.equals("uint24")) {
			return jModel.ref(ZclDataTypeUI24.class);
		} else if (type.equals("uint32")) {
			return jModel.ref(ZclDataTypeUI32.class);
		} else if (type.equals("uint48")) {
			return jModel.ref(ZclDataTypeUI48.class);
		} else if (type.equals("int8")) {
			return jModel.ref(ZclDataTypeI8.class);
		} else if (type.equals("int16")) {
			return jModel.ref(ZclDataTypeI16.class);
		} else if (type.equals("int24")) {
			return jModel.ref(ZclDataTypeI24.class);
		} else if (type.equals("int32")) {
			return jModel.ref(ZclDataTypeI32.class);
		} else if (type.equals("octets")) {
			return jModel.ref(ZclDataTypeOctets.class);
		} else if (type.equals("boolean")) {
			return jModel.ref(ZclDataTypeBoolean.class);
		} else if (type.equals("string")) {
			return jModel.ref(ZclDataTypeString.class);
		} else if (type.equals("utctime")) {
			return jModel.ref(ZclDataTypeUTCTime.class);
		} else if (type.equals("ieee")) {
			return jModel.ref(ZclDataTypeIEEEAddress.class);
		} else if (type.startsWith("uint") || type.startsWith("int") || type.startsWith("bitmap") || type.startsWith("enum")) {
			throw new Exception("Unsupported standard type '" + type + "'");
		} else if (type.startsWith("array of")) {
			return null;
		} else {
			// creates the new type if not existent
			JClass jZclClass = null;
			try {
				System.out.println("Check for type 2 " + jPackage.name() + "." + type);
				jZclClass = jPackage.ref("Zcl" + type); // it is the only way I
				// was able to make it
				// work!
			} catch (Exception e) {
				// class not present, creates it
				System.out.println("Generating Zcl type 'Zcl" + type + "'");
				return generateZclType(jPackage, jClass, type, o);
			}
			return jZclClass;
		}
	}