001: /*******************************************************************************
002: * Copyright (c) 2000, 2006 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.jdt.core.util;
011:
012: /**
013: * Description of a field info as described in the JVM
014: * specifications.
015: *
016: * This interface may be implemented by clients.
017: *
018: * @since 2.0
019: */
020: public interface IFieldInfo {
021:
022: /**
023: * Answer back the constant value attribute of this field info if specified,
024: * null otherwise.
025: *
026: * @return the constant value attribute of this field info if specified,
027: * null otherwise
028: */
029: IConstantValueAttribute getConstantValueAttribute();
030:
031: /**
032: * Answer back the access flag of this field info.
033: *
034: * @return the access flag of this field info
035: */
036: int getAccessFlags();
037:
038: /**
039: * Answer back the name of this field info. The name is returned as
040: * specified in the JVM specifications.
041: *
042: * @return the name of this field info. The name is returned as
043: * specified in the JVM specifications
044: */
045: char[] getName();
046:
047: /**
048: * Answer back the name index of this field info.
049: *
050: * @return the name index of this field info
051: */
052: int getNameIndex();
053:
054: /**
055: * Answer back the descriptor of this field info. The descriptor is returned as
056: * specified in the JVM specifications.
057: *
058: * @return the descriptor of this field info. The descriptor is returned as
059: * specified in the JVM specifications
060: */
061: char[] getDescriptor();
062:
063: /**
064: * Answer back the descriptor index of this field info.
065: *
066: * @return the descriptor index of this field info
067: */
068: int getDescriptorIndex();
069:
070: /**
071: * Return true if the field info has a constant value attribute, false otherwise.
072: *
073: * @return true if the field info has a constant value attribute, false otherwise
074: */
075: boolean hasConstantValueAttribute();
076:
077: /**
078: * Return true if the field info is synthetic according to the JVM specification, false otherwise.
079: * <p>Note that prior to JDK 1.5, synthetic fields were always marked using
080: * an attribute; with 1.5, synthetic fields can also be marked using
081: * the {@link IModifierConstants#ACC_SYNTHETIC} flag.
082: * </p>
083: *
084: * @return true if the field info is synthetic according to the JVM specification, false otherwise
085: */
086: boolean isSynthetic();
087:
088: /**
089: * Return true if the field info has a deprecated attribute, false otherwise.
090: *
091: * @return true if the field info has a deprecated attribute, false otherwise
092: */
093: boolean isDeprecated();
094:
095: /**
096: * Answer back the attribute number of the field info.
097: *
098: * @return the attribute number of the field info
099: */
100: int getAttributeCount();
101:
102: /**
103: * Answer back the collection of all attributes of the field info. It
104: * includes SyntheticAttribute, ConstantValueAttributes, etc.
105: * Returns an empty collection if none.
106: *
107: * @return the collection of all attributes of the field info. It
108: * includes SyntheticAttribute, ConstantValueAttributes, etc.
109: * Returns an empty collection if none
110: */
111: IClassFileAttribute[] getAttributes();
112: }
|