當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。