001: /* Copyright (C) 2004 - 2007 db4objects Inc. http://www.db4o.com
002:
003: This file is part of the db4o open source object database.
004:
005: db4o is free software; you can redistribute it and/or modify it under
006: the terms of version 2 of the GNU General Public License as published
007: by the Free Software Foundation and as clarified by db4objects' GPL
008: interpretation policy, available at
009: http://www.db4o.com/about/company/legalpolicies/gplinterpretation/
010: Alternatively you can write to db4objects, Inc., 1900 S Norfolk Street,
011: Suite 350, San Mateo, CA 94403, USA.
012:
013: db4o is distributed in the hope that it will be useful, but WITHOUT ANY
014: WARRANTY; without even the implied warranty of MERCHANTABILITY or
015: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
016: for more details.
017:
018: You should have received a copy of the GNU General Public License along
019: with this program; if not, write to the Free Software Foundation, Inc.,
020: 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
021: package EDU.purdue.cs.bloat.reflect;
022:
023: /**
024: * FieldInfo grants access to a field's name and type (represented as indices
025: * into the constant pool), as well as its modifiers. FieldInfo is implemented
026: * in <tt>file.Field</tt>.
027: *
028: * @see EDU.purdue.cs.bloat.file.Field
029: *
030: * @author Nate Nystrom (<a
031: * href="mailto:nystrom@cs.purdue.edu">nystrom@cs.purdue.edu</a>)
032: */
033: public interface FieldInfo {
034: /**
035: * Get the class which declared the field.
036: *
037: * @return The ClassInfo of the class which declared the field.
038: */
039: public ClassInfo declaringClass();
040:
041: /**
042: * Get the index into the constant pool of the name of the field.
043: *
044: * @return The index into the constant pool of the name of the field.
045: */
046: public int nameIndex();
047:
048: /**
049: * Get the index into the constant pool of the type of the field.
050: *
051: * @return The index into the constant pool of the type of the field.
052: */
053: public int typeIndex();
054:
055: /**
056: * Set the index into the constant pool of the name of the field.
057: *
058: * @param index
059: * The index into the constant pool of the name of the field.
060: */
061: public void setNameIndex(int index);
062:
063: /**
064: * Set the index into the constant pool of the type of the field.
065: *
066: * @param index
067: * The index into the constant pool of the type of the field.
068: */
069: public void setTypeIndex(int index);
070:
071: /**
072: * Set the modifiers of the field. The values correspond to the constants in
073: * the Modifiers class.
074: *
075: * @param modifiers
076: * A bit vector of modifier flags for the field.
077: * @see Modifiers
078: */
079: public void setModifiers(int modifiers);
080:
081: /**
082: * Get the modifiers of the field. The values correspond to the constants in
083: * the Modifiers class.
084: *
085: * @return A bit vector of modifier flags for the field.
086: * @see Modifiers
087: */
088: public int modifiers();
089:
090: /**
091: * Get the index into the constant pool of the field's constant value, if
092: * any. Returns 0 if the field does not have a constant value.
093: *
094: * @see ClassInfo#constants
095: */
096: public int constantValue();
097:
098: /**
099: * Set the index into the constant pool of the field's constant value.
100: *
101: * @see ClassInfo#constants
102: */
103: public void setConstantValue(int index);
104: }
|