private JType jTypeForZbTypename(JCodeModel jCodeModel, JPackage jPackage, String type, Object o) throws Exception {
		if (type.endsWith("48")) {
			return jCodeModel.LONG;
		} else if (type.endsWith("8")) {
			return jCodeModel.SHORT;
		} else if (type.endsWith("16")) {
			return jCodeModel.INT;
		} else if (type.endsWith("24")) {
			return jCodeModel.INT;
		} else if (type.endsWith("32")) {
			return jCodeModel.LONG;
		} else if (type.equals("octets")) {
			return jCodeModel.parseType("byte[]");
		} else if (type.equals("boolean")) {
			return jCodeModel.BOOLEAN;
		} else if (type.equals("string")) {
			return jCodeModel._ref(String.class);
		} else if (type.equals("utctime")) {
			return jCodeModel.LONG;
		} else if (type.equals("ieee")) {
			return jCodeModel.parseType("byte[]");
		} else {
			// creates the new type if not existent
			JClass jClass = null;
			try {
				System.out.println("Check for type 1 " + jPackage.name() + "." + type);
				jClass = jPackage.ref(type);
				// jClass = jCodeModel.ref(jPackage.name() + "." + type);
			} catch (Exception e) {
				// class not present, creates it
				System.out.println("Generating type  '" + type + "'");
				return generateType(jCodeModel, jPackage, type, o);
			}
			return jClass;
		}
	}