public class ClassInitializer extends JavaDeclaration implements MemberDeclaration, StatementContainer
Modifier and Type | Field and Description |
---|---|
protected StatementBlock |
body |
modArray
Constructor and Description |
---|
ClassInitializer() |
ClassInitializer(ExtList children)
Class initializer.
|
ClassInitializer(Static modifier,
StatementBlock body) |
Modifier and Type | Method and Description |
---|---|
StatementBlock |
getBody() |
ProgramElement |
getChildAt(int index)
Returns the child at the specified index in this node's "virtual"
child array
|
int |
getChildCount()
Returns the number of children of this node.
|
SourceElement |
getLastElement()
Finds the source element that occurs last in the source.
|
Statement |
getStatementAt(int index) |
int |
getStatementCount()
Get the number of statements in this container.
|
boolean |
isBinary()
A binary class initializer does not occur.
|
boolean |
isPrivate()
Initializers are never private (at least not explicitly).
|
boolean |
isProtected()
Initializers are never protected.
|
boolean |
isPublic()
Initializers are never public.
|
boolean |
isStatic()
Test whether the declaration is static.
|
boolean |
isStrictFp()
Initializers are never strictfp.
|
void |
prettyPrint(PrettyPrinter p)
Pretty printing the source element.
|
void |
visit(Visitor v)
calls the corresponding method of a visitor in order to
perform some action/transformation on this element
|
getModifiers, getStateCount, getVisibilityModifier, isAbstract, isFinal, isGhost, isModel, isNative, isSynchronized, isTransient, isVolatile
compatibleBlockSize, computeHashCode, equals, equalsModRenaming, getArrayPos, match, matchChildren
getComments, hashCode, prettyPrintMain, reuseSignature
getEndPosition, getFirstElement, getFirstElementIncludingBlocks, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getModifiers
getComments, match
equalsModRenaming, getEndPosition, getFirstElement, getFirstElementIncludingBlocks, getPositionInfo, getRelativePosition, getStartPosition
protected final StatementBlock body
public ClassInitializer()
public ClassInitializer(Static modifier, StatementBlock body)
public ClassInitializer(ExtList children)
children
- list with all children. May include: a
StatementBlock (taken as body of the ClassInitialiyer),
several Modifier (taken as modifiers of the declaration), a Commentpublic StatementBlock getBody()
public int getStatementCount()
StatementContainer
getStatementCount
in interface StatementContainer
public Statement getStatementAt(int index)
getStatementAt
in interface StatementContainer
public int getChildCount()
NonTerminalProgramElement
getChildCount
in interface NonTerminalProgramElement
public ProgramElement getChildAt(int index)
getChildAt
in interface NonTerminalProgramElement
index
- an index into this node's "virtual" child arrayjava.lang.ArrayIndexOutOfBoundsException
- if index is out
of boundspublic boolean isBinary()
public boolean isPublic()
isPublic
in interface MemberDeclaration
isPublic
in class JavaDeclaration
public boolean isProtected()
isProtected
in interface MemberDeclaration
isProtected
in class JavaDeclaration
public boolean isPrivate()
isPrivate
in interface MemberDeclaration
isPrivate
in class JavaDeclaration
public boolean isStrictFp()
isStrictFp
in interface MemberDeclaration
isStrictFp
in class JavaDeclaration
public boolean isStatic()
isStatic
in interface MemberDeclaration
isStatic
in class JavaDeclaration
public SourceElement getLastElement()
JavaSourceElement
getLastElement
in interface SourceElement
getLastElement
in class JavaSourceElement
JavaSourceElement.toSource()
,
JavaSourceElement.getEndPosition()
public void visit(Visitor v)
visit
in interface SourceElement
v
- the Visitorpublic void prettyPrint(PrettyPrinter p) throws java.io.IOException
JavaSourceElement
prettyPrint
in interface SourceElement
prettyPrint
in class JavaProgramElement
p
- a pretty printer.java.io.IOException
- occasionally thrown.