本文整理匯總了Java中com.badlogic.gdx.utils.Json.writeObjectEnd方法的典型用法代碼示例。如果您正苦於以下問題:Java Json.writeObjectEnd方法的具體用法?Java Json.writeObjectEnd怎麽用?Java Json.writeObjectEnd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.utils.Json
的用法示例。
在下文中一共展示了Json.writeObjectEnd方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getRequest
import com.badlogic.gdx.utils.Json; //導入方法依賴的package包/類
@Override
protected void getRequest(Json json) {
boolean hasStart = false;
try {
json.writeObjectStart();
} catch (IllegalStateException e) {
hasStart = true;
}
//write GC codes
json.writeObjectStart("CacheCode");
json.writeArrayStart("CacheCodes");
for (String gcCode : gcCodes) {
json.writeValue(gcCode);
}
json.writeArrayEnd();
json.writeObjectEnd();
super.getRequest(json);
if (!hasStart) json.writeObjectEnd();
}
示例2: getRequest
import com.badlogic.gdx.utils.Json; //導入方法依賴的package包/類
@Override
protected void getRequest(Json json) {
boolean hasStart = false;
try {
json.writeObjectStart();
} catch (IllegalStateException e) {
hasStart = true;
}
json.writeObjectStart("HiddenByUsers");
json.writeArrayStart("UserNames");
json.writeValue(OwnerName);
json.writeArrayEnd();
json.writeObjectEnd();
super.getRequest(json);
if (!hasStart) json.writeObjectEnd();
}
示例3: getRequest
import com.badlogic.gdx.utils.Json; //導入方法依賴的package包/類
@Override
protected void getRequest(Json json) {
boolean hasStart = false;
try {
json.writeObjectStart();
} catch (IllegalStateException e) {
hasStart = true;
}
json.writeObjectStart("PointRadius");
json.writeValue("DistanceInMeters", this.distanceInMeters);
json.writeObjectStart("Point");
json.writeValue("Latitude", pos.getLatitude());
json.writeValue("Longitude", pos.getLongitude());
json.writeObjectEnd();
json.writeObjectEnd();
super.getRequest(json);
if (!hasStart) json.writeObjectEnd();
}
示例4: getRequest
import com.badlogic.gdx.utils.Json; //導入方法依賴的package包/類
@Test
void getRequest() throws IOException {
String expected = TestUtils.getResourceRequestString("testsResources/GetYourUserProfile_request.txt",
isDummy ? null : apiKey);
GetYourUserProfile getYourUserProfile = new GetYourUserProfile(apiKey);
StringWriter writer = new StringWriter();
Json json = new Json(JsonWriter.OutputType.json);
json.setWriter(writer);
json.writeObjectStart();
getYourUserProfile.getRequest(json);
json.writeObjectEnd();
String actual = writer.toString();
//remove "DeviceOperatingSystem"
expected = expected.replace("UNKNOWN", GetYourUserProfile.getDeviceOperatingSystem());
assertEquals(expected, actual, "Should be equals");
}
示例5: write
import com.badlogic.gdx.utils.Json; //導入方法依賴的package包/類
@Override
public void write (Json json) {
json.writeValue("name", name);
json.writeArrayStart("components");
for (int i = 0; i < components.size; i++)
if (components.get(i) instanceof Rigidbody) {
Rigidbody rigidbody = (Rigidbody)components.get(i);
components.removeIndex(i);
components.insert(1, rigidbody);
}
for (int i = 0; i < components.size; i++) {
GameComponent component = components.get(i);
json.writeObjectStart();
json.writeValue("componentType", component.getType());
component.write(json);
json.writeObjectEnd();
}
json.writeArrayEnd();
}
示例6: write
import com.badlogic.gdx.utils.Json; //導入方法依賴的package包/類
@Override
public void write(Json json) {
json.writeObjectStart("tile");
json.writeValue("region", region);
json.writeValue("index", index);
json.writeValue("owner", owner.getId());
json.writeValue("troops", troops);
json.writeObjectEnd();
}
示例7: write
import com.badlogic.gdx.utils.Json; //導入方法依賴的package包/類
@Override
public void write(Json json) {
json.writeObjectStart("player");
json.writeValue("id", getId());
json.writeValue("color", getColor().toString());
json.writeObjectEnd();
}
示例8: write
import com.badlogic.gdx.utils.Json; //導入方法依賴的package包/類
@Override
public void write(Json json, Bounds object, Class knownType) {
json.writeObjectStart();
json.writeValue("width", object.width);
json.writeValue("height", object.height);
json.writeObjectEnd();
}
示例9: getRequest
import com.badlogic.gdx.utils.Json; //導入方法依賴的package包/類
/**
* see: https://api.groundspeak.com/LiveV6/geocaching.svc/help/operations/GetYourUserProfile#request-json
*
* @param json
*/
@Override
protected void getRequest(Json json) {
json.writeValue("AccessToken", this.gcApiKey);
json.writeObjectStart("ProfileOptions");
json.writeObjectEnd();
json.writeObjectStart("DeviceInfo");
json.writeValue("ApplicationSoftwareVersion", BuildInfo.getRevision());
json.writeValue("DeviceOperatingSystem", getDeviceOperatingSystem());
json.writeObjectEnd();
}
示例10: getRequest
import com.badlogic.gdx.utils.Json; //導入方法依賴的package包/類
/**
* see: https://api.groundspeak.com/LiveV6/geocaching.svc/help/operations/SearchForGeocaches
*
* @param json
*/
protected void getRequest(Json json) {
json.writeValue("AccessToken", this.gcApiKey);
json.writeValue("MaxPerPage", this.number);
json.writeValue("StartIndex", 0);
json.writeValue("IsLite", this.isLite);
json.writeValue("TrackableLogCount", trackableLogCount);
json.writeValue("GeocacheLogCount", geocacheLogCount);
if (this.available) {
json.writeObjectStart("GeocacheExclusions");
json.writeValue("Archived", false);
json.writeValue("Available", true);
json.writeObjectEnd();
}
if (this.excludeHides) {
json.writeObjectStart("NotHiddenByUsers");
json.writeArrayStart("UserNames");
json.writeValue(Config.GcLogin.getValue());
json.writeArrayEnd();
json.writeObjectEnd();
}
if (this.excludeFounds) {
json.writeObjectStart("NotFoundByUsers");
json.writeArrayStart("UserNames");
json.writeValue(Config.GcLogin.getValue());
json.writeArrayEnd();
json.writeObjectEnd();
}
}
示例11: write
import com.badlogic.gdx.utils.Json; //導入方法依賴的package包/類
@Override public void write(Json json, ClientServerMessage object, Class knownType) {
json.writeObjectStart();
json.writeValue("type", object.type.toString());
if (object.participantId != null) json.writeValue("participant", object.participantId);
if (object.data != null) json.writeValue("data", object.data);
json.writeObjectEnd();
}
示例12: writeColorToJson
import com.badlogic.gdx.utils.Json; //導入方法依賴的package包/類
public static void writeColorToJson (Json json, Color color, String name) {
json.writeObjectStart(name);
json.writeValue("r", color.r);
json.writeValue("g", color.g);
json.writeValue("b", color.b);
json.writeValue("a", color.a);
json.writeObjectEnd();
}
示例13: write
import com.badlogic.gdx.utils.Json; //導入方法依賴的package包/類
@Override
public void write (Json json) {
json.writeValue("angle", getAngle());
json.writeObjectStart("color");
json.writeValue("r", getColor().r);
json.writeValue("g", getColor().g);
json.writeValue("b", getColor().b);
json.writeValue("a", getColor().a);
json.writeObjectEnd();
json.writeValue("distance", getDistance());
json.writeValue("type", getLightType().toString());
json.writeValue("rayCount", getRayCount());
json.writeValue("isSoft", isSoft());
json.writeValue("softnessLength", getSoftnessLength());
}
示例14: write
import com.badlogic.gdx.utils.Json; //導入方法依賴的package包/類
@Override
public void write (Json json) {
json.writeValue("density", density);
json.writeObjectStart("filter");
json.writeValue("categoryBits", filter.categoryBits);
json.writeValue("maskBits", filter.maskBits);
json.writeValue("groupIndex", filter.groupIndex);
json.writeObjectEnd();
json.writeValue("friction", friction);
json.writeValue("isSensor", isSensor);
json.writeValue("restitution", restitution);
}
示例15: write
import com.badlogic.gdx.utils.Json; //導入方法依賴的package包/類
@Override
public void write(Json json, ScaleFactorModel model, Class knownType) {
json.writeObjectStart();
json.writeValue("suffix", model.getSuffix());
json.writeValue("factor", model.getFactor());
json.writeObjectEnd();
}