public SerializeBeanInfo(Class<?> beanType, //
JSONType jsonType, //
String typeName, //
String typeKey,
int features,
FieldInfo[] fields, //
FieldInfo[] sortedFields
){
this.beanType = beanType;
this.jsonType = jsonType;
this.typeName = typeName;
this.typeKey = typeKey;
this.features = features;
this.fields = fields;
this.sortedFields = sortedFields;
}
java类com.alibaba.fastjson.annotation.JSONType的实例源码
SerializeBeanInfo.java 文件源码
项目:GitHub
阅读 43
收藏 0
点赞 0
评论 0
JavaBeanInfo.java 文件源码
项目:GitHub
阅读 43
收藏 0
点赞 0
评论 0
public static Class<?> getBuilderClass(Class<?> clazz, JSONType type) {
if (clazz != null && clazz.getName().equals("org.springframework.security.web.savedrequest.DefaultSavedRequest")) {
return TypeUtils.loadClass("org.springframework.security.web.savedrequest.DefaultSavedRequest$Builder");
}
if (type == null) {
return null;
}
Class<?> builderClass = type.builder();
if (builderClass == Void.class) {
return null;
}
return builderClass;
}
TypeUtils.java 文件源码
项目:itmarry
阅读 40
收藏 0
点赞 0
评论 0
private static boolean isJSONTypeIgnore(Class<?> clazz, String propertyName) {
JSONType jsonType = clazz.getAnnotation(JSONType.class);
if (jsonType != null && jsonType.ignores() != null) {
for (String item : jsonType.ignores()) {
if (propertyName.equalsIgnoreCase(item)) {
return true;
}
}
}
if (clazz.getSuperclass() != Object.class && clazz.getSuperclass() != null) {
if (isJSONTypeIgnore(clazz.getSuperclass(), propertyName)) {
return true;
}
}
return false;
}
TypeUtils.java 文件源码
项目:android_http_demo
阅读 43
收藏 0
点赞 0
评论 0
private static boolean isJSONTypeIgnore(Class<?> clazz, String propertyName) {
JSONType jsonType = clazz.getAnnotation(JSONType.class);
if (jsonType != null && jsonType.ignores() != null) {
for (String item : jsonType.ignores()) {
if (propertyName.equalsIgnoreCase(item)) {
return true;
}
}
}
if (clazz.getSuperclass() != Object.class) {
if (isJSONTypeIgnore(clazz.getSuperclass(), propertyName)) {
return true;
}
}
return false;
}
TypeUtils.java 文件源码
项目:cartman
阅读 38
收藏 0
点赞 0
评论 0
private static boolean isJSONTypeIgnore(Class<?> clazz, String propertyName) {
JSONType jsonType = clazz.getAnnotation(JSONType.class);
if (jsonType != null && jsonType.ignores() != null) {
for (String item : jsonType.ignores()) {
if (propertyName.equalsIgnoreCase(item)) {
return true;
}
}
}
if (clazz.getSuperclass() != Object.class && clazz.getSuperclass() != null) {
if (isJSONTypeIgnore(clazz.getSuperclass(), propertyName)) {
return true;
}
}
return false;
}
TypeUtils.java 文件源码
项目:AndroidNio
阅读 52
收藏 0
点赞 0
评论 0
private static boolean isJSONTypeIgnore(Class<?> clazz, String propertyName) {
JSONType jsonType = clazz.getAnnotation(JSONType.class);
if (jsonType != null && jsonType.ignores() != null) {
for (String item : jsonType.ignores()) {
if (propertyName.equalsIgnoreCase(item)) {
return true;
}
}
}
if (clazz.getSuperclass() != Object.class) {
if (isJSONTypeIgnore(clazz.getSuperclass(), propertyName)) {
return true;
}
}
return false;
}
TypeUtils.java 文件源码
项目:GitHub
阅读 41
收藏 0
点赞 0
评论 0
private static boolean isJSONTypeIgnore(Class<?> clazz, String propertyName){
JSONType jsonType = TypeUtils.getAnnotation(clazz,JSONType.class);
if(jsonType != null){
// 1、新增 includes 支持,如果 JSONType 同时设置了includes 和 ignores 属性,则以includes为准。
// 2、个人认为对于大小写敏感的Java和JS而言,使用 equals() 比 equalsIgnoreCase() 更好,改动的唯一风险就是向后兼容性的问题
// 不过,相信开发者应该都是严格按照大小写敏感的方式进行属性设置的
String[] fields = jsonType.includes();
if(fields.length > 0){
for(int i = 0; i < fields.length; i++){
if(propertyName.equals(fields[i])){
return false;
}
}
return true;
} else{
fields = jsonType.ignores();
for(int i = 0; i < fields.length; i++){
if(propertyName.equals(fields[i])){
return true;
}
}
}
}
if(clazz.getSuperclass() != Object.class && clazz.getSuperclass() != null){
if(isJSONTypeIgnore(clazz.getSuperclass(), propertyName)){
return true;
}
}
return false;
}
TypeUtils.java 文件源码
项目:GitHub
阅读 43
收藏 0
点赞 0
评论 0
public static int getSerializeFeatures(Class<?> clazz){
JSONType annotation = TypeUtils.getAnnotation(clazz,JSONType.class);
if(annotation == null){
return 0;
}
return SerializerFeature.of(annotation.serialzeFeatures());
}
TypeUtils.java 文件源码
项目:GitHub
阅读 39
收藏 0
点赞 0
评论 0
public static int getParserFeatures(Class<?> clazz){
JSONType annotation = TypeUtils.getAnnotation(clazz,JSONType.class);
if(annotation == null){
return 0;
}
return Feature.of(annotation.parseFeatures());
}
SerializeConfig.java 文件源码
项目:boohee_v5.6
阅读 28
收藏 0
点赞 0
评论 0
public ObjectSerializer createJavaBeanSerializer(Class<?> clazz) {
if (!Modifier.isPublic(clazz.getModifiers())) {
return new JavaBeanSerializer(clazz);
}
boolean asm = this.asm;
if ((asm && this.asmFactory.isExternalClass(clazz)) || clazz == Serializable.class || clazz == Object.class) {
asm = false;
}
JSONType annotation = (JSONType) clazz.getAnnotation(JSONType.class);
if (!(annotation == null || annotation.asm())) {
asm = false;
}
if (asm && !ASMUtils.checkName(clazz.getName())) {
asm = false;
}
if (asm) {
try {
ObjectSerializer asmSerializer = createASMSerializer(clazz);
if (asmSerializer != null) {
return asmSerializer;
}
} catch (ClassCastException e) {
} catch (Throwable e2) {
JSONException jSONException = new JSONException("create asm serializer error, class " + clazz, e2);
}
}
return new JavaBeanSerializer(clazz);
}
TypeUtils.java 文件源码
项目:boohee_v5.6
阅读 39
收藏 0
点赞 0
评论 0
private static boolean isJSONTypeIgnore(Class<?> clazz, String propertyName) {
JSONType jsonType = (JSONType) clazz.getAnnotation(JSONType.class);
if (!(jsonType == null || jsonType.ignores() == null)) {
for (String item : jsonType.ignores()) {
if (propertyName.equalsIgnoreCase(item)) {
return true;
}
}
}
if (clazz.getSuperclass() == Object.class || clazz.getSuperclass() == null || !isJSONTypeIgnore(clazz.getSuperclass(), propertyName)) {
return false;
}
return true;
}
TypeUtils.java 文件源码
项目:boohee_v5.6
阅读 51
收藏 0
点赞 0
评论 0
public static int getSerializeFeatures(Class<?> clazz) {
JSONType annotation = (JSONType) clazz.getAnnotation(JSONType.class);
if (annotation == null) {
return 0;
}
return SerializerFeature.of(annotation.serialzeFeatures());
}
TypeUtils.java 文件源码
项目:boohee_v5.6
阅读 40
收藏 0
点赞 0
评论 0
public static int getParserFeatures(Class<?> clazz) {
JSONType annotation = (JSONType) clazz.getAnnotation(JSONType.class);
if (annotation == null) {
return 0;
}
return Feature.of(annotation.parseFeatures());
}
TypeUtils.java 文件源码
项目:uavstack
阅读 39
收藏 0
点赞 0
评论 0
private static boolean isJSONTypeIgnore(Class<?> clazz, String propertyName) {
JSONType jsonType = clazz.getAnnotation(JSONType.class);
if (jsonType != null) {
// 1、新增 includes 支持,如果 JSONType 同时设置了includes 和 ignores 属性,则以includes为准。
// 2、个人认为对于大小写敏感的Java和JS而言,使用 equals() 比 equalsIgnoreCase() 更好,改动的唯一风险就是向后兼容性的问题
// 不过,相信开发者应该都是严格按照大小写敏感的方式进行属性设置的
String[] fields = jsonType.includes();
if (fields.length > 0) {
for (int i = 0; i < fields.length; i++) {
if (propertyName.equals(fields[i])) {
return false;
}
}
return true;
} else {
fields = jsonType.ignores();
for (int i = 0; i < fields.length; i++) {
if (propertyName.equals(fields[i])) {
return true;
}
}
}
}
if (clazz.getSuperclass() != Object.class && clazz.getSuperclass() != null) {
if (isJSONTypeIgnore(clazz.getSuperclass(), propertyName)) {
return true;
}
}
return false;
}
TypeUtils.java 文件源码
项目:uavstack
阅读 53
收藏 0
点赞 0
评论 0
public static int getSerializeFeatures(Class<?> clazz) {
JSONType annotation = clazz.getAnnotation(JSONType.class);
if (annotation == null) {
return 0;
}
return SerializerFeature.of(annotation.serialzeFeatures());
}
TypeUtils.java 文件源码
项目:uavstack
阅读 39
收藏 0
点赞 0
评论 0
public static int getParserFeatures(Class<?> clazz) {
JSONType annotation = clazz.getAnnotation(JSONType.class);
if (annotation == null) {
return 0;
}
return Feature.of(annotation.parseFeatures());
}
TypeUtils.java 文件源码
项目:cartman
阅读 46
收藏 0
点赞 0
评论 0
public static int getSerializeFeatures(Class<?> clazz) {
JSONType annotation = clazz.getAnnotation(JSONType.class);
if (annotation == null) {
return 0;
}
return SerializerFeature.of(annotation.serialzeFeatures());
}
TypeUtils.java 文件源码
项目:cartman
阅读 36
收藏 0
点赞 0
评论 0
public static int getParserFeatures(Class<?> clazz) {
JSONType annotation = clazz.getAnnotation(JSONType.class);
if (annotation == null) {
return 0;
}
return Feature.of(annotation.parseFeatures());
}
TypeUtils.java 文件源码
项目:GitHub
阅读 52
收藏 0
点赞 0
评论 0
public static List<FieldInfo> computeGetters(Class<?> clazz, Map<String,String> aliasMap, boolean sorted){
JSONType jsonType = TypeUtils.getAnnotation(clazz,JSONType.class);
Map<String,Field> fieldCacheMap = new HashMap<String,Field>();
ParserConfig.parserAllFieldToCache(clazz, fieldCacheMap);
return computeGetters(clazz, jsonType, aliasMap, fieldCacheMap, sorted, PropertyNamingStrategy.CamelCase);
}
JavaBeanInfo.java 文件源码
项目:GitHub
阅读 44
收藏 0
点赞 0
评论 0
public static Class<?> getBuilderClass(JSONType type) {
return getBuilderClass(null, type);
}
TypeUtils.java 文件源码
项目:boohee_v5.6
阅读 43
收藏 0
点赞 0
评论 0
public static JSONType getJSONType(Class<?> clazz) {
return (JSONType) clazz.getAnnotation(JSONType.class);
}
TypeUtils.java 文件源码
项目:uavstack
阅读 43
收藏 0
点赞 0
评论 0
public static JSONType getJSONType(Class<?> clazz) {
return clazz.getAnnotation(JSONType.class);
}
TypeUtils.java 文件源码
项目:cartman
阅读 48
收藏 0
点赞 0
评论 0
public static JSONType getJSONType(Class<?> clazz) {
return clazz.getAnnotation(JSONType.class);
}