资源简介
Google gson库能够实现定制化的序列化和反序列操作,能够简化Java序列化和反序列化操作
代码片段和文件信息
/*
* Copyright (C) 2012 Square Inc.
*
* Licensed under the Apache License Version 2.0 (the “License“);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.gson.codegen;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
public class CodeGen {
private CodeGen() {
}
public static PackageElement getPackage(Element type) {
while (type.getKind() != ElementKind.PACKAGE) {
type = type.getEnclosingElement();
}
return (PackageElement) type;
}
/**
* Returns a fully qualified class name to complement {@code type}.
*/
public static String adapterName(TypeElement typeElement String suffix) {
StringBuilder builder = new StringBuilder();
rawTypeToString(builder typeElement ‘$‘);
builder.append(suffix);
return builder.toString();
}
static void rawTypeToString(StringBuilder result TypeElement type char innerClassSeparator) {
String packageName = getPackage(type).getQualifiedName().toString();
String qualifiedName = type.getQualifiedName().toString();
result.append(packageName);
result.append(‘.‘);
result.append(
qualifiedName.substring(packageName.length() + 1).replace(‘.‘ innerClassSeparator));
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-03-11 14:53 gson-master\
文件 44 2019-03-11 14:53 gson-master\.gitattributes
文件 162 2019-03-11 14:53 gson-master\.gitignore
文件 227 2019-03-11 14:53 gson-master\.travis.yml
文件 16940 2019-03-11 14:53 gson-master\CHANGELOG.md
文件 6732 2019-03-11 14:53 gson-master\GsonDesignDocument.md
文件 11358 2019-03-11 14:53 gson-master\LICENSE
文件 3379 2019-03-11 14:53 gson-master\README.md
文件 3985 2019-03-11 14:53 gson-master\ReleaseProcess.md
文件 30704 2019-03-11 14:53 gson-master\UserGuide.md
文件 130 2019-03-11 14:53 gson-master\build.gradle
目录 0 2019-03-11 14:53 gson-master\codegen\
文件 5828 2019-03-11 14:53 gson-master\codegen\pom.xm
目录 0 2019-03-11 14:53 gson-master\codegen\src\
目录 0 2019-03-11 14:53 gson-master\codegen\src\main\
目录 0 2019-03-11 14:53 gson-master\codegen\src\main\java\
目录 0 2019-03-11 14:53 gson-master\codegen\src\main\java\com\
目录 0 2019-03-11 14:53 gson-master\codegen\src\main\java\com\google\
目录 0 2019-03-11 14:53 gson-master\codegen\src\main\java\com\google\gson\
目录 0 2019-03-11 14:53 gson-master\codegen\src\main\java\com\google\gson\codegen\
文件 1786 2019-03-11 14:53 gson-master\codegen\src\main\java\com\google\gson\codegen\CodeGen.java
文件 711 2019-03-11 14:53 gson-master\codegen\src\main\java\com\google\gson\codegen\GeneratedTypeAdapter.java
文件 2412 2019-03-11 14:53 gson-master\codegen\src\main\java\com\google\gson\codegen\GeneratedTypeAdapterProcessor.java
文件 11646 2019-03-11 14:53 gson-master\codegen\src\main\java\com\google\gson\codegen\JavaWriter.java
目录 0 2019-03-11 14:53 gson-master\codegen\src\main\resources\
目录 0 2019-03-11 14:53 gson-master\codegen\src\main\resources\me
目录 0 2019-03-11 14:53 gson-master\codegen\src\main\resources\me
文件 53 2019-03-11 14:53 gson-master\codegen\src\main\resources\me
目录 0 2019-03-11 14:53 gson-master\codegen\src\test\
目录 0 2019-03-11 14:53 gson-master\codegen\src\test\java\
目录 0 2019-03-11 14:53 gson-master\codegen\src\test\java\com\
............此处省略440个文件信息
- 上一篇:数字视频水印技术的研究-毕设专业文献综述
- 下一篇:ormLite数据库框架jar包
评论
共有 条评论