包 | com.supermap.web.utils |
类 | public class JsonUtil |
继承 | JsonUtil ![]() |
该类用于实现客户端对象与 JSON 对象之间的相互转换。JSON 对象用于实现客户端与服务端之间的参数传递。
方法 | 定义方 | ||
---|---|---|---|
JsonUtil()
初始化 JsonUtil 类的新实例。
|
JsonUtil | ||
fromArray(array:Array, key:String = null, other:String = null):String
[static] 将 Array 对象转换为 JSON 对象。
|
JsonUtil | ||
fromPoint2D(point:Point2D):String
[static] 将 Point2D 对象转换为 JSON 对象。
|
JsonUtil | ||
fromPoint2Ds(points:Array):String
[static] 将 Point2D 对象集合转换为 JSON 对象。
|
JsonUtil | ||
fromRectangle2D(rectangle2D:Rectangle2D):String
[static] 将 Rectangle2D 对象转换为 JSON 对象。
|
JsonUtil | ||
toCRS(jsonObject:Object):CoordinateReferenceSystem
[static] 将 JSON 对象转换为 CoordinateReferenceSystem 对象。
|
JsonUtil | ||
[static] 将 JSON 对象转换为 Point2D 对象。
|
JsonUtil | ||
toRectangle(jsonObject:Object):Rectangle
[static] 将 JSON 对象转换为 Rectangle 对象。
|
JsonUtil | ||
toRectangle2D(jsonObject:Object):Rectangle2D
[static] 将 JSON 对象转换为 Rectangle2D 对象。
|
JsonUtil |
JsonUtil | () | 构造函数 |
public function JsonUtil()
初始化 JsonUtil 类的新实例。
fromArray | () | 方法 |
public static function fromArray(array:Array, key:String = null, other:String = null):String
将 Array 对象转换为 JSON 对象。
参数
array:Array — 被转换的 Array 对象。此数组只能为一维数据,并且数据只能解析String、Number和Point2D三种类型 |
|
key:String (default = null ) — 与 Array 关联的 key 值。 |
|
other:String (default = null ) — 其它相关信息。 |
String — 返回 JSON 对象。 |
fromPoint2D | () | 方法 |
public static function fromPoint2D(point:Point2D):String
将 Point2D 对象转换为 JSON 对象。
参数
point:Point2D — 被转换的 Point2D 对象。 |
String — 返回 JSON 对象。 |
fromPoint2Ds | () | 方法 |
public static function fromPoint2Ds(points:Array):String
将 Point2D 对象集合转换为 JSON 对象。
参数
points:Array — 被转换的 Point2D 对象集合。 |
String — 返回 JSON 对象。 |
fromRectangle2D | () | 方法 |
public static function fromRectangle2D(rectangle2D:Rectangle2D):String
将 Rectangle2D 对象转换为 JSON 对象。
参数
rectangle2D:Rectangle2D — 被转换的 Rectangle2D 对象。 |
String — 返回 JSON 对象。 |
toCRS | () | 方法 |
public static function toCRS(jsonObject:Object):CoordinateReferenceSystem
将 JSON 对象转换为 CoordinateReferenceSystem 对象。
参数
jsonObject:Object — 被转换的 JSON 对象。 |
CoordinateReferenceSystem — 返回 CoordinateReferenceSystem 对象。 |
toPoint2D | () | 方法 |
public static function toPoint2D(jsonObject:Object):Point2D
将 JSON 对象转换为 Point2D 对象。
参数
jsonObject:Object — 被转换的 JSON 对象。 |
Point2D — 返回 Point2D 对象。 |
toRectangle | () | 方法 |
public static function toRectangle(jsonObject:Object):Rectangle
将 JSON 对象转换为 Rectangle 对象。
参数
jsonObject:Object — 被转换的 JSON 对象。 |
Rectangle — 返回 Rectangle 对象。 |
toRectangle2D | () | 方法 |
public static function toRectangle2D(jsonObject:Object):Rectangle2D
将 JSON 对象转换为 Rectangle2D 对象。
参数
jsonObject:Object — 被转换的 JSON 对象。 |
Rectangle2D — 返回 Rectangle2D 对象。 |