* @return An instance of the JSONArtifact that best represents the data in this JavaBean
* @throws IllegalArgumentException Thrown if input type is a String, Number, Boolean, etc.
* @throws JSONException Thrown if a JSON conversion error occurs.
*/
public static JSONArtifact toJson(Object obj, boolean includeSuperclass) throws IllegalArgumentException, JSONException {
JSONArtifact ja = null;
if (obj != null) {
Class clazz = obj.getClass();
if (String.class == clazz) {
throw new IllegalArgumentException("Class was String type, not a Javabean.");