01: /*******************************************************************************
02: * Portions created by Sebastian Thomschke are copyright (c) 2005-2007 Sebastian
03: * Thomschke.
04: *
05: * All Rights Reserved. This program and the accompanying materials
06: * are made available under the terms of the Eclipse Public License v1.0
07: * which accompanies this distribution, and is available at
08: * http://www.eclipse.org/legal/epl-v10.html
09: *
10: * Contributors:
11: * Sebastian Thomschke - initial implementation.
12: *******************************************************************************/package net.sf.oval.context;
13:
14: import java.lang.reflect.Field;
15:
16: import net.sf.oval.internal.util.SerializableField;
17:
18: /**
19: * @author Sebastian Thomschke
20: */
21: public class FieldContext extends OValContext {
22: private static final long serialVersionUID = 1L;
23:
24: private final SerializableField field;
25:
26: /**
27: * @param field
28: */
29: public FieldContext(final Field field) {
30: this .field = SerializableField.getInstance(field);
31: }
32:
33: /**
34: * @return Returns the field.
35: */
36: public Field getField() {
37: return field.getField();
38: }
39:
40: @Override
41: public String toString() {
42: return field.getDeclaringClass().getName() + "."
43: + field.getName();
44: }
45: }
|