code: public static boolean isPrimitive(String name, JCodeModel owner) {
          try {
              return JType.parse(owner, name) != owner.VOID;
          } catch (IllegalArgumentException e) {
              return false;
          }
      }
docs: Check if a name string refers to a given type.
  
  @param name
  the name of a Java type
  @param owner
  the current code model for type generation
  @return <code>true</code> when the given name refers to a primitive Java
  type (e.g. "int"), otherwise <code>false</code>