congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
IHjsonDsfProvider
Code IndexAdd Tabnine to your IDE (free)

How to use
IHjsonDsfProvider
in
org.hjson

Best Java code snippets using org.hjson.IHjsonDsfProvider (Showing top 4 results out of 315)

origin: org.hjson/hjson

static JsonValue parse(IHjsonDsfProvider[] dsfProviders, String value)
{
 for (int i=0, n=dsfProviders.length; i<n; i++) {
  IHjsonDsfProvider dsf=dsfProviders[i];
  try {
   JsonValue res=dsf.parse(value);
   if (res!=null) return res;
  } catch (Exception exception)
  {
   throw new RuntimeException("DSF-"+dsf.getName()+" failed; "+exception.getMessage());
  }
 }
 return new JsonString(value);
}
origin: org.hjson/hjson

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;
}
origin: hjson/hjson-java

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;
}
origin: hjson/hjson-java

static JsonValue parse(IHjsonDsfProvider[] dsfProviders, String value)
{
 for (int i=0, n=dsfProviders.length; i<n; i++) {
  IHjsonDsfProvider dsf=dsfProviders[i];
  try {
   JsonValue res=dsf.parse(value);
   if (res!=null) return res;
  } catch (Exception exception)
  {
   throw new RuntimeException("DSF-"+dsf.getName()+" failed; "+exception.getMessage());
  }
 }
 return new JsonString(value);
}
org.hjsonIHjsonDsfProvider

Javadoc

A interface to support Domain Specific Formats for Hjson.

Most used methods

  • getName
    Gets the name of this DSF.
  • parse
    Tries to parse the text as a DSF value.
  • stringify
    Stringifies DSF values.

Popular in Java

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • setRequestProperty (URLConnection)
  • setScale (BigDecimal)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now