AndBase开发框架  1.6
 全部  命名空间 文件 函数 变量 枚举值 
Public 成员函数 | 包函数 | Private 属性 | 所有成员列表
com.google.gson.FieldAttributes类 参考

Public 成员函数

 FieldAttributes (Field f)
 
Class<?> getDeclaringClass ()
 
String getName ()
 
Type getDeclaredType ()
 
Class<?> getDeclaredClass ()
 
Collection< Annotation > getAnnotations ()
 
boolean hasModifier (int modifier)
 

包函数

public< T extends Annotation > T getAnnotation (Class< T > annotation)
 
Object get (Object instance) throws IllegalAccessException
 
boolean isSynthetic ()
 

Private 属性

final Field field
 

详细描述

A data object that stores attributes of a field.

This class is immutable; therefore, it can be safely shared across threads.

作者
Inderjeet Singh
Joel Leitch
自从
1.4

构造及析构函数说明

com.google.gson.FieldAttributes.FieldAttributes ( Field  f)
inline

Constructs a Field Attributes object from the

f

.

参数
fthe field to pull attributes from

成员函数说明

Object com.google.gson.FieldAttributes.get ( Object  instance) throws IllegalAccessException
inlinepackage

This is exposed internally only for the removing synthetic fields from the JSON output.

返回
true if the field is synthetic; otherwise false
异常
IllegalAccessException
IllegalArgumentException
public<T extends Annotation> T com.google.gson.FieldAttributes.getAnnotation ( Class< T >  annotation)
inlinepackage

Return the

T

annotation object from this field if it exist; otherwise returns

null

.

参数
annotationthe class of the annotation that will be retrieved
返回
the annotation instance if it is bound to the field; otherwise
null
Collection<Annotation> com.google.gson.FieldAttributes.getAnnotations ( )
inline

Return the annotations that are present on this field.

返回
an array of all the annotations set on the field
自从
1.4
Class<?> com.google.gson.FieldAttributes.getDeclaredClass ( )
inline

Returns the

Class

object that was declared for this field.

For example, assume the following class definition:

public class Foo {
  private String bar;
  private List<String> red;
}

This method would return

String.class

for the

bar

field and

List.class

for the

red

field.

返回
the specific class object that was declared for the field
Type com.google.gson.FieldAttributes.getDeclaredType ( )
inline

For example, assume the following class definition:

public class Foo {
  private String bar;
  private List<String> red;
}
Type listParmeterizedType = new TypeToken<List<String>>() {}.getType();

This method would return

String.class

for the

bar

field and

listParameterizedType

for the

red

field.

返回
the specific type declared for this field
Class<?> com.google.gson.FieldAttributes.getDeclaringClass ( )
inline
返回
the declaring class that contains this field
String com.google.gson.FieldAttributes.getName ( )
inline
返回
the name of the field
boolean com.google.gson.FieldAttributes.hasModifier ( int  modifier)
inline

Returns

true

if the field is defined with the

modifier

.

This method is meant to be called as:

boolean hasPublicModifier = fieldAttribute.hasModifier(java.lang.reflect.Modifier.PUBLIC);
参见
java.lang.reflect.Modifier
boolean com.google.gson.FieldAttributes.isSynthetic ( )
inlinepackage

This is exposed internally only for the removing synthetic fields from the JSON output.

返回
true if the field is synthetic; otherwise false

类成员变量说明

final Field com.google.gson.FieldAttributes.field
private

该类的文档由以下文件生成: