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 method 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 IMethodInfo {
021:
022: /**
023: * Answer back the method descriptor of this method info as specified
024: * in the JVM specifications.
025: *
026: * @return the method descriptor of this method info as specified
027: * in the JVM specifications
028: */
029: char[] getDescriptor();
030:
031: /**
032: * Answer back the descriptor index of this method info.
033: *
034: * @return the descriptor index of this method info
035: */
036: int getDescriptorIndex();
037:
038: /**
039: * Answer back the access flags of this method info as specified
040: * in the JVM specifications.
041: *
042: * @return the access flags of this method info as specified
043: * in the JVM specifications
044: */
045: int getAccessFlags();
046:
047: /**
048: * Answer back the name of this method info as specified
049: * in the JVM specifications.
050: *
051: * @return the name of this method info as specified
052: * in the JVM specifications
053: */
054: char[] getName();
055:
056: /**
057: * Answer back the name index of this method info.
058: *
059: * @return the name index of this method info
060: */
061: int getNameIndex();
062:
063: /**
064: * Answer true if this method info represents a <clinit> method,
065: * false otherwise.
066: *
067: * @return true if this method info represents a <clinit> method,
068: * false otherwise
069: */
070: boolean isClinit();
071:
072: /**
073: * Answer true if this method info represents a constructor,
074: * false otherwise.
075: *
076: * @return true if this method info represents a constructor,
077: * false otherwise
078: */
079: boolean isConstructor();
080:
081: /**
082: * Return true if the method info is synthetic according to the JVM specification, false otherwise.
083: * <p>Note that prior to JDK 1.5, synthetic fields were always marked using
084: * an attribute; with 1.5, synthetic fields can also be marked using
085: * the {@link IModifierConstants#ACC_SYNTHETIC} flag.
086: * </p>
087: *
088: * @return true if the method info is synthetic according to the JVM specification, false otherwise
089: */
090: boolean isSynthetic();
091:
092: /**
093: * Answer true if this method info has a deprecated attribute,
094: * false otherwise.
095: *
096: * @return true if this method info has a deprecated attribute,
097: * false otherwise
098: */
099: boolean isDeprecated();
100:
101: /**
102: * Answer the code attribute of this method info, null if none or if the decoding
103: * flag doesn't include METHOD_BODIES.
104: *
105: * @return the code attribute of this method info, null if none or if the decoding
106: * flag doesn't include METHOD_BODIES
107: */
108: ICodeAttribute getCodeAttribute();
109:
110: /**
111: * Answer the exception attribute of this method info, null is none.
112: *
113: * @return the exception attribute of this method info, null is none
114: */
115: IExceptionAttribute getExceptionAttribute();
116:
117: /**
118: * Answer back the attribute number of the method info. It includes the CodeAttribute
119: * if any even if the decoding flags doesn't include METHOD_BODIES.
120: *
121: * @return the attribute number of the method info. It includes the CodeAttribute
122: * if any even if the decoding flags doesn't include METHOD_BODIES
123: */
124: int getAttributeCount();
125:
126: /**
127: * Answer back the collection of all attributes of the method info. It
128: * includes SyntheticAttribute, CodeAttributes, etc. It doesn't include the
129: * CodeAttribute if the decoding flags doesn't include METHOD_BODIES.
130: * Returns an empty collection if none.
131: *
132: * @return the collection of all attributes of the method info. It
133: * includes SyntheticAttribute, CodeAttributes, etc. It doesn't include the
134: * CodeAttribute if the decoding flags doesn't include METHOD_BODIES.
135: * Returns an empty collection if none
136: */
137: IClassFileAttribute[] getAttributes();
138: }
|