org.openide.src
Class InitializerElement

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

public final class InitializerElement
extends Element
implements Cloneable

Element which represents an initializer block. This may be a static class initializer, or (as of Java 1.1) a nonstatic initializer (usually used in anonymous inner classes).

See Also:
Serialized Form

Inner Class Summary
static interface InitializerElement.Impl
          Pluggable implementation of initializers.
 
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
InitializerElement()
          Create an initializer represented in memory.
InitializerElement(InitializerElement.Impl impl, ClassElement declaringClass)
          Create an initializer.
 
Method Summary
 Object clone()
          Clone this initializer.
 String getBody()
          Get the body of this initializer.
 ClassElement getDeclaringClass()
          Get the declaring class.
 JavaDoc getJavaDoc()
          Get the class documentation.
 boolean isStatic()
          Test whether this initializer is static.
 void print(ElementPrinter printer)
          Print this element (and all its subelements) into an element printer.
 void setBody(String s)
          Set the body of this initializer.
 void setStatic(boolean stat)
          Set the static flag for this initializer.
 
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

InitializerElement

public InitializerElement()
Create an initializer represented in memory.

InitializerElement

public InitializerElement(InitializerElement.Impl impl,
                          ClassElement declaringClass)
Create an initializer.
Parameters:
impl - the pluggable implementation
declaringClass - the class containing it, or null
Method Detail

clone

public Object clone()
Clone this initializer.
Overrides:
clone in class Object
Returns:
a new initializer with the same structure, but represented in memory

setStatic

public void setStatic(boolean stat)
               throws SourceException
Set the static flag for this initializer.
Parameters:
stat - true to make static
Throws:
SourceException - if impossible

isStatic

public boolean isStatic()
Test whether this initializer is static.
Returns:
true if it is

setBody

public void setBody(String s)
             throws SourceException
Set the body of this initializer.
Parameters:
s - the new body
Throws:
SourceException - if impossible

getBody

public String getBody()
Get the body of this initializer.
Returns:
the string representing the body

getJavaDoc

public JavaDoc getJavaDoc()
Get the class documentation.
Returns:
the JavaDoc

getDeclaringClass

public final ClassElement getDeclaringClass()
Get the declaring class.
Returns:
the class that owns this initializer, or null

print

public void print(ElementPrinter printer)
           throws ElementPrinterInterruptException
Description copied from class: Element
Print this element (and all its subelements) into an element printer.
Overrides:
print in class Element
Following copied from class: org.openide.src.Element
Parameters:
printer - the element printer
Throws:
ElementPrinterInterruptException - if the printer canceled the printing


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