public class JsonMapping
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static Point |
readPoint(JsonValue value)
Returns an instance of Point for the given JSON representation.
|
static Rectangle |
readRectangle(JsonValue value)
Returns an instance of Rectangle for the given JSON representation.
|
static RGB |
readRGB(JsonValue value)
Returns an instance of RGB for the given JSON representation.
|
static JsonValue |
toJson(Color color)
Returns the JSON representation for the given Color.
|
static JsonValue |
toJson(Color color,
int alpha)
Returns the JSON representation for the given Color with an additional alpha (opacity) value.
|
static JsonValue |
toJson(Cursor cursor)
Returns the JSON representation for the given Cursor.
|
static JsonValue |
toJson(Font font)
Returns the JSON representation for the given Font.
|
static JsonValue |
toJson(FontData fontData)
Returns the JSON representation for the given FontData.
|
static JsonValue |
toJson(Image image)
Returns the JSON representation for the given Image.
|
static JsonValue |
toJson(Point point)
Returns the JSON representation for the given Point.
|
static JsonValue |
toJson(Rectangle rect)
Returns the JSON representation for the given Rectangle.
|
static JsonValue |
toJson(RGB rgb)
Returns the JSON representation for the given RGB.
|
static JsonValue |
toJson(RGB rgb,
int alpha)
Returns the JSON representation for the given RGB with an additional alpha (opacity) value.
|
static JsonValue |
toJson(Widget widget)
Returns the JSON representation for the given Widget.
|
static JsonValue |
toJson(Widget[] widgets)
Returns the JSON representation for the given array of widgets.
|
public static JsonValue toJson(Widget widget)
null
,
which will be mapped to JsonValue.NULL
. Disposed widgets cannot be mapped to JSON.widget
- the widget to encode or null
, must not be disposedpublic static JsonValue toJson(Widget[] widgets)
widgets
- the array of widgets to encode, must not be null
public static JsonValue toJson(Point point)
null
,
which will be mapped to JsonValue.NULL
.point
- the Point to encode or null
public static JsonValue toJson(Rectangle rect)
null
,
which will be mapped to JsonValue.NULL
.rect
- the Rectangle to encode or null
public static JsonValue toJson(Color color)
null
,
which will be mapped to JsonValue.NULL
. Disposed colors cannot be mapped to JSON.color
- the Color to encode or null
, must not be disposedpublic static JsonValue toJson(Color color, int alpha)
null
, which will be mapped to JsonValue.NULL
regardless of the given alpha value. Disposed colors cannot be mapped to JSON.color
- the Color to encode or null
, must not be disposedalpha
- a value in the range of 0 (transparent) to 255 (opaque)public static JsonValue toJson(RGB rgb)
null
,
which will be mapped to JsonValue.NULL
.rgb
- the Color to encode or null
public static JsonValue toJson(RGB rgb, int alpha)
null
, which will be mapped to JsonValue.NULL
regardless of the given alpha value.rgb
- the RGB to encode or null
alpha
- a value in the range of 0 (transparent) to 255 (opaque)public static JsonValue toJson(Image image)
null
,
which will be mapped to JsonValue.NULL
. Disposed images cannot be mapped to JSON.image
- the Image to encode or null
, must not be disposedpublic static JsonValue toJson(Font font)
null
,
which will be mapped to JsonValue.NULL
. Disposed fonts cannot be mapped to JSON.font
- the Font to encode or null
, must not be disposedpublic static JsonValue toJson(FontData fontData)
null
,
which will be mapped to JsonValue.NULL
.fontData
- the FontData to encode or null
public static JsonValue toJson(Cursor cursor)
null
,
which will be mapped to JsonValue.NULL
.cursor
- the Cursor to encode or null
public static Point readPoint(JsonValue value)
null
if the given JSON value is JsonValue.NULL
.value
- a JsonValue that represents a point or JsonValue.NULL
null
public static Rectangle readRectangle(JsonValue value)
null
if the given JSON value is JsonValue.NULL
.value
- a JsonValue that represents a rectangle or JsonValue.NULL
null
public static RGB readRGB(JsonValue value)
null
if the given JSON value is JsonValue.NULL
.value
- a JsonValue that represents a color or JsonValue.NULL
null
Copyright (c) EclipseSource and others 2002, 2016.
All rights reserved. This program and the accompanying materials
are made available under the terms of the
Eclipse Public License v1.0