org.openide.src
Class MethodElement

java.lang.Object
  |
  +--org.openide.src.Element
        |
        +--org.openide.src.MemberElement
              |
              +--org.openide.src.ConstructorElement
                    |
                    +--org.openide.src.MethodElement
All Implemented Interfaces:
Cloneable, ElementProperties, Node.Cookie, Serializable

public final class MethodElement
extends ConstructorElement

Representation of a method. It extends the constructor representation since all that is added is the return type.

See Also:
Serialized Form

Inner Class Summary
static interface MethodElement.Impl
          Pluggable behavior of the method element.
static class MethodElement.Key
          A key for method elements, for use in hash tables etc.
 
Inner classes inherited from class org.openide.src.ConstructorElement
ConstructorElement.Impl, ConstructorElement.Key
 
Inner classes inherited from class org.openide.src.MemberElement
MemberElement.Impl
 
Inner classes inherited from class org.openide.src.Element
Element.Impl, Element.Impl2
 
Fields inherited from class org.openide.src.Element
impl, impl2
 
Fields inherited from interface org.openide.src.ElementProperties
PROP_ALL_CLASSES, PROP_BODY, PROP_CLASS_OR_INTERFACE, PROP_CLASSES, PROP_CONSTRUCTORS, PROP_EXCEPTIONS, PROP_FIELDS, PROP_IMPORTS, PROP_INIT_VALUE, PROP_INITIALIZERS, PROP_INTERFACES, PROP_JAVADOC, PROP_MEMBERS, PROP_METHODS, PROP_MODIFIERS, PROP_NAME, PROP_PACKAGE, PROP_PARAMETERS, PROP_RETURN, PROP_STATIC, PROP_STATUS, PROP_SUPERCLASS, PROP_TYPE, PROP_VALID
 
Constructor Summary
MethodElement()
          Create a method element held in memory.
MethodElement(MethodElement.Impl impl, ClassElement clazz)
          Create a method element.
 
Method Summary
 Object clone()
          Clone the method.
 int getModifiersMask()
          Get the permitted modifiers for this type of element.
 Type getReturn()
          Get the method's return type.
 void setName(Identifier name)
          Set the name of this member.
 void setReturn(Type ret)
          Set the method's return type.
 
Methods inherited from class org.openide.src.ConstructorElement
getBody, getExceptions, getJavaDoc, getParameters, print, setBody, setExceptions, setParameters
 
Methods inherited from class org.openide.src.MemberElement
getDeclaringClass, getModifiers, getName, setModifiers
 
Methods inherited from class org.openide.src.Element
addPropertyChangeListener, addVetoableChangeListener, getCookie, markCurrent, removePropertyChangeListener, removeVetoableChangeListener, toString, writeReplace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MethodElement

public MethodElement()
Create a method element held in memory.

MethodElement

public MethodElement(MethodElement.Impl impl,
                     ClassElement clazz)
Create a method element.
Parameters:
impl - implementation of functionality
clazz - declaring class, or null
Method Detail

clone

public Object clone()
Clone the method.
Overrides:
clone in class ConstructorElement
Returns:
new method with the same values as the original, but represented in memory

getReturn

public Type getReturn()
Get the method's return type.
Returns:
the return type

setReturn

public void setReturn(Type ret)
               throws SourceException
Set the method's return type.
Parameters:
type - the new type
Throws:
SourceException - if impossible

getModifiersMask

public int getModifiersMask()
Description copied from class: MemberElement
Get the permitted modifiers for this type of element.
Overrides:
getModifiersMask in class ConstructorElement
Following copied from class: org.openide.src.MemberElement
Returns:
disjunction of constants from Modifier

setName

public final void setName(Identifier name)
                   throws SourceException
Set the name of this member.
Overrides:
setName in class MemberElement
Parameters:
name - the name
Throws:
SourceException - if impossible


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.