@Test(dependsOnMethods = {"testRegister"}, expectedExceptions = {JSONConverterException.class}) public void testToJSonWithNoConverters() throws JSONConverterException { ConstraintsConverter c = new ConstraintsConverter(); MockSatConstraint m = new MockSatConstraint("bar"); c.toJSON(m); }
public JSONObject toJSON(Constraint o) throws JSONConverterException { ConstraintConverter c = java2json.get(o.getClass()); if (c == null) { throw new JSONConverterException("No converter available for a constraint with the '" + o.getClass() + "' className"); } return c.toJSON(o); }
ConstraintsConverter { public JSONObject toJSON(Constraint o) throws JSONConverterException { ConstraintConverter c = java2json.get(o.getClass()); if (c == null) { throw new JSONConverterException("No converter available for a constraint with the '" + o.getClass() + "' className"); } return c.toJSON(o); } }
ConstraintsConverter { public JSONObject toJSON(Constraint o) throws JSONConverterException { ConstraintConverter c = java2json.get(o.getClass()); if (c == null) { throw new JSONConverterException("No converter available for a constraint with the '" + o.getClass() + "' className"); } return c.toJSON(o); } ConstraintsConverter(); }
ConstraintsConverter { public JSONObject toJSON(Constraint o) throws JSONConverterException { ConstraintConverter c = java2json.get(o.getClass()); if (c == null) { throw new JSONConverterException("No converter available for a constraint with the '" + o.getClass() + "' className"); } return c.toJSON(o); } ConstraintsConverter(); static ConstraintsConverter newBundle(); void register(ConstraintConverter<? extends Constraint> c); Set<Class<? extends Constraint>> getSupportedJavaConstraints(); Set<String> getSupportedJSONConstraints(); Constraint fromJSON(Model mo, JSONObject in); JSONObject toJSON(Constraint o); List<SatConstraint> listFromJSON(Model mo, JSONArray in); JSONArray toJSON(Collection<SatConstraint> e); }
ConstraintsConverter { public JSONObject toJSON(Constraint o) throws JSONConverterException { ConstraintConverter c = java2json.get(o.getClass()); if (c == null) { throw new JSONConverterException("No converter available for a constraint with the '" + o.getClass() + "' className"); } return c.toJSON(o); } ConstraintsConverter(); static ConstraintsConverter newBundle(); void register(ConstraintConverter<? extends Constraint> c); Set<Class<? extends Constraint>> getSupportedJavaConstraints(); Set<String> getSupportedJSONConstraints(); Constraint fromJSON(Model mo, JSONObject in); JSONObject toJSON(Constraint o); List<SatConstraint> listFromJSON(Model mo, JSONArray in); JSONArray toJSON(Collection<SatConstraint> e);  }