public interface ReflectionProvider
Modifier and Type | Interface and Description |
---|---|
static interface |
ReflectionProvider.Visitor
A visitor interface for serializable fields defined in a class.
|
Modifier and Type | Method and Description |
---|---|
boolean |
fieldDefinedInClass(String fieldName,
Class type)
Deprecated.
As of 1.4.5, use
getFieldOrNull(Class, String) instead |
Field |
getField(Class definedIn,
String fieldName)
Returns a field defined in some class.
|
Field |
getFieldOrNull(Class definedIn,
String fieldName)
Returns a field defined in some class.
|
Class |
getFieldType(Object object,
String fieldName,
Class definedIn) |
Object |
newInstance(Class type)
Creates a new instance of the specified type.
|
void |
visitSerializableFields(Object object,
ReflectionProvider.Visitor visitor) |
void |
writeField(Object object,
String fieldName,
Object value,
Class definedIn) |
Object newInstance(Class type)
type
- the type to instantiatevoid visitSerializableFields(Object object, ReflectionProvider.Visitor visitor)
boolean fieldDefinedInClass(String fieldName, Class type)
getFieldOrNull(Class, String)
insteadField getField(Class definedIn, String fieldName)
definedIn
- class where the field was definedfieldName
- field nameObjectAccessException
- if field does not existCopyright © 2004–2017 XStream. All rights reserved.