|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Method
Class that represents a Java method in a WebApp.
Field Summary |
---|
Fields inherited from interface com.bowstreet.webapp.WebAppObject |
---|
ALWAYS_VISIBLE, INFORMATION_PROPERTY, NEVER_VISIBLE, SOMETIMES_VISIBLE |
Method Summary | |
---|---|
void |
addArgument(java.lang.String name,
java.lang.String type)
Adds an input argument |
void |
addImport(java.lang.String importName)
Adds an import statement |
void |
addLine(java.lang.String line)
Helper method to add a line to the method body. |
void |
addThrows(java.lang.String name)
Adds to the list of exceptions that are thrown by the method. |
java.util.Iterator |
getArguments()
Gets list of arguments and their types. |
java.lang.String |
getBody()
Get Java body for method. |
java.util.Iterator |
getImports()
Gets list of import statements |
java.lang.String |
getModifier()
Gets the method modifier. |
java.lang.String |
getReturnType()
Gets return type |
java.lang.String |
getSchemaPath()
Get schemaPath associated with a method that returns IXml (null if not XML) |
java.util.Iterator |
getThrows()
Gets an Iterator of the exceptions that are thrown by the method. |
boolean |
isInterface()
Gets if this Method is on an interface. |
void |
setBody(java.lang.String body)
Sets Java body |
void |
setInterface(boolean isInterface)
Sets if this Method is on an interface. |
void |
setModifier(java.lang.String modifier)
Sets the method modifier. |
void |
setReturnType(java.lang.String type)
Sets return type |
void |
setSchemaPath(java.lang.String schemaPath)
Set the schemaPath for a method that returns IXml. |
Methods inherited from interface com.bowstreet.webapp.WebAppObject |
---|
clone, getBuilderCall, getName, getProperties, getProperty, getVisibility, isHidden, putProperty, setBuilderCall, setHidden, setName, setVisibility |
Methods inherited from interface com.bowstreet.util.IExemplar |
---|
newInstance |
Methods inherited from interface com.bowstreet.webapp.ClassItem |
---|
getComment, isGenerated, setComment, setGenerated, write |
Method Detail |
---|
void addArgument(java.lang.String name, java.lang.String type)
name
- Name of argumenttype
- Classname/type of argumentAdd a String argument method.addArgument("messageText", "String");
void addImport(java.lang.String importName)
importName
- Name of class or package to import.void addLine(java.lang.String line)
line
- The lide to add to the method body.void addThrows(java.lang.String name)
name
- The name of the exceptionjava.util.Iterator getArguments()
java.lang.String getBody()
java.util.Iterator getImports()
java.lang.String getModifier()
getModifier
in interface ClassItem
java.lang.String getReturnType()
java.lang.String getSchemaPath()
java.util.Iterator getThrows()
boolean isInterface()
void setBody(java.lang.String body)
body
- Java method bodyCreate a method that simply returns an argument value: Method method = webApp.addMethod("sampleMethod"); method.setReturnType("Object"); method.addArgument("dataSource", "Object"); method.setBody("{\nreturn dataSource;\n}");
void setInterface(boolean isInterface)
isInterface
- true if this is an interface method, else false.void setModifier(java.lang.String modifier)
modifier
- The method modifier.void setReturnType(java.lang.String type)
type
- Java type returned by methodmethod.setReturnType("Object");
void setSchemaPath(java.lang.String schemaPath)
schemaPath
- string represenation (eg, "
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |