Java Field from Class getJsonValueFieldName(String className)

Here you can find the source of getJsonValueFieldName(String className)

Description

get Json Value Field Name

License

Apache License

Declaration

public static String getJsonValueFieldName(String className) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String getJsonValueFieldName(String className) {
        switch (className) {
        case "java.net.URL":
            return "toString";
        case "java.lang.StringBuilder":
            return "toString";
        case "java.lang.StringBuffer":
            return "toString";
        case "java.util.UUID":
            return "toString";
        case "java.util.Locale":
            return "toString";
        case "com.google.gson.JsonElement":
            return "toString";
        case "com.google.gson.JsonPrimitive":
            return "toString";
        case "java.util.Currency":
            return "toString";

        case "java.net.Inet4Address":
            return "hostAddress";
        case "java.net.URI":
            return "toURL";

        }//from  w ww .  j a va 2 s.  co m

        return null;
    }
}

Related

  1. findDeclaredField(Class javaClass, String fieldName)
  2. getDeclaredField(final Class javaClass, final String fieldName, final boolean shouldSetAccessible)
  3. getDeclaredFields(final Class clazz)
  4. getField(Class type, String name)
  5. getField(final Class javaClass, final String fieldName, final boolean shouldSetAccessible)
  6. getProperField(Class objectClass)
  7. setPrivateField(String fieldName, Class containingClass, Object target, Object value)