站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 5.5.1

ConstructorElement (NetBeans Java Hierarchy API) - NetBeans API Javadoc 5.5.1

org.openide.src 1.8.31

org.openide.src
Class ConstructorElement

java.lang.Object
  extended by org.openide.src.Element
      extended by org.openide.src.MemberElement
          extended by org.openide.src.ConstructorElement
All Implemented Interfaces:
Serializable, Cloneable, Node.Cookie, ElementProperties
Direct Known Subclasses:
MethodElement

public class ConstructorElement
extends MemberElement

Describes the constructor of a class.

See Also:
Serialized Form

Nested Class Summary
static interface ConstructorElement.Impl
          Implementation of constructors.
static class ConstructorElement.Key
          Serves as a key for constructor elements.
 
Nested classes/interfaces inherited from class org.openide.src.Element
Element.Impl2
 
Field Summary
 
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
ConstructorElement()
          Create a constructor with an in-memory implementation.
ConstructorElement(ConstructorElement.Impl impl, ClassElement clazz)
          Create a constructor.
 
Method Summary
 Object clone()
          Clone the constructor.
 String getBody()
          Get the body of the constructor.
 Identifier[] getExceptions()
          Get the thrown exceptions.
 JavaDoc.Method getJavaDoc()
          Get this constructor's documentation.
 int getModifiersMask()
          Get the permitted modifiers for this type of element.
 MethodParameter[] getParameters()
          Get the method parameters.
 void print(ElementPrinter printer)
          Print this element (and all its subelements) into an element printer.
 void setBody(String s)
          Set the body of the constructor.
 void setExceptions(Identifier[] exceptions)
          Set the array of thrown exceptions.
 void setParameters(MethodParameter[] params)
          Set the method parameters.
 
Methods inherited from class org.openide.src.MemberElement
getDeclaringClass, getModifiers, getName, setModifiers, setName
 
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

ConstructorElement

public ConstructorElement()
Create a constructor with an in-memory implementation.


ConstructorElement

public ConstructorElement(ConstructorElement.Impl impl,
                          ClassElement clazz)
Create a constructor.

Parameters:
impl - implementation of functionality
clazz - declaring class, or null
Method Detail

clone

public Object clone()
Clone the constructor.

Overrides:
clone in class MemberElement
Returns:
a new constructor that has same values as the original, but is represented in memory

getModifiersMask

public int getModifiersMask()
Description copied from class: MemberElement
Get the permitted modifiers for this type of element.

Specified by:
getModifiersMask in class MemberElement
Returns:
disjunction of constants from java.lang.reflect.Modifier

getParameters

public final MethodParameter[] getParameters()
Get the method parameters.

Returns:
the parameters

setParameters

public final void setParameters(MethodParameter[] params)
                         throws SourceException
Set the method parameters.

Parameters:
params - the new parameters
Throws:
SourceException - if impossible

getExceptions

public final Identifier[] getExceptions()
Get the thrown exceptions.

Returns:
the exceptions, by name

setExceptions

public final void setExceptions(Identifier[] exceptions)
                         throws SourceException
Set the array of thrown exceptions.

Parameters:
exceptions - the new exceptions to throw, by name
Throws:
SourceException - if impossible

setBody

public final void setBody(String s)
                   throws SourceException
Set the body of the constructor.

Parameters:
s - the new body (may be null for methods)
Throws:
SourceException - if impossible
See Also:
getBody()

getBody

public final String getBody()
Get the body of the constructor. If this is actually a MethodElement, the body may be null when the method is abstract. A body consisting of an empty string, however, is just a concrete but empty body.

Returns:
the body (maye be null for methods)

getJavaDoc

public final JavaDoc.Method getJavaDoc()
Get this constructor's documentation.

Returns:
the JavaDoc

print

public void print(ElementPrinter printer)
           throws ElementPrinterInterruptException
Description copied from class: Element
Print this element (and all its subelements) into an element printer.

Specified by:
print in class Element
Parameters:
printer - the element printer
Throws:
ElementPrinterInterruptException - if the printer canceled the printing

org.openide.src 1.8.31

Built on March 26 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.