LocalizableTextDDMFormFieldValueAccessor implements DDMFormFieldValueAccessor<JSONObject> { @Override public boolean isEmpty(DDMFormFieldValue ddmFormFieldValue, Locale locale) { JSONObject jsonObject = getValue(ddmFormFieldValue, locale); if (jsonObject.length() == 0) { return true; } return false; }  @Override IntFunction<JSONObject[]> getArrayGeneratorIntFunction(); @Override JSONObject getValue(
		DDMFormFieldValue ddmFormFieldValue, Locale locale); @Override JSONObject getValueForEvaluation(
		DDMFormFieldValue ddmFormFieldValue, Locale locale); @Override boolean isEmpty(DDMFormFieldValue ddmFormFieldValue, Locale locale);  }
@Test public void testEmpty() { Assert.assertTrue( _localizableTextDDMFormFieldValueAccessor.isEmpty( DDMFormValuesTestUtil.createDDMFormFieldValue( "localizableText", new UnlocalizedValue("{}")), LocaleUtil.US)); }
@Test public void testNotEmpty() { StringBundler sb = new StringBundler(2); sb.append("{\"title\":\"Welcome to Liferay Forms!\","); sb.append("\"type\":\"document\"}"); DDMFormFieldValue ddmFormFieldValue = DDMFormValuesTestUtil.createDDMFormFieldValue( "localizableText", new UnlocalizedValue(sb.toString())); Assert.assertFalse( _localizableTextDDMFormFieldValueAccessor.isEmpty( ddmFormFieldValue, LocaleUtil.US)); }