当前位置: 首页>>代码示例>>Java>>正文


Java Expose.deserialize方法代码示例

本文整理汇总了Java中com.google.gson.annotations.Expose.deserialize方法的典型用法代码示例。如果您正苦于以下问题:Java Expose.deserialize方法的具体用法?Java Expose.deserialize怎么用?Java Expose.deserialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gson.annotations.Expose的用法示例。


在下文中一共展示了Expose.deserialize方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: excludeField

import com.google.gson.annotations.Expose; //导入方法依赖的package包/类
public boolean excludeField(Field field, boolean serialize) {
    if ((this.modifiers & field.getModifiers()) != 0) {
        return true;
    }
    if (this.version != IGNORE_VERSIONS && !isValidVersion((Since) field.getAnnotation(Since.class), (Until) field.getAnnotation(Until.class))) {
        return true;
    }
    if (field.isSynthetic()) {
        return true;
    }
    if (this.requireExpose) {
        Expose annotation = (Expose) field.getAnnotation(Expose.class);
        if (annotation == null || (serialize ? !annotation.serialize() : !annotation.deserialize())) {
            return true;
        }
    }
    if (!this.serializeInnerClasses && isInnerClass(field.getType())) {
        return true;
    }
    if (isAnonymousOrLocal(field.getType())) {
        return true;
    }
    List<ExclusionStrategy> list = serialize ? this.serializationStrategies : this.deserializationStrategies;
    if (!list.isEmpty()) {
        FieldAttributes fieldAttributes = new FieldAttributes(field);
        for (ExclusionStrategy exclusionStrategy : list) {
            if (exclusionStrategy.shouldSkipField(fieldAttributes)) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:34,代码来源:Excluder.java

示例2: excludeField

import com.google.gson.annotations.Expose; //导入方法依赖的package包/类
public boolean excludeField(Field field, boolean serialize) {
    if ((this.modifiers & field.getModifiers()) != 0) {
        return true;
    }
    if (this.version != IGNORE_VERSIONS && !isValidVersion((Since) field.getAnnotation(Since
            .class), (Until) field.getAnnotation(Until.class))) {
        return true;
    }
    if (field.isSynthetic()) {
        return true;
    }
    if (this.requireExpose) {
        Expose annotation = (Expose) field.getAnnotation(Expose.class);
        if (annotation == null || (serialize ? !annotation.serialize() : !annotation
                .deserialize())) {
            return true;
        }
    }
    if (!this.serializeInnerClasses && isInnerClass(field.getType())) {
        return true;
    }
    if (isAnonymousOrLocal(field.getType())) {
        return true;
    }
    List<ExclusionStrategy> list = serialize ? this.serializationStrategies : this
            .deserializationStrategies;
    if (!list.isEmpty()) {
        FieldAttributes fieldAttributes = new FieldAttributes(field);
        for (ExclusionStrategy exclusionStrategy : list) {
            if (exclusionStrategy.shouldSkipField(fieldAttributes)) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:37,代码来源:Excluder.java

示例3: shouldSkipField

import com.google.gson.annotations.Expose; //导入方法依赖的package包/类
public boolean shouldSkipField(FieldAttributes f) {
  Expose annotation = f.getAnnotation(Expose.class);
  if (annotation == null) {
    return true;
  }
  return !annotation.deserialize();
}
 
开发者ID:IAmPhoenix,项目名称:Minecraft-API-Protocol,代码行数:8,代码来源:ExposeAnnotationDeserializationExclusionStrategy.java

示例4: shouldSkipField

import com.google.gson.annotations.Expose; //导入方法依赖的package包/类
@Override
public boolean shouldSkipField(final FieldAttributes fieldAttributes) {
    Expose exposeAnnotation = fieldAttributes.getAnnotation(Expose.class);
    if (exposeAnnotation == null) {
        return false;
    }
    if (useForSerialization) {
        return !exposeAnnotation.serialize();
    }
    return !exposeAnnotation.deserialize();
}
 
开发者ID:vmware,项目名称:workflowTools,代码行数:12,代码来源:ImprovedExclusionStrategy.java

示例5: fromMap

import com.google.gson.annotations.Expose; //导入方法依赖的package包/类
public <T> T fromMap(Map values, Class<T> objectClass) {
    Object createdObject = ReflectionUtils.newInstance(objectClass);
    for (Field field : objectClass.getDeclaredFields()) {
        if (Modifier.isStatic(field.getModifiers()) || Modifier.isFinal(field.getModifiers())) {
            continue;
        }

        Expose exposeAnnotation = field.getAnnotation(Expose.class);
        if (exposeAnnotation != null && !exposeAnnotation.deserialize()) {
            continue;
        }

        String nameToUse = determineNameToUseForField(field);

        if (!values.containsKey(nameToUse)) {
            continue;
        }

        Object valueToConvert = values.get(nameToUse);

        setFieldValue(createdObject, field, valueToConvert);
    }

    new PostDeserializeHandler().invokePostDeserializeMethods(createdObject);

    return (T) createdObject;
}
 
开发者ID:vmware,项目名称:workflowTools,代码行数:28,代码来源:MapObjectConverter.java

示例6: isExcluded

import com.google.gson.annotations.Expose; //导入方法依赖的package包/类
private boolean isExcluded(Field f) {
	int modifiers = f.getModifiers();
	if (Modifier.isStatic(modifiers) || Modifier.isTransient(modifiers)) {
		return true;
	}
	Expose expose = f.getAnnotation(Expose.class);
	if (expose != null && !expose.deserialize() && !expose.serialize()) {
		return true;
	}
	return false;
}
 
开发者ID:greensopinion,项目名称:swagger-jaxrs-maven,代码行数:12,代码来源:GsonIntrospector.java

示例7: excludeField

import com.google.gson.annotations.Expose; //导入方法依赖的package包/类
public boolean excludeField(Field field, boolean serialize) {
  if ((modifiers & field.getModifiers()) != 0) {
    return true;
  }

  if (version != Excluder.IGNORE_VERSIONS
      && !isValidVersion(field.getAnnotation(Since.class), field.getAnnotation(Until.class))) {
    return true;
  }

  if (field.isSynthetic()) {
    return true;
  }

  if (requireExpose) {
    Expose annotation = field.getAnnotation(Expose.class);
    if (annotation == null || (serialize ? !annotation.serialize() : !annotation.deserialize())) {
      return true;
    }
  }

  if (!serializeInnerClasses && isInnerClass(field.getType())) {
    return true;
  }

  if (isAnonymousOrLocal(field.getType())) {
    return true;
  }

  List<ExclusionStrategy> list = serialize ? serializationStrategies : deserializationStrategies;
  if (!list.isEmpty()) {
    FieldAttributes fieldAttributes = new FieldAttributes(field);
    for (ExclusionStrategy exclusionStrategy : list) {
      if (exclusionStrategy.shouldSkipField(fieldAttributes)) {
        return true;
      }
    }
  }

  return false;
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:42,代码来源:Excluder.java

示例8: excludeField

import com.google.gson.annotations.Expose; //导入方法依赖的package包/类
private boolean excludeField(Field paramField, boolean paramBoolean)
{
  if (!this.excluder.excludeClass(paramField.getType(), paramBoolean))
  {
    Excluder localExcluder = this.excluder;
    int i;
    if ((localExcluder.modifiers & paramField.getModifiers()) != 0) {
      i = 1;
    }
    while (i == 0)
    {
      return true;
      if ((localExcluder.version != -1.0D) && (!localExcluder.isValidVersion((Since)paramField.getAnnotation(Since.class), (Until)paramField.getAnnotation(Until.class)))) {
        i = 1;
      } else {
        label140:
        label270:
        if (paramField.isSynthetic())
        {
          i = 1;
        }
        else
        {
          if (localExcluder.requireExpose)
          {
            Expose localExpose = (Expose)paramField.getAnnotation(Expose.class);
            if (localExpose != null)
            {
              if (!paramBoolean) {
                break label140;
              }
              if (localExpose.serialize()) {
                break label150;
              }
            }
            while (!localExpose.deserialize())
            {
              i = 1;
              break;
            }
          }
          label150:
          if ((!localExcluder.serializeInnerClasses) && (Excluder.isInnerClass(paramField.getType())))
          {
            i = 1;
          }
          else if (Excluder.isAnonymousOrLocal(paramField.getType()))
          {
            i = 1;
          }
          else
          {
            if (paramBoolean) {}
            for (List localList = localExcluder.serializationStrategies;; localList = localExcluder.deserializationStrategies)
            {
              if (localList.isEmpty()) {
                break label270;
              }
              new FieldAttributes(paramField);
              Iterator localIterator = localList.iterator();
              do
              {
                if (!localIterator.hasNext()) {
                  break;
                }
              } while (!((ExclusionStrategy)localIterator.next()).shouldSkipField$6e8224bb());
              i = 1;
              break;
            }
            i = 0;
          }
        }
      }
    }
  }
  return false;
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:78,代码来源:ReflectiveTypeAdapterFactory.java

示例9: shouldSkipField

import com.google.gson.annotations.Expose; //导入方法依赖的package包/类
@Override
public boolean shouldSkipField(FieldAttributes fieldAttributes) {
    final Expose expose = fieldAttributes.getAnnotation(Expose.class);
    return expose != null && !expose.deserialize();
}
 
开发者ID:ZSCNetSupportDept,项目名称:WechatTicketSystem,代码行数:6,代码来源:SQLCore.java

示例10: shouldSkipField

import com.google.gson.annotations.Expose; //导入方法依赖的package包/类
@Override
public boolean shouldSkipField(FieldAttributes f) {
    final Expose expose = f.getAnnotation(Expose.class);
    return expose != null && !expose.deserialize();
}
 
开发者ID:cerndb,项目名称:dbod-webapp,代码行数:6,代码来源:AnnotationExclusionStrategyDeserialization.java


注:本文中的com.google.gson.annotations.Expose.deserialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。