01: /*
02: * Copyright (C) 2006, 2007 XStream Committers.
03: * All rights reserved.
04: *
05: * The software in this package is published under the terms of the BSD
06: * style license a copy of which has been included with this distribution in
07: * the LICENSE.txt file.
08: *
09: * Created on 13. April 2006 by Joerg Schaible
10: */
11: package com.thoughtworks.xstream.converters.reflection;
12:
13: import java.lang.reflect.Field;
14:
15: /**
16: * A wrapper implementation for the ReflectionProvider.
17: *
18: * @author Jörg Schaible
19: * @since 1.2
20: */
21: public class ReflectionProviderWrapper implements ReflectionProvider {
22:
23: final protected ReflectionProvider wrapped;
24:
25: public ReflectionProviderWrapper(ReflectionProvider wrapper) {
26: this .wrapped = wrapper;
27: }
28:
29: public boolean fieldDefinedInClass(String fieldName, Class type) {
30: return this .wrapped.fieldDefinedInClass(fieldName, type);
31: }
32:
33: public Field getField(Class definedIn, String fieldName) {
34: return this .wrapped.getField(definedIn, fieldName);
35: }
36:
37: public Class getFieldType(Object object, String fieldName,
38: Class definedIn) {
39: return this .wrapped.getFieldType(object, fieldName, definedIn);
40: }
41:
42: public Object newInstance(Class type) {
43: return this .wrapped.newInstance(type);
44: }
45:
46: public void visitSerializableFields(Object object, Visitor visitor) {
47: this .wrapped.visitSerializableFields(object, visitor);
48: }
49:
50: public void writeField(Object object, String fieldName,
51: Object value, Class definedIn) {
52: this.wrapped.writeField(object, fieldName, value, definedIn);
53: }
54:
55: }
|