Refine search
if (json.get("platform") != null) { platform = Platform.byDesc(json.get("platform").asString()); if (json.get("jdk") != null) { jdk = json.get("jdk").asString(); if (json.get("executable") != null) { executable = json.get("executable").asString(); if (json.get("classpath") != null) { classpath = toStringArray(json.get("classpath").asArray()); if (json.get("removelibs") != null) { removePlatformLibs = toStringArray(json.get("removelibs").asArray()); if (json.get("mainclass") != null) { mainClass = json.get("mainclass").asString(); if (json.get("vmargs") != null) { List<String> vmArgs = toStringArray(json.get("vmargs").asArray()); this.vmArgs = new ArrayList<>(); for (String vmArg : vmArgs) { if (json.get("minimizejre") != null) { minimizeJre = json.get("minimizejre").asString(); if (json.get("cachejre") != null) { cacheJre = new File(json.get("cachejre").asString());
public static void main(String[] args) throws IOException { // convert Java to writer JsonObject root = Json.object().add("message", "Hi").add( "place", Json.object().add("name", "World!") ); StringWriter writer = new StringWriter(); root.writeTo(writer); String json = writer.toString(); System.out.println(json); System.out.println(); // convert writer to Java JsonObject obj = Json.parse(json).asObject(); String message = obj.get("message").asString(); String name = obj.get("place").asObject().get("name").asString(); System.out.println(message + " " + name); } }
JsonArray reduceArray = minimizeJson.get("reduce").asArray(); for (JsonValue reduce : reduceArray) { String path = reduce.asObject().get("archive").asString(); File file = new File(output, path); JsonArray removeArray = reduce.asObject().get("paths").asArray(); for (JsonValue remove : removeArray) { File removeFile = new File(fileNoExt, remove.asString()); if (removeFile.exists()) { if (removeFile.isDirectory()) { JsonArray removeArray = minimizeJson.get("remove").asArray(); for (JsonValue remove : removeArray) { String platform = remove.asObject().get("platform").asString(); JsonArray removeFilesArray = remove.asObject().get("paths").asArray(); for (JsonValue removeFile : removeFilesArray) { removeFileWildcard(output, removeFile.asString(), config);
/** * Returns the <code>String</code> value of the member with the specified name in this object. If * this object does not contain a member with this name, the given default value is returned. If * this object contains multiple members with the given name, the last one is picked. If this * member's value does not represent a JSON string, an exception is thrown. * * @param name * the name of the member whose value is to be returned * @param defaultValue * the value to be returned if the requested member is missing * @return the value of the last member with the specified name, or the given default value if * this object does not contain a member with that name */ public String getString(String name, String defaultValue) { JsonValue value = get(name); return value != null ? value.asString() : defaultValue; }
EventLog(BoxAPIConnection api, JsonObject json, String streamPosition, int limit) { this.streamPosition = streamPosition; this.limit = limit; this.nextStreamPosition = json.get("next_stream_position").asString(); this.chunkSize = json.get("chunk_size").asInt(); this.set = new LinkedHashSet<BoxEvent>(this.chunkSize); JsonArray entries = json.get("entries").asArray(); for (JsonValue entry : entries) { this.set.add(new BoxEvent(api, entry.asObject())); } }
@Override public void handle(SkypeImpl skype, JsonObject resource) throws ConnectionException, ChatNotFoundException, IOException { String from = resource.get("from").asString(); String url = resource.get("conversationLink").asString(); String content = resource.get("content").asString(); boolean finished = content.startsWith("<ended/>") || content.startsWith("<partlist type=\"ended\""); ChatImpl c = getChat(url, skype); Participant u = getUser(from, c); CallReceivedEvent event = new CallReceivedEvent(c, u, !finished); skype.getEventDispatcher().callEvent(event); } },
private void updateAccessibleBy(JsonObject json) { String type = json.get("type").asString(); if ((type.equals("user") && this.accessibleBy instanceof BoxUser.Info) || (type.equals("group") && this.accessibleBy instanceof BoxGroup.Info)) { this.accessibleBy.update(json); } else { this.accessibleBy = this.parseAccessibleBy(json); } }
private List<BoxFolder.Info> parsePathCollection(JsonObject jsonObject) { int count = jsonObject.get("total_count").asInt(); List<BoxFolder.Info> pathCollection = new ArrayList<BoxFolder.Info>(count); JsonArray entries = jsonObject.get("entries").asArray(); for (JsonValue value : entries) { JsonObject entry = value.asObject(); String id = entry.get("id").asString(); BoxFolder folder = new BoxFolder(getAPI(), id); pathCollection.add(folder.new Info(entry)); } return pathCollection; }