static String stringify(IHjsonDsfProvider[] dsfProviders, JsonValue value) { for (int i=0, n=dsfProviders.length; i<n; i++) { IHjsonDsfProvider dsf=dsfProviders[i]; try { String text=dsf.stringify(value); if (text!=null) { boolean isInvalid=false; char[] textc=text.toCharArray(); for(char ch : textc) { if (isInvalidDsfChar(ch)) { isInvalid=true; break; } } if (isInvalid || text.length()==0 || textc[0]=='"') throw new Exception("value may not be empty, start with a quote or contain a punctuator character except colon: " + text); return text; } } catch (Exception exception) { throw new RuntimeException("DSF-"+dsf.getName()+" failed; "+exception.getMessage()); } } return null; }
return HjsonDsf.parse(dsfProviders, value.toString().trim());
String dsfValue=HjsonDsf.stringify(dsfProviders, value); if (dsfValue!=null)
return HjsonDsf.parse(dsfProviders, value.toString().trim());
String dsfValue=HjsonDsf.stringify(dsfProviders, value); if (dsfValue!=null)
static String stringify(IHjsonDsfProvider[] dsfProviders, JsonValue value) { for (int i=0, n=dsfProviders.length; i<n; i++) { IHjsonDsfProvider dsf=dsfProviders[i]; try { String text=dsf.stringify(value); if (text!=null) { boolean isInvalid=false; char[] textc=text.toCharArray(); for(char ch : textc) { if (isInvalidDsfChar(ch)) { isInvalid=true; break; } } if (isInvalid || text.length()==0 || textc[0]=='"') throw new Exception("value may not be empty, start with a quote or contain a punctuator character except colon: " + text); return text; } } catch (Exception exception) { throw new RuntimeException("DSF-"+dsf.getName()+" failed; "+exception.getMessage()); } } return null; }