本文整理匯總了Java中com.google.gson.FieldAttributes.getDeclaringClass方法的典型用法代碼示例。如果您正苦於以下問題:Java FieldAttributes.getDeclaringClass方法的具體用法?Java FieldAttributes.getDeclaringClass怎麽用?Java FieldAttributes.getDeclaringClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gson.FieldAttributes
的用法示例。
在下文中一共展示了FieldAttributes.getDeclaringClass方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: shouldSkipField
import com.google.gson.FieldAttributes; //導入方法依賴的package包/類
@Override
public boolean shouldSkipField(FieldAttributes fa) {
Class objectClass = fa.getDeclaringClass();
List<String> whiteList = null;
if (objectClass.equals(ProjectFile.class)) {
whiteList = FIELD_WHITELIST_PROJECT_FILE;
}
else if (objectClass.equals(UploadedFile.class)) {
whiteList = FIELD_WHITELIST_UPLOADED_FILE;
}
if (whiteList != null) {
return !whiteList.contains(fa.getName());
}
return false;
}
示例2: 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")
)
);
}
示例3: 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());
}
示例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);
}
示例5: 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);
}
示例6: shouldSkipField
import com.google.gson.FieldAttributes; //導入方法依賴的package包/類
@Override
public boolean shouldSkipField(FieldAttributes arg0) {
return arg0.getDeclaringClass() == Task.class && arg0.getName().equalsIgnoreCase("mCommand")
|| arg0.getDeclaringClass() == Task.class && arg0.getName().equalsIgnoreCase("mHistory")
|| arg0.getDeclaringClass() == Job.class && arg0.getName().equalsIgnoreCase("mTasks")
|| arg0.getDeclaringClass() == Job.class && arg0.getName().equalsIgnoreCase("mHistory");
}
示例7: shouldSkipField
import com.google.gson.FieldAttributes; //導入方法依賴的package包/類
/**
* @param f the field object that is under test
* @return true if the field should be ignored; otherwise false
*/
@Override
public boolean shouldSkipField(FieldAttributes f) {
if (f.getDeclaringClass() == OCRTransaction.class) {
return !fieldsOcrTransaction.contains(f.getName());
} else {
return false;
}
}
示例8: shouldSkipField
import com.google.gson.FieldAttributes; //導入方法依賴的package包/類
@Override
public boolean shouldSkipField(FieldAttributes f) {
if(f.getDeclaringClass() == c){
for(int i=0; i<fieldNames.size(); i++){
if(f.getName().equals(fieldNames.get(i)))
return true;
}
}
return false;
}
示例9: 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
)
);
}
示例10: 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
)
);
}
示例11: shouldSkipField
import com.google.gson.FieldAttributes; //導入方法依賴的package包/類
public boolean shouldSkipField(FieldAttributes f) {
// ZipFiles have a circular reference that makes serializing tricky.
// JarEntries have a lot of noisy certificate information.
return (f.getDeclaringClass() == JarFile.class || f.getDeclaringClass() == ZipFile.class || f.getDeclaringClass() == JarEntry.class);
}
示例12: shouldSkipField
import com.google.gson.FieldAttributes; //導入方法依賴的package包/類
public boolean shouldSkipField(FieldAttributes fieldAttributes) {
String fieldName = fieldAttributes.getName();
Class<?> theClass = fieldAttributes.getDeclaringClass();
return isFieldInSuperclass(theClass, fieldName);
}
示例13: 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
示例14: shouldSkipField
import com.google.gson.FieldAttributes; //導入方法依賴的package包/類
public boolean shouldSkipField(FieldAttributes f) {
return (f.getDeclaringClass() == c && f.getName().equals(fieldName));
}
示例15: shouldSkipField
import com.google.gson.FieldAttributes; //導入方法依賴的package包/類
public boolean shouldSkipField(FieldAttributes f) {
return (f.getDeclaringClass() == c && f.getName().equals(fieldName));
}