我正在尝试使用Jackson写一个简单的类到一个文件,我创建后无法读取该文件.我明白了
org.codehaus.jackson.JsonParseException:意外的字符('.'(代码46)):在[来源:java]预期有效值(数字,字符串,数组,对象,'真','假'或'空') .io.StringReader @ f2dec59; line:1,column:2]
我的目标很简单; 它基本上只是HashMap的容器.这是我使用JSONLint检出的结果JSON文件:
{
"quaternions": {
"10": {
"x": 0,
"y": 0,
"z": 0,
"w": 1,
"identity": true
},
"11": {
"x": 0,
"y": 0,
"z": 0,
"w": 1,
"identity": true
},
"12": {
"x": 0,
"y": 0,
"z": 0,
"w": 0,
"identity": false
}
}
}
Run Code Online (Sandbox Code Playgroud)
我用来读取文件的代码如下:
TypeReference<ZeroQuaternions> typeRef;
typeRef = new TypeReference<ZeroQuaternions>() {};
ZeroQuaternions readQuats = mapper.readValue("./zeroQuatTest.json", typeRef);
Run Code Online (Sandbox Code Playgroud) 我发现自己经常做的事情就是在两个括号之间划线,然后用另一对括号粘贴.例如:
foo(int a, int b, int c)
bar(int d, int e)
Run Code Online (Sandbox Code Playgroud)
变
foo(int a, int b, int c)
bar(int a, int b, int c)
Run Code Online (Sandbox Code Playgroud)
在Vim中有一个快速的方法从foo中抽取文本并将其粘贴到栏中的文本上吗?