private JClass jTypeForZigBeeTypeName(JCodeModel jCodeModel, JPackage jPackage, JClass jClass, String type) throws Exception {
		if (type.endsWith("48")) {
			return jModel.ref(long.class);
		} else if (type.endsWith("8")) {
			return jModel.ref(short.class);
		} else if (type.endsWith("16")) {
			return jModel.ref(int.class);
		} else if (type.endsWith("24")) {
			return jModel.ref(int.class);
		} else if (type.endsWith("32")) {
			return jModel.ref(long.class);
		} else if (type.equals("octets")) {
			return jModel.ref(byte[].class);
		} else if (type.equals("boolean")) {
			return jModel.ref(boolean.class);
		} else if (type.equals("string")) {
			return jModel.ref(String.class);
		} else if (type.equals("ieee")) {
			return jModel.ref(byte[].class);
		} else {
			// creates the new type if not existent
			JClass jZclClass = null;
			try {
				System.out.println("Check for type 3 " + jPackage.name() + "." + type);
				jZclClass = jModel.ref(jPackage.name() + "." + type);
			} catch (Exception e) {
				// class not present, creates it
				System.out.println("Generating type1 '" + type + "'");
				return jPackage._class(type);
			}

			return jZclClass;
		}
	}