public JSONValue toJSON(Object aPojo) throws MapperException { if(!Boolean.class.isAssignableFrom(aPojo.getClass())) throw new MapperException("BooleanMapper cannot map: " + aPojo.getClass().getName()); return new JSONBoolean((Boolean) aPojo); } }
public Object toJava(JSONValue aValue, Class aRequestedClass) throws MapperException { if(aValue.isString()) { return Boolean.parseBoolean(((JSONString)aValue).getValue()); } else if(aValue.isBoolean()) { return ((JSONBoolean) aValue).getValue(); } else throw new MapperException("BooleanMapper cannot map: " + aValue.getClass().getName()); }
lOptional = ((JSONBoolean) lObj.get(ValidatorUtil.PARAM_OPTIONAL)).getValue();
val = new JSONBoolean(true); val.setLineCol(t.getLine(), t.getColumn()); val.setStreamName(aStreamName); break; val = new JSONBoolean(false);val.setLineCol(f.getLine(), f.getColumn()); val.setStreamName(aStreamName); break;