xdoclet.modules.mockobjects
Class MockObjectTagsHandler
java.lang.Object
xdoclet.template.TemplateTagHandler
xdoclet.XDocletTagSupport
xdoclet.tagshandler.AbstractProgramElementTagsHandler
xdoclet.tagshandler.ParameterTagsHandler
xdoclet.modules.mockobjects.MockObjectTagsHandler
public class MockObjectTagsHandler
extends xdoclet.tagshandler.ParameterTagsHandler
Tagshandler for mockobject.
String | currentException(Properties attributes) - Returns the current exception.
|
void | forAllExceptions(String template, Properties attributes) - Iterates over all the exceptions for the current method.
|
static String | getMockClassFor(XClass clazz) - Returns the fully classified name of the mock class from the specified class.
|
protected static String | getMockClassPattern() - Returns the pattern to be used for deciding the name of the class to be generated.
|
protected String | getTagParam(String tagName, String paramName, String defaultValue)
|
void | ifThrowsException(String template, Properties attributes) - Processes the text inside the tag if an exception is thrown by the current exception.
|
String | mockClass() - Returns the mock classname for the current class.
|
String | parameterTypeList(Properties attributes) - Iterates over all parameters in current method and returns a string containing the types of all those parameters.
|
String | uniqueMethodName(Properties attributes) - Returns a String with the current method using the supplied template as a boilerplate.
|
String | uniqueMethodNameAndParam(Properties attributes) - Returns a String with the current method concat with the param types using the supplied template as a
boilerplate.
|
String | unwrap(Properties props) - Tag for unwrapping a simple type out of its object counterpart.
|
String | wrap(Properties props) - Tag for wrapping a simple type in its object counterpart.
|
checkForWrap , currentToken , exceptionList , firstSentenceDescriptionOfCurrentMember , forAllMemberTagTokens , forAllMemberTags , forAllMembers , getAllClasses , getClassNameFor , getFullClassNameFor , getFullSuperclassNameFor , getIndentChars , getXExecutableMemberForMemberName , getXExecutableMemberForMemberName , hasExecutableMember , hasExecutableMember_OLD , makeCopyOfArray , matchValue , memberComment , setMatchValue , skipToken |
delimit , expandClassName , generate , getCurrentClass , getCurrentClassTag , getCurrentConstructor , getCurrentField , getCurrentFieldTag , getCurrentMethod , getCurrentMethodTag , getCurrentPackage , getDocletContext , getEngine , getExpandedDelimitedTagValue , getTagValue , getTagValue , getTagValue , hasHavingClassTag , hasTag , isTagValueEqual , mandatoryParamNotFound , mandatoryTemplateTagParamNotFound , modifiers , popCurrentClass , pushCurrentClass , setCurrentClass , setCurrentClassTag , setCurrentConstructor , setCurrentField , setCurrentFieldTag , setCurrentMethod , setCurrentMethodTag , setCurrentPackage |
currentException
public String currentException(Properties attributes)
throws xdoclet.XDocletException
Returns the current exception.
attributes
- the parameters for the tag; not used.
xdoclet.XDocletException
- not thrown by our code; might be thrown from getCurrentClass
.
forAllExceptions
public void forAllExceptions(String template,
Properties attributes)
throws xdoclet.XDocletException
Iterates over all the exceptions for the current method.
template
- the text inside the tag that should be processed.attributes
- the parameters for the tag; not used.
xdoclet.XDocletException
- not thrown by our code; might be thrown from generate
.
getMockClassFor
public static String getMockClassFor(XClass clazz)
throws xdoclet.XDocletException
Returns the fully classified name of the mock class from the specified class. It will do package substition (if
it is specified) and use the class pattern specified to generate the class name.
clazz
- the class to generate a mock classname for.
- String the fully classified name of the mock class.
xdoclet.XDocletException
-
getMockClassPattern
protected static String getMockClassPattern()
Returns the pattern to be used for deciding the name of the class to be generated. This is retrieved from the
MockObjectSubTask instance.
- String The pattern to be used for deciding the name of the class to be generated
getTagParam
protected String getTagParam(String tagName,
String paramName,
String defaultValue)
throws xdoclet.XDocletException
ifThrowsException
public void ifThrowsException(String template,
Properties attributes)
throws xdoclet.XDocletException
Processes the text inside the tag if an exception is thrown by the current exception.
template
- the text inside the tag that should be processed.attributes
- the parameters for the tag; not used.
xdoclet.XDocletException
- not thrown by our code; might be thrown from generate
.
mockClass
public String mockClass()
throws xdoclet.XDocletException
Returns the mock classname for the current class.
- String the fully classified name of the mock class.
xdoclet.XDocletException
-
parameterTypeList
public String parameterTypeList(Properties attributes)
throws xdoclet.XDocletException
Iterates over all parameters in current method and returns a string containing the types of all those parameters.
attributes
- The attributes of the template tag
- a string containing the types of all the parameters for the current method.
xdoclet.XDocletException
-
uniqueMethodName
public String uniqueMethodName(Properties attributes)
throws xdoclet.XDocletException
Returns a String with the current method using the supplied template as a boilerplate.
attributes
- holds the parameters for the tag: template
- String the current method concat with the param types using the supplied template as a
boilerplate.
xdoclet.XDocletException
- not thrown.
uniqueMethodNameAndParam
public String uniqueMethodNameAndParam(Properties attributes)
throws xdoclet.XDocletException
Returns a String with the current method concat with the param types using the supplied template as a
boilerplate.
attributes
- holds the parameters for the tag: template
- String the current method concat with the param types using the supplied template as a
boilerplate.
xdoclet.XDocletException
- not thrown.
unwrap
public String unwrap(Properties props)
Tag for unwrapping a simple type out of its object counterpart.
props
- holds the parameters for the tag: name & type
- code for unwrapping a simple type out of its object counterpart.
wrap
public String wrap(Properties props)
Tag for wrapping a simple type in its object counterpart.
props
- holds the parameters for the tag: name & type
- code for wrapping a simple type in its object counterpart.