|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ashridgetech.jamda.code.ClassWriter.MethodDetails
Collects the details of a method in the code. Contains only set
methods - the protected fields may be accessed by ClassWriter
ClassWriter.beginMethod(com.ashridgetech.jamda.code.ClassWriter.MethodDetails)
Field Summary | |
protected java.lang.String |
description
|
protected java.util.List |
exceptionComments
|
protected java.util.List |
exceptionNames
|
protected boolean |
isForInterface
|
protected int |
modifiers
|
protected java.lang.String |
name
|
protected java.util.List |
paramComments
|
protected java.util.List |
paramNames
|
protected java.util.List |
paramTypes
|
protected java.lang.String |
returnComment
|
protected java.lang.String |
returnTypeName
|
protected java.util.List |
tags
|
Constructor Summary | |
ClassWriter.MethodDetails(java.lang.String name,
boolean isForInterface)
Create a MethodDetails with the given name,
modifiers of PUBLIC, void return type and no parameters. |
Method Summary | |
ClassWriter.MethodDetails |
addModifiers(int modifiers)
Add modifiers to the existing modifiers. |
ClassWriter.MethodDetails |
addTag(java.lang.String tag)
Set an extra tag for the method Javadoc. |
ClassWriter.MethodDetails |
addThrows(java.lang.String exceptionName)
Add the name of an exception thrown by this method, without a comment. |
ClassWriter.MethodDetails |
addThrows(java.lang.String exceptionName,
java.lang.String exceptionComment)
Add the name of an exception thrown by this method. |
ClassWriter.MethodDetails |
description(java.lang.String comment)
Set the method description. |
int |
getModifiers()
Get the existing modifiers. |
protected boolean |
hasDoc()
Indicates whether this method has any documentation which needs a Javadoc comment. |
ClassWriter.MethodDetails |
param(java.lang.String type,
java.lang.String name)
Add a parameter with no description. |
ClassWriter.MethodDetails |
param(java.lang.String type,
java.lang.String name,
java.lang.String comment)
Add a parameter. |
ClassWriter.MethodDetails |
removeAbstractModifier()
Ensure this MethodDetails does not have the
Modifier.ABSTRACT modifier. |
ClassWriter.MethodDetails |
returns(java.lang.String returnTypeName)
Set the return type name. |
ClassWriter.MethodDetails |
returns(java.lang.String returnTypeName,
java.lang.String comment)
Set the return type name. |
ClassWriter.MethodDetails |
setModifiers(int modifiers)
Replace the existing modifiers with modifiers . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String name
protected boolean isForInterface
protected java.lang.String returnTypeName
protected java.lang.String returnComment
protected int modifiers
protected java.lang.String description
protected java.util.List exceptionNames
protected java.util.List exceptionComments
protected java.util.List paramTypes
protected java.util.List paramNames
protected java.util.List paramComments
protected java.util.List tags
Constructor Detail |
public ClassWriter.MethodDetails(java.lang.String name, boolean isForInterface)
MethodDetails
with the given name,
modifiers of PUBLIC, void return type and no parameters.
name
- the method nameisForInterface
- true if this method is in an interfaceMethod Detail |
protected boolean hasDoc()
public ClassWriter.MethodDetails returns(java.lang.String returnTypeName)
returnTypeName
- the name of the return type
- may be null for no return type
public ClassWriter.MethodDetails returns(java.lang.String returnTypeName, java.lang.String comment)
returnTypeName
- the name of the return type
- may be null for no return typecomment
- the description of the return type
public int getModifiers()
public ClassWriter.MethodDetails setModifiers(int modifiers)
modifiers
.
modifiers
- the new modifiers.
public ClassWriter.MethodDetails addModifiers(int modifiers)
modifiers
to the existing modifiers.
modifiers
- the modifiers to OR with the existing ones.
public ClassWriter.MethodDetails removeAbstractModifier()
MethodDetails
does not have the
Modifier.ABSTRACT
modifier.
public ClassWriter.MethodDetails description(java.lang.String comment)
comment
- the description of the method - may be null
public ClassWriter.MethodDetails addThrows(java.lang.String exceptionName)
exceptionName
- the name of the exception class
public ClassWriter.MethodDetails addThrows(java.lang.String exceptionName, java.lang.String exceptionComment)
exceptionName
- the name of the exception classexceptionComment
- the reason for throwing the exception class
- may be null if no @throws tag required
public ClassWriter.MethodDetails addTag(java.lang.String tag)
returns(java.lang.String)
and param(java.lang.String, java.lang.String, java.lang.String)
.
tag
- the full text of the extra tag, such as
"@see Widget#grumble"
public ClassWriter.MethodDetails param(java.lang.String type, java.lang.String name, java.lang.String comment)
type
- the name of the type of this parameter - must not be nullname
- the name of this parameter - must not be nullcomment
- the description of this parameter - may be null
if there is no comment
public ClassWriter.MethodDetails param(java.lang.String type, java.lang.String name)
type
- the name of the type of this parameter - must not be nullname
- the name of this parameter - must not be null
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |