|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface represents a code block. See section 14.2 in the Java Language Specification for more information.
Method Summary | |
JotAssignment |
addAssignment(JotMarker marker,
boolean before,
java.lang.String variableName,
java.lang.String value)
Creates a JotAssignment object and adds it to the code block. |
JotDo |
addDoStatement(JotMarker marker,
boolean before,
java.lang.String condition)
Creates a JotDo object with the given condition and adds it to the code block. |
JotFor |
addForStatement(JotMarker marker,
boolean before,
java.lang.String condition)
Creates a JotFor object and adds it to the code block. |
JotIf |
addIfStatement(JotMarker marker,
boolean before,
java.lang.String condition)
Creates a JotIf object with the given condition and adds it to the code block. |
JotIf |
addIfStatement(JotMarker marker,
boolean before,
java.lang.String condition,
boolean hasElse)
Creates a JotIf object with the given condition and adds it to the code block. |
JotInnerClass |
addInnerClass(JotMarker marker,
boolean before,
java.lang.String name)
Adds an inner class to the code block and returns an instance of JotInnerClass that represents the class. |
JotMethodCall |
addMethodCall(JotMarker marker,
boolean before,
java.lang.String methodName,
java.lang.String parameters)
Creates a JotMethodCall object and adds it to the code block. |
JotReturn |
addReturnStatement(JotMarker marker,
boolean before,
java.lang.String expression)
Creates a JotReturn object with the given expression and adds it to the code block. |
JotStatement |
addStatement(JotMarker marker,
boolean before,
boolean semi,
java.lang.String text)
Creates the appropriate JotStatement object from the specified text. |
JotStatement |
addStatement(JotMarker marker,
boolean before,
java.lang.String text)
Creates the appropriate JotStatement object from the specified text. |
JotTry |
addTryStatement(JotMarker marker,
boolean before,
java.lang.String[] catches,
boolean hasFinally)
Creates a JotTry object and adds it to the code block. |
JotTry |
addTryStatement(JotMarker marker,
boolean before,
java.lang.String type,
java.lang.String varName)
Creates a JotTry object and adds it to the code block. |
JotVariableDeclaration |
addVariableDeclaration(JotMarker marker,
boolean before,
java.lang.String variableType,
java.lang.String variableName)
Creates a JotVariableDeclaration object and adds it to the code block. |
JotWhile |
addWhileStatement(JotMarker marker,
boolean before,
java.lang.String condition)
Creates a JotWhile object with the given condition and adds it to the code block. |
JotAssignment[] |
getAssignments()
Returns an array containing all the assignment expressions in this code block. |
int |
getComparableLocation(JotMarker m)
Returns a value that can be used to determine the order of statements in this code block. |
JotClass[] |
getDeclaredInnerClasses()
Returns an array of JotClass objects reflecting all inner classes defined in this code block. |
JotMethodCall |
getMethodCall(java.lang.String methodName)
Returns the first method call in this code block that matches the specified method name. |
JotMethodCall[] |
getMethodCalls()
Returns an array containing all the method call statements in this code block. |
JotMethodCall[] |
getMethodCalls(java.lang.String methodName)
Returns an array containing all the method call statements in this code block that match the specified method name. |
JotStatement[] |
getStatements()
Returns an array containing all of the statements contained by this code block. |
JotVariableDeclaration |
getVariableDeclaration(java.lang.String name)
Returns the JotVariableDeclaration object that represents the declaration of the specified variable. |
JotVariableDeclaration[] |
getVariableDeclarations()
Returns an array containing all the variable declarations in this block. |
void |
removeAssignment(JotAssignment assignment)
Removes the specified assignment expression from this code block. |
void |
removeInnerClass(JotInnerClass inner)
Removes the specified inner class from the class. |
void |
removeMethodCall(JotMethodCall mc)
Removes the specified method call from this code block. |
void |
removeStatement(JotStatement s)
Removes the specified statement object from this code block. |
void |
removeVariableDeclaration(JotVariableDeclaration declaration)
Removes the specified declaration from this code block. |
Methods inherited from interface com.borland.jbuilder.jot.JotCommentable |
addBlankLine, addComment, getComment, removeComment |
Methods inherited from interface com.borland.jbuilder.jot.JotMarker |
addUserData, getEndPosition, getStartPosition, getUserData |
Methods inherited from interface com.borland.jbuilder.jot.JotStatement |
getCodeBlock |
Methods inherited from interface com.borland.jbuilder.jot.JotSourceElement |
getIndentLevel, getParent, getText, isModified, setModified, setText |
Method Detail |
public JotStatement[] getStatements()
getStatements
in interface JotStatement
public JotStatement addStatement(JotMarker marker, boolean before, java.lang.String text)
marker
is non-null, then the statement will be inserted in the code block either
before or after the marker depending on the value of before
.
marker
- the Jot object relative to which the code is being addedbefore
- controls where, relative to the marker, code will be added.
true
places the statement before the marker false
places the statement after the marker.text
- is the body of the statement being addedpublic JotStatement addStatement(JotMarker marker, boolean before, boolean semi, java.lang.String text)
semi
is true
, then a semicolon will be appending to the end
of the statement. If marker
is non-null, then the statement will be
inserted in the code block either before or after the marker depending on
the value of before
.
marker
- the Jot object relative to which the code is being addedbefore
- controls where, relative to the marker, code will be added.
true
places the statement before the marker false
places the statement after the marker.semi
- controls if a semi-colon is to be placed at the end of the
statement by JOT. true
adds a semi-colon, false
does not.text
- is the body of the statement being addedpublic JotReturn addReturnStatement(JotMarker marker, boolean before, java.lang.String expression)
marker
is non-null, then the statement will be inserted
in the code block either before or after the marker depending on the value
of before
.
marker
- the Jot object relative to which the code is being addedbefore
- controls where, relative to the marker, code will be added.
true
places the statement before the marker false
places the statement after the marker.expression
- is the expression in the return statement. JOT will add
the keyword return
and the trailing semi-colon to the expression.public JotIf addIfStatement(JotMarker marker, boolean before, java.lang.String condition)
marker
is non-null, then the statement will be inserted
in the code block either before or after the marker depending on the value
of before
.
marker
- the Jot object relative to which the code is being addedbefore
- controls where, relative to the marker, code will be added.
true
places the statement before the marker false
places the statement after the marker.condition
- is condition inside the parenthesis of the if
statement.public JotIf addIfStatement(JotMarker marker, boolean before, java.lang.String condition, boolean hasElse)
marker
is non-null, then the statement will be inserted
in the code block either before or after the marker depending on the value
of before
. If hasElse
is true
then
the statement will have an else part.
marker
- the Jot object relative to which the code is being addedbefore
- controls where, relative to the marker, code will be added.
true
places the statement before the marker false
places the statement after the marker.condition
- is condition inside the parenthesis of the if
statement.hasElse
- will generate an empty else
statement if set to true
.public JotDo addDoStatement(JotMarker marker, boolean before, java.lang.String condition)
marker
is non-null, then the statement will be inserted
in the code block either before or after the marker depending on the value
of before
.
marker
- the Jot object relative to which the code is being addedbefore
- controls where, relative to the marker, code will be added.
true
places the statement before the marker false
places the statement after the marker.condition
- is condition in the while
portion of the
do-while
loop.public JotWhile addWhileStatement(JotMarker marker, boolean before, java.lang.String condition)
marker
is non-null, then the statement will be inserted
in the code block either before or after the marker depending on the value
of before
.
marker
- the Jot object relative to which the code is being addedbefore
- controls where, relative to the marker, code will be added.
true
places the statement before the marker false
places the statement after the marker.condition
- is condition for the while
statementpublic JotFor addForStatement(JotMarker marker, boolean before, java.lang.String condition)
condition
. For example, the
condition int i=0; i<n; i++
would create the statement
for (int i=0; i<n; i++) {
}
If marker
is non-null, then the statement will be inserted in the
code block either before or after the marker depending on the value of
before
.
marker
- the Jot object relative to which the code is being addedbefore
- controls where, relative to the marker, code will be added.
true
places the statement before the marker false
places the statement after the marker.condition
- is for the expressions that control the for
statementpublic JotTry addTryStatement(JotMarker marker, boolean before, java.lang.String type, java.lang.String varName)
marker
is non-null, then the statement will be
inserted in the code block either before or after the marker depending on
the value of before
.
marker
- the Jot object relative to which the code is being addedbefore
- controls where, relative to the marker, code will be added.
true
places the statement before the marker false
places the statement after the marker.type
- is the exception being caughtvarName
- is the variable name to be used for the exceptionpublic JotTry addTryStatement(JotMarker marker, boolean before, java.lang.String[] catches, boolean hasFinally)
catches
. If
the length of catches
is 0, then no catch blocks will be added. If
hasFinally
is true
, then a finally block will also be added.
If marker
is non-null, then the statement will be inserted in the
code block either before or after the marker depending on the value of
before
.
marker
- the Jot object relative to which the code is being addedbefore
- controls where, relative to the marker, code will be added.
true
places the statement before the marker false
places the statement after the marker.catches
- is an array of Exceptions to be caughthasFinally
- controls if a finally clause is added. A value of true
will generate a finally clausepublic void removeStatement(JotStatement s)
public JotVariableDeclaration getVariableDeclaration(java.lang.String name)
null
.public JotVariableDeclaration[] getVariableDeclarations()
public JotVariableDeclaration addVariableDeclaration(JotMarker marker, boolean before, java.lang.String variableType, java.lang.String variableName)
marker
is
non-null, then the declaration will be inserted in the code block either
before or after the marker depending on the value of before
.
marker
- the Jot object relative to which the code is being addedbefore
- controls where, relative to the marker, code will be added.
true
places the statement before the marker false
places the statement after the marker.variableType
- The data type for the variable being declared.variableName
- The name to use for the variable being declared.public void removeVariableDeclaration(JotVariableDeclaration declaration)
public JotMethodCall[] getMethodCalls()
public JotMethodCall[] getMethodCalls(java.lang.String methodName)
public JotMethodCall getMethodCall(java.lang.String methodName)
null
.public JotMethodCall addMethodCall(JotMarker marker, boolean before, java.lang.String methodName, java.lang.String parameters)
obj.getClass().getName
. If marker
is non-null, then
the call will be inserted in the code block either before or after the
marker depending on the value of before
.
marker
- the Jot object relative to which the code is being addedbefore
- controls where, relative to the marker, code will be added.
true
places the statement before the marker false
places the statement after the marker.methodName
- The name to use for the method being added.parameters
- The parameter list for the method being added.public void removeMethodCall(JotMethodCall mc)
public JotAssignment[] getAssignments()
public JotAssignment addAssignment(JotMarker marker, boolean before, java.lang.String variableName, java.lang.String value)
marker
is non-null, then the call will be inserted in the code block either before
or after the marker depending on the value of before
.
marker
- the Jot object relative to which the code is being addedbefore
- controls where, relative to the marker, code will be added.
true
places the statement before the marker false
places the statement after the marker.variableName
- The name of the variable being assigned.value
- The value or expression for the RHS of the assignment.public void removeAssignment(JotAssignment assignment)
public JotClass[] getDeclaredInnerClasses()
public JotInnerClass addInnerClass(JotMarker marker, boolean before, java.lang.String name)
marker
- the Jot object relative to which the code is being addedbefore
- controls where, relative to the marker, code will be added.
true
places the statement before the marker false
places the statement after the marker.name
- The name of the inner class.public void removeInnerClass(JotInnerClass inner)
public int getComparableLocation(JotMarker m)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |