首先需下载google提供的Gson.jar包、来实现json解析与对象、Map之间的互转、方法比较简单代码如下:
/**
* json转对象
* @param json
* @param clazz 返回对象类型
* @return
*/
public static T jsonToObject(String json,Class clazz){
Gson...
分类:
Web程序 时间:
2015-01-19 17:14:53
阅读次数:
169
#ifndef_EXCEPT_H#define_EXCEPT_H#include<string>usingnamespacestd;//ServerexceptionclassCMyException:publicexception{public: CMyException(void): m_msg("ServerException!"){} CMyException(conststring&msg): m_msg("ServerException:"){ m_msg+=msg; ..
分类:
其他好文 时间:
2015-01-19 16:02:31
阅读次数:
149
String、StringBuilder、StringBuffer的使用与比较,以及+拼接操作符的特殊情况...
分类:
编程语言 时间:
2015-01-19 15:51:04
阅读次数:
183
java数据格式:
class Test{
private String name;
private String sex;
private String brith;
}
json数据格式:
{"name":"keke","sex":"male","brith":"0301"}
一、Java数据转换为json数据:
1、对象转换
Test...
分类:
编程语言 时间:
2015-01-19 15:50:17
阅读次数:
170
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
DateTime t...
分类:
其他好文 时间:
2015-01-19 14:29:18
阅读次数:
131
使用到的两个对象:DocumentSummaryInformation和SummaryInformation。代码如下:static void Main(string[] args) { //Create 一个Excel对象 HSSFWork...
分类:
其他好文 时间:
2015-01-19 14:22:49
阅读次数:
123
1.认识捕获变量 static void Main(string[] args) { Action action = CaptureVariable(); action(); } static Act...
分类:
其他好文 时间:
2015-01-19 14:16:20
阅读次数:
203
1 public static void main(String[] args) { 2 Map map = new HashMap(); 3 map.put("os5", 10); 4 map.put("os4", 13); 5 m...
分类:
编程语言 时间:
2015-01-19 14:06:39
阅读次数:
269
/** * 人民币小写转大写 * * @param string $number 数值 * @param string $int_unit 币种单位,默认"元",有的需求可能为"圆" * @param bool $is_round 是否对小数进行四舍五入 * @p...
分类:
其他好文 时间:
2015-01-19 12:34:49
阅读次数:
214
1.在Console->Data Templates中选择Redis的模版在custom Data中勾选中Port2并保存2.在Console->Data Input Methods中选择相应的Redis修改Input String,注意Input Fields中的字段是否有port2,如下图
分类:
其他好文 时间:
2015-01-19 12:33:00
阅读次数:
199