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


Java FieldAttributes.getName方法代码示例

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


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

示例1: shouldSkipField

import com.google.gson.FieldAttributes; //导入方法依赖的package包/类
public boolean shouldSkipField(FieldAttributes f) {
 	String name = f.getName();
     return (f.getDeclaringClass() == Location.class && 
     			(name.equals("mResults") 
     				|| name.equals("mDistance") 
     				|| name.equals("mInitialBearing") 
     				|| name.equals("mLat1") 
     				|| name.equals("mLat2") 
     				|| name.equals("mLon1") 
     				|| name.equals("mLon2") 
     				|| name.equals("mLon2")
|| name.equals("mHasSpeed")
|| name.equals("mHasAccuracy")
|| name.equals("mHasAltitude")
|| name.equals("mHasBearing")
|| name.equals("mHasSpeed")
|| name.equals("mElapsedRealtimeNanos")
     				)
     		);
 }
 
开发者ID:OpenSensing,项目名称:funf-v4,代码行数:21,代码来源:LocationProbe.java

示例2: shouldSkipField

import com.google.gson.FieldAttributes; //导入方法依赖的package包/类
@Override
public boolean shouldSkipField(FieldAttributes f) {
	SkipSerialization annotation = f.getAnnotation(SkipSerialization.class);
	if (annotation != null)
		return true;
	
	String fieldName = f.getName();
	Class<?> definedIn = f.getDeclaringClass();

	for (Entry<String, Class<?>> include : serializee.getIncludes().entries()) {
		if (isCompatiblePath(include, definedIn, fieldName)) {
			return false;
		}
	}
	for (Entry<String, Class<?>> exclude : serializee.getExcludes().entries()) {
		if (isCompatiblePath(exclude, definedIn, fieldName)) {
			return true;
		}
	}
	
	Field field = reflectionProvider.getField(definedIn, fieldName);
	return !serializee.isRecursive() && !shouldSerializeField(field.getType());
}
 
开发者ID:caelum,项目名称:vraptor4,代码行数:24,代码来源:Exclusions.java

示例3: shouldSkipField

import com.google.gson.FieldAttributes; //导入方法依赖的package包/类
@Override
public boolean shouldSkipField(FieldAttributes fieldAttributes) {
    String fieldName = fieldAttributes.getName();
    Class<?> theClass = fieldAttributes.getDeclaringClass();

    return isFieldInSuperclass(theClass, fieldName);
}
 
开发者ID:mcdcorp,项目名称:opentest,代码行数:8,代码来源:DuplicateFieldExclusionStrategy.java

示例4: shouldSkipField

import com.google.gson.FieldAttributes; //导入方法依赖的package包/类
@Override
public boolean shouldSkipField(FieldAttributes fieldAttributes) {
  String fieldName = fieldAttributes.getName();
  Class<?> theClass = fieldAttributes.getDeclaringClass();

  return isFieldInSuperclass(theClass, fieldName);
}
 
开发者ID:googleads,项目名称:keyword-optimizer,代码行数:8,代码来源:JsonUtil.java

示例5: shouldSkipField

import com.google.gson.FieldAttributes; //导入方法依赖的package包/类
public boolean shouldSkipField(FieldAttributes f) {
	String name = f.getName();
	return (f.getDeclaringClass() == ScanResult.class &&
			(name.equals("XXX")
                      //here we can remove fields from the scan result if we want to
			)
	);
}
 
开发者ID:OpenSensing,项目名称:funf-v4,代码行数:9,代码来源:WifiProbe.java

示例6: shouldSkipField

import com.google.gson.FieldAttributes; //导入方法依赖的package包/类
public boolean shouldSkipField(FieldAttributes f) {
	String name = f.getName();
	return (f.getDeclaringClass() == BluetoothDevice.class &&
			(name.equals("XXX")
					//here we can remove fields from the scan result if we want to
			)
	);
}
 
开发者ID:OpenSensing,项目名称:funf-v4,代码行数:9,代码来源:BluetoothProbe.java

示例7: shouldSkipField

import com.google.gson.FieldAttributes; //导入方法依赖的package包/类
@Override
public boolean shouldSkipField(FieldAttributes f) {
    String fieldName = f.getName();
    if (fieldName.startsWith("_")) {
        return true;
    }
    return false;
}
 
开发者ID:yamingd,项目名称:argo,代码行数:9,代码来源:GsonPrefixExclusion.java

示例8: shouldSkipField

import com.google.gson.FieldAttributes; //导入方法依赖的package包/类
@Override
public boolean shouldSkipField(FieldAttributes f) {
    String fieldName = f.getName();
    if (inclusionFields.contains(fieldName)) {
        return false;
    }
    return true;
}
 
开发者ID:yamingd,项目名称:argo,代码行数:9,代码来源:GsonInclusion.java

示例9: shouldSkipField

import com.google.gson.FieldAttributes; //导入方法依赖的package包/类
@Override
public boolean shouldSkipField(FieldAttributes f) {
    String fieldName = f.getName();
    if (exclusionFields.contains(fieldName)) {
        return true;
    }
    return false;
}
 
开发者ID:yamingd,项目名称:argo,代码行数:9,代码来源:GsonExclusion.java

示例10: shouldSkipField

import com.google.gson.FieldAttributes; //导入方法依赖的package包/类
public boolean shouldSkipField(FieldAttributes fieldAttributes) {
    String fieldName = fieldAttributes.getName();
    Class<?> theClass = fieldAttributes.getDeclaringClass();

    return isFieldInSuperclass(theClass, fieldName);
}
 
开发者ID:GoldRenard,项目名称:JuniperBotJ,代码行数:7,代码来源:GsonUtils.java

示例11: shouldSkipField

import com.google.gson.FieldAttributes; //导入方法依赖的package包/类
public boolean shouldSkipField(FieldAttributes fieldAttributes) {
	String fieldName = fieldAttributes.getName();
	Class<?> theClass = fieldAttributes.getDeclaringClass();

	return isFieldInSuperclass(theClass, fieldName);
}
 
开发者ID:OpenCode4Workspace,项目名称:Watson-Work-Services-Java-SDK,代码行数:7,代码来源:SuperclassExclusionStrategy.java

示例12: shouldSkipField

import com.google.gson.FieldAttributes; //导入方法依赖的package包/类
@Override
public boolean shouldSkipField(FieldAttributes fieldAttributes) {
    String fieldName = fieldAttributes.getName();
    return fieldName.equals("gameVersion") || fieldName.equals("player") || fieldName.equals("customData");
}
 
开发者ID:CyberCRI,项目名称:RedMetrics,代码行数:6,代码来源:ProgressDataGsonProvider.java

示例13: shouldSkipField

import com.google.gson.FieldAttributes; //导入方法依赖的package包/类
@Override
public boolean shouldSkipField(FieldAttributes fieldAttributes) {
    String fieldName = fieldAttributes.getName();
    return fieldName.equals("game");
}
 
开发者ID:CyberCRI,项目名称:RedMetrics,代码行数:6,代码来源:GameVersionGsonProvider.java


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