Example usage for org.json.simple JSONValue escape

List of usage examples for org.json.simple JSONValue escape

Introduction

In this page you can find the example usage for org.json.simple JSONValue escape.

Prototype

public static String escape(String s) 

Source Link

Usage

From source file:sf.net.experimaestro.manager.js.JSNode.java

@Override
public void write(Writer out) throws IOException {
    out.write(JSONValue.escape(XMLUtils.toString(node)));
}

From source file:sf.net.experimaestro.manager.json.JsonPath.java

@Override
public void writeDescriptorString(Writer writer, JsonWriterOptions options) throws IOException {
    if (options.ignore.contains(ValueType.XP_PATH)) {
        writer.write("null");
    } else {// ww  w.  j ava2s.  c  o m
        writer.write('"');
        writer.write(JSONValue.escape(options.resolver.apply(path)));
        writer.write('"');
    }
}

From source file:sf.net.experimaestro.manager.json.JsonPath.java

@Override
public void write(Writer out) throws IOException {
    out.write('"');
    out.write(JSONValue.escape(get().toString()));
    out.write('"');
}