| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A function in source code.
This interface provides a set of methods for accessing and changing this function's data such as its body, parameters list and return type.
Note that this inteface is extended by SciOperation interface,
inheriting all its methods.
| Method Summary | |
boolean | canSetBody(SciCodeBlock body)Checks whether is it possible to set the body of this function to the specified code block value. |
boolean | canSetReturnType(SciType type)Chechs whether the return type for this function can be set to the specified value. |
SciCodeBlock | getBody()Returns code block with the body of this function. |
SciParameterList | getParameterList()Returns a container with the parameters of this function. |
SciType | getReturnType()Gets the return type for this function. |
SciThrowList | getThrowList()Returns a container of exceptions which can be thrown by this function. |
void | setBody(SciCodeBlock body)Sets the body of this function to the specified code block value. |
void | setReturnType(SciType type)Sets the return type for this function to the specified value. |
| Methods inherited from interface com.togethersoft.openapi.sci.SciElement |
accept, canSetName, canSetProperty, getDeclarationText, getName, getQualifiedName, getTagList, getUniqueName, hasProperty, isDeleted, isPropertyReadable, isPropertyWritable, setName, setProperty, visitReferences, visitReferences |
| Methods inherited from interface com.togethersoft.openapi.sci.SciObject |
canCut, canDelete, canReplace, copy, cut, delete, getContainingFile, getContainingScope, getLanguage, getPositions, getText, getUserProperty, isReadOnly, replace, setUserProperty |
| Method Detail |
public boolean canSetBody(SciCodeBlock body)
SciCodeBlock containing a body for this function. Usually, it is
created using the SciGenericFactory.newCodeBlock
or SciFactory.newCodeBlock methods.true if the specified code block value can be set as a body for this functionpublic boolean canSetReturnType(SciType type)
SciType return typetrue if the specified return type for this function can be set to
the specified value, false otherwisepublic SciCodeBlock getBody()
SciCodeBlock with the body of this functionpublic SciParameterList getParameterList()
SciParameterList which contains SciParameters for this functionpublic SciType getReturnType()
SciType object is used to get a string with the return type object.
For example, for this function represented by someSciFunction
public lava.lang.Object getID(){ return null; }
this line
String typeText = someSciFunction.getReturnType().getText();
will assign typeText the "lava.lang.Object" value.public SciThrowList getThrowList()
SciThrowList which contains SciThrowSpecifiers for this function.public void setBody(SciCodeBlock body)
SciCodeBlock containing a body for this function. Usually, it is
created using the SciGenericFactory.newCodeBlock
or SciFactory.newCodeBlock methods.public void setReturnType(SciType type)
SciType
object representing the return type, than to create a new SciType object.
To do that small trick, get the current return type, and change it using the
setText method.
For example, to change the return type of this operation represented by someSciFunction
from
to
public void String getID(){ return null; }
you should do the following:
public lava.lang.Object getID(){ return null; }
someSciFunction.getReturnType().setText("lava.lang.Object");
SciType return type
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||