@Test(dependsOnMethods = {"testRegister"}, expectedExceptions = {JSONConverterException.class}) public void testToJSonWithNoConverters() throws JSONConverterException { ModelViewsConverter c = new ModelViewsConverter(); MockModelView m = new MockModelView("bar"); c.toJSON(m); }
public JSONObject toJSON(ModelView o) throws JSONConverterException { ModelViewConverter c = java2json.get(o.getClass()); if (c == null) { throw new JSONConverterException("No converter available for a view with the '" + o.getClass() + "' className"); } return c.toJSON(o); }
ModelViewsConverter { public JSONObject toJSON(ModelView o) throws JSONConverterException { ModelViewConverter c = java2json.get(o.getClass()); if (c == null) { throw new JSONConverterException("No converter available for a view with the '" + o.getClass() + "' className"); } return c.toJSON(o); } }
ModelViewsConverter { public JSONObject toJSON(ModelView o) throws JSONConverterException { ModelViewConverter c = java2json.get(o.getClass()); if (c == null) { throw new JSONConverterException("No converter available for a view with the '" + o.getClass() + "' className"); } return c.toJSON(o); } ModelViewsConverter(); }
ModelViewsConverter { public JSONObject toJSON(ModelView o) throws JSONConverterException { ModelViewConverter c = java2json.get(o.getClass()); if (c == null) { throw new JSONConverterException("No converter available for a view with the '" + o.getClass() + "' className"); } return c.toJSON(o); } ModelViewsConverter(); static ModelViewsConverter newBundle(); void register(ModelViewConverter<? extends ModelView> c); Set<Class<? extends ModelView>> getSupportedJavaViews(); Set<String> getSupportedJSONViews(); ModelView fromJSON(Model mo, JSONObject in); JSONObject toJSON(ModelView o); }
ModelViewsConverter { public JSONObject toJSON(ModelView o) throws JSONConverterException { ModelViewConverter c = java2json.get(o.getClass()); if (c == null) { throw new JSONConverterException("No converter available for a view with the '" + o.getClass() + "' className"); } return c.toJSON(o); } ModelViewsConverter(); static ModelViewsConverter newBundle(); void register(ModelViewConverter<? extends ModelView> c); Set<Class<? extends ModelView>> getSupportedJavaViews(); Set<String> getSupportedJSONViews(); ModelView fromJSON(Model mo, JSONObject in); JSONObject toJSON(ModelView o);  }