org.apache.ws.jaxme.js

Class AbstractJavaMethod

Implemented Interfaces:
ConditionalIndentationEngine, IndentationEngine
Known Direct Subclasses:
JavaConstructor, JavaMethod

public abstract class AbstractJavaMethod
extends ConditionalIndentationJavaSourceObject

Base class of methods, constructors, and the like.

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.ws.jaxme.js.ConditionalIndentationJavaSourceObject

ConditionalIndentationJavaSourceObject.LJFImpl, ConditionalIndentationJavaSourceObject.LoopVariable

Fields inherited from interface org.apache.ws.jaxme.js.IndentationEngine

NOTHING

Constructor Summary

AbstractJavaMethod(String pName, JavaQName pType, JavaSource.Protection pProtection)

Method Summary

Parameter
addParam(Class p, String v)
Adds a parameter that this method takes.
Parameter
addParam(JavaQName pType, String pName)
Adds a parameter that this method takes.
Parameter
addParam(Parameter pParam)
Adds a parameter that this method takes.
void
addThrows(Class e)
Adds an exception to this methods list of exceptions.
void
addThrows(JavaQName e)
Adds an exception to this methods list of exceptions.
void
clearParams()
Clears the list of parameters.
void
clearThrows()
Clears the list of thrown exceptions.
JavaQName[]
getExceptions()
Returns the list of exceptions thrown by this method.
String[]
getParamNames()
Returns a list of the parameter names that this method takes.
JavaQName[]
getParamTypes()
Returns an array of the parameter types that this method takes.
Parameter[]
getParams()
Returns the list of parameters that this method takes.
boolean
isThrowing(Class e)
Returns whether the method is throwing the given exception.
boolean
isThrowing(JavaQName e)
Returns whether the method is throwing the given exception.
void
removeThrows(Class exc)
Removes an exception from this methods list of exceptions, if it is declared to be thrown.
void
removeThrows(JavaQName exc)
Removes an exception from this methods list of exceptions, if it is declared to be thrown.

Methods inherited from class org.apache.ws.jaxme.js.ConditionalIndentationJavaSourceObject

addBreak, addCase, addCase, addCase, addCase, addCase, addCase, addCase, addCase, addCase, addCase, addCase, addCase, addCase, addCase, addCase, addCase, addCatch, addCatch, addCatch, addCatch, addDefault, addElse, addElseIf, addElseIf, addElseIf, addElseIf, addElseIf, addElseIf, addElseIf, addElseIf, addElseIf, addElseIf, addElseIf, addElseIf, addElseIf, addElseIf, addElseIf, addElseIf, addEndFor, addEndIf, addEndSwitch, addEndTry, addEndWhile, addFinally, addFor, addFor, addFor, addFor, addFor, addFor, addFor, addFor, addFor, addFor, addFor, addFor, addFor, addFor, addFor, addFor, addForArray, addForArray, addForArray, addForArray, addForArray, addForArray, addForCollection, addForCollection, addForCollection, addForCollection, addForCollection, addForCollection, addForEnumeration, addForEnumeration, addForEnumeration, addForEnumeration, addForEnumeration, addForEnumeration, addForIterator, addForIterator, addForIterator, addForIterator, addForIterator, addForIterator, addForList, addForList, addForList, addForList, addForList, addForList, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addIf, addSwitch, addSwitch, addSwitch, addSwitch, addSwitch, addSwitch, addSwitch, addSwitch, addSwitch, addSwitch, addSwitch, addSwitch, addSwitch, addSwitch, addSwitch, addSwitch, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addThrowNew, addTry, addWhile, addWhile, addWhile, addWhile, addWhile, addWhile, addWhile, addWhile, addWhile, addWhile, addWhile, addWhile, addWhile, addWhile, addWhile, addWhile, addWhileIterator, getLocalVariableName, newJavaField, newJavaField, newJavaField, newJavaField, write, write, writeHeader

Methods inherited from class org.apache.ws.jaxme.js.JavaSourceObject

getComment, getJavaSource, getName, getProtection, getType, isAbstract, isFinal, isStatic, newComment, setAbstract, setFinal, setJavaSource, setName, setProtection, setStatic, setType

Methods inherited from class org.apache.ws.jaxme.js.IndentationEngineImpl

addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, asString, checkNulls, clear, getLevel, getLines, getLines, getPlaceHolder, indent, isEmpty, moveToBottom, moveToTop, newPlaceHolder, removePlaceHolder, setLevel, unindent, write, write

Constructor Details

AbstractJavaMethod

protected AbstractJavaMethod(String pName,
                             JavaQName pType,
                             JavaSource.Protection pProtection)

Method Details

addParam

public Parameter addParam(Class p,
                          String v)
Adds a parameter that this method takes.
Returns:
An object to use for referencing the parameter inside the method.
See Also:
getParams()

addParam

public Parameter addParam(JavaQName pType,
                          String pName)
Adds a parameter that this method takes.
Returns:
An object to use for referencing the parameter inside the method.
See Also:
getParams()

addParam

public Parameter addParam(Parameter pParam)
Adds a parameter that this method takes.
Returns:
An object to use for referencing the parameter inside the method.
See Also:
getParams()

addThrows

public void addThrows(Class e)
Adds an exception to this methods list of exceptions.

addThrows

public void addThrows(JavaQName e)
Adds an exception to this methods list of exceptions.

clearParams

public void clearParams()
Clears the list of parameters.

clearThrows

public void clearThrows()
Clears the list of thrown exceptions.

getExceptions

public JavaQName[] getExceptions()
Returns the list of exceptions thrown by this method.

getParamNames

public String[] getParamNames()
Returns a list of the parameter names that this method takes. Any element in the list is an instance of java.lang.String.
Returns:
the list of parameter names

getParamTypes

public JavaQName[] getParamTypes()
Returns an array of the parameter types that this method takes. This array can be used for JavaSource.getMethod() or JavaSource.getConstructor().
Returns:
the list of parameter types

getParams

public Parameter[] getParams()
Returns the list of parameters that this method takes. Any element in the list is an instance of Parameter.
Returns:
the list of parameters

isThrowing

public boolean isThrowing(Class e)
Returns whether the method is throwing the given exception. Note that this method doesn't care for inheritance. For example, if the method declares to be throwing an java.net.MalformedURLException, then the value isThrowing(java.io.IOException.class) is still false.

isThrowing

public boolean isThrowing(JavaQName e)
Returns whether the method is throwing the given exception. Note that this method doesn't care for inheritance. For example, if the method declares to be throwing an java.net.MalformedURLException, then the value isThrowing(java.io.IOException.class) is still false.

removeThrows

public void removeThrows(Class exc)
Removes an exception from this methods list of exceptions, if it is declared to be thrown.
Parameters:
exc - the exception to be removed

removeThrows

public void removeThrows(JavaQName exc)
Removes an exception from this methods list of exceptions, if it is declared to be thrown.
Parameters:
exc - the exception to be removed