private void _throwNoDebugInfo(String className) { throw new JsonBindingException( "Class " + className + " has been compiled with no debug information, so we can not deduce constructor/method parameter names."); }
private void _throwNoDebugInfo(String className) { throw new JsonBindingException( "Class " + className + " has been compiled with no debug information, so we can not deduce constructor/method parameter names."); }
protected JsonBindingException couldNotDeserialize(Throwable e) { return new JsonBindingException("Could not deserialize to property '" + name + "' of class " + declaringClass, e); }
protected JsonBindingException couldNotSerialize(Throwable e) { return new JsonBindingException("Could not serialize property '" + name + "' from class " + declaringClass.getName(), e); }
private JsonBindingException couldNotInstantiateBeanView(Class<?> beanViewClass, Exception e) { return new JsonBindingException("Could not instantiate BeanView " + beanViewClass.getName() + ", BeanView implementations must have a public no arg constructor.", e); }
private JsonBindingException couldNotInstantiateBeanView(Class<?> beanViewClass, Exception e) { return new JsonBindingException("Could not instantiate BeanView " + beanViewClass.getName() + ", BeanView implementations must have a public no arg constructor.", e); }
public Trilean isCreator(Method method, Class<?> baseClass) { if (method.getAnnotation(JsonCreator.class) != null) { if (Modifier.isStatic(method.getModifiers())) return TRUE; throw new JsonBindingException("Method " + method.toGenericString() + " annotated with @Creator must be static!"); } return FALSE; }
public Trilean isCreator(Method method, Class<?> fromClass) { if (method.getAnnotation(JsonCreator.class) != null) { if (Modifier.isPublic(method.getModifiers()) && Modifier.isStatic(method.getModifiers())) return TRUE; throw new JsonBindingException("Method " + method.toGenericString() + " annotated with @JsonCreator must be static!"); } return FALSE; }
public Trilean isCreator(Method method, Class<?> baseClass) { if (method.getAnnotation(JsonCreator.class) != null) { if (Modifier.isStatic(method.getModifiers())) return TRUE; throw new JsonBindingException("Method " + method.toGenericString() + " annotated with @Creator must be static!"); } return FALSE; }
public Trilean isCreator(Method method, Class<?> fromClass) { if (method.getAnnotation(JsonCreator.class) != null) { if (Modifier.isPublic(method.getModifiers()) && Modifier.isStatic(method.getModifiers())) return TRUE; throw new JsonBindingException("Method " + method.toGenericString() + " annotated with @JsonCreator must be static!"); } return FALSE; }
@Override public void serialize(T object, ObjectWriter writer, Context ctx) throws Exception { if (object == null) { throw new JsonBindingException("Serialization of null primitives is forbidden"); } else { wrapped.serialize(object, writer, ctx); } }
public Character deserialize(ObjectReader reader, Context ctx) { String str = reader.valueAsString(); if (str.length() > 1) throw new JsonBindingException( "Could not convert a string with length greater than 1 to a single char." ); return str.charAt(0); } }
protected JsonBindingException couldNotMutate(Exception e) { return new JsonBindingException("Could not mutate value of property named '" + name + "' using mutator " + signature(), e); }
protected JsonBindingException couldNotAccess(Exception e) { return new JsonBindingException("Could not access value of property named '" + name + "' using accessor " + signature() + " from class " + declaringClass.getName(), e); }
private JsonBindingException missingPropertyException(String name) { return new JsonBindingException("No matching property in " + getOfClass() + " for key " + name); } }
protected JsonBindingException couldNotMutate(Exception e) { return new JsonBindingException("Could not mutate value of property named '" + name + "' using mutator " + signature(), e); }
@Override public void serialize(T object, ObjectWriter writer, Context ctx) throws Exception { if (object == null) { throw new JsonBindingException("Serialization of null primitives is forbidden"); } else { wrapped.serialize(object, writer, ctx); } }
protected JsonBindingException couldNotAccess(Exception e) { return new JsonBindingException("Could not access value of property named '" + name + "' using accessor " + signature() + " from class " + declaringClass.getName(), e); }
public Character deserialize(ObjectReader reader, Context ctx) { String str = reader.valueAsString(); if (str.length() > 1) throw new JsonBindingException( "Could not convert a string with length greater than 1 to a single char." ); return str.charAt(0); } }
protected JsonBindingException couldNotCreate(Exception e) { return new JsonBindingException("Could not create bean of type " + ofClass.getName() + " using creator " + signature(), e); }