Populates the current Toml instance with values from tomlString.

@param tomlString String to be read.
@return this instance
@throws IllegalStateException If tomlString is not valid TOML
1040
public Toml read(String tomlString) throws IllegalStateException {
    Results results = TomlParser.run(tomlString);
    if (results.errors.hasErrors()) {
      throw new IllegalStateException(results.errors.toString());
    }

    this.values = results.consume();

    return this;
  }
723178
public String getString(Marshaller marshaller, T instance)
      throws JAXBException {
    StringWriter sw = new StringWriter();
    marshaller.marshal(instance, sw);
    String result = sw.toString();
    return result;
  }
1164900
public static ImmutableSet<String> loadStringSet(final CharSource source) throws IOException {
    return ImmutableSet.copyOf(loadStringList(source));
  }
633594
public Map<String, Object> jsonStringToMap(String jsonString) {
        if (StringUtils.isEmpty(jsonString)) {
            return null;
        }
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(jsonString);
            return jsonObjectToMap(jsonObject);
        } catch (JSONException e) {
            throw new RuntimeException("Unable to convert string to map: " + jsonString, e);
        }
    }
81950
public static Supplier<Type> typeFromString(final String typeString) {
    requireNonNull(typeString);
    return new Supplier<Type>() {
      @Override
      public Type get(VisitorState state) {
        return state.getTypeFromString(typeString);
      }
    };
  }
491066
public static String createString(char[] charBuf)
    {
        if (!enabled)
        {
            return createStringFallback(charBuf);
        }

        String str = new String();
        try
        {
            // try to prevent possible final field setting execution reordering in JIT 
            // (JSR-133/JMM, "9.1.1 Post-Construction Modification of Final Fields")
            // it was a bit unclear for me if this could ever happen in a single thread
            synchronized (str)
            {
                valueField.set(str, charBuf);
                countField.set(str, charBuf.length);
            }
            synchronized (str)
            {
                // safety check, just to be sure that setting the final fields went ok
                if (str.length() != charBuf.length)
                {
                    throw new IllegalStateException(
                            "Fast java.lang.String construction failed.");
                }
            }
        }
        catch (Exception e)
        {
            handleError(e);
            str = createStringFallback(charBuf);
        }
        return str;
    }
368554
public static Map<String, Object> toMap(String jsonString) {
    Map<String, Object> map = new HashMap<>();
    return GSON.fromJson(jsonString, map.getClass());
  }
101610
public static <ResultT> PollingState<ResultT> createFromJSONString(String serializedPollingState) {
        ObjectMapper mapper = initMapper(new ObjectMapper());
        PollingState<ResultT> pollingState;
        try {
            pollingState = mapper.readValue(serializedPollingState, PollingState.class);
        } catch (IOException exception) {
            throw new RuntimeException(exception);
        }
        return pollingState;
    }
946947
private List<Object> onParameterValue(String paramString)
    {
        List<Object> value = kunderaQuery.getClauseValue(paramString);
        if (value == null)
        {
            throw new IllegalStateException("parameter has not been bound" + paramString);
        }
        return value;
    }
1072926
public static InputStream getUrlInputStream(String urlString) {
		URL url;
		try {
			url = new URL(urlString);
			HttpURLConnection con = (HttpURLConnection) url.openConnection();
			con.connect();
			return con.getInputStream();
		} catch (Exception e) {
			throw new JKException(e);
		}
	}
430094
protected final Stringifier registerNullStringifier(final String nullValue) {
		Stringifier nullStringifier = new Stringifier() {
			public String toString(Object object) {
				return nullValue;
			}
		};
		compositeStringifier.setNullStringifier(nullStringifier);
		return nullStringifier;
	}
551553
public static String getUrlContents(String urlString) {
		HttpURLConnection con = null;
		try {
			URL url = new URL(urlString);
			con = (HttpURLConnection) url.openConnection();
			con.connect();
			InputStream inputStream = con.getInputStream();

			BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
			StringBuffer contents = new StringBuffer();
			String line;
			while ((line = reader.readLine()) != null) {
				contents.append(line);
				contents.append(JK.NEW_LINE);
			}
			inputStream.close();
			return contents.toString();
		} catch (Exception e) {
			JKExceptionUtil.handle(e);
			return null;// unreachable
		} finally {
			if (con != null) {
				con.disconnect();
			}
		}
	}
579617
@Override
    @Deprecated
    public T from(final String string) throws IllegalArgumentException, DescriptorImportException {
        return fromString(string);
    }
1105636
public void loadExampleStatementsFromXMLString(String xmlString) 
    		throws JSONException, IllegalArgumentException, JsonParseException, JsonMappingException, IOException
    {
    	if (LOGGER.isTraceEnabled()) {
    		LOGGER.trace("Receiving json string: " + xmlString);
    	}
    	JSONObject jsonobject = XML.toJSONObject(xmlString);
    	String[] root = JSONObject.getNames(jsonobject);
    	if (null == root) {
    		throw new IllegalArgumentException("no root object in xml found");
    	}
    	if (root.length > 1) {
    		throw new IllegalArgumentException("more than one root objects found");
    	}
    	JSONObject statement = jsonobject.getJSONObject(root[0]);
    	loadExampleStatementsFromJsonString(statement.toString());
    }
1359386
private String getText(JsonNode jsonObject, String nodeName) {
        JsonNode subNode = jsonObject.get(nodeName);

        if (subNode == null) {
            return null;
        }

        if (!subNode.isTextual()) {
            throw new IllegalStateException(nodeName + " from credential process should be textual, but was " +
                                            subNode.getNodeType());
        }

        return subNode.asText();
    }
324429
public static PushSubscription fromString(String str) {
        if (str == null || str.isEmpty()) {
            throw new IllegalArgumentException("Cannot create a stream from an empty or null string");
        }
        PushSubscription stream = new PushSubscription();
        stream.id = str;
        return stream;
    }
806485
@Override
    public TextMessage createTextMessage() throws JMSRuntimeException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "createTextMessage");

        TextMessage textMessage = null;

        try {
            textMessage = jmsSession.createTextMessage();
        } catch (JMSException jmse) {
            throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "createTextMessage", new Object[] { textMessage });
        }

        return textMessage;

    }