private void outJsonBwString(final String name, final BwStringBase value, final JsonGenerator jgen) throws CalFacadeException { try { if (value == null) { return; } jgen.writeFieldName(name); jgen.writeStartObject(); outJsonField("lang", value.getLang(), jgen); outJsonField("value", value.getValue(), jgen); jgen.writeEndObject(); } catch (final Throwable t) { throw new CalFacadeException(t); } }
public void toJson(final JsonGenerator jgen) throws CalFacadeException { try { jgen.writeStartObject(); outJsonField("name", getName(), jgen); outJsonField("href", getHref(), jgen); outJsonField("colPath", getColPath(), jgen); outJsonField("uid", getUid(), jgen); outJsonBwString("word", getWord(), jgen); outJsonBwString("description", getDescription(), jgen); jgen.writeEndObject(); // category } catch (final Throwable t) { throw new CalFacadeException(t); } }