<ccid_code>private HtmlInputText txtUsername = new HtmlInputText(); /** * @return 用户名 */ public HtmlInputText getTxtUsername () { return txtUsername; } /** * @param text */ public void setTxtTeaName(HtmlInputText text) { txtTeaName = text; }</ccid_code>
<ccid_code>/** * @javascript.field * name="frmZBAddGlobalPage:txtTeaName" * display-name="用户名" * * @javascript.depend * name="required" * * @return用户名 */ public HtmlInputText getTxtUsername() { return txtUsername; }</ccid_code>
<ccid_code>public javascriptSubTask() { setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE_FILE)); setDestinationFile(GENERATED_FILE_NAME); } public void execute() throws XDocletException { setDtdURL(getClass().getResource(DTD_FILE_NAME_20)); startProcess(); } protected void engineStarted() throws XDocletException { System.out.println( Translator.getString( XDocletMessages.class, XDocletMessages.GENERATING_SOMETHING, new String[] { getDestinationFile()})); }</ccid_code>
<ccid_code>/* * 创建日期 2004-4-26 */ package paradise.xdoclet.modules.javascript; import xdoclet.DocletTask; /** * @author 清风 */ public class javascriptDocletTask extends DocletTask { public javascriptDocletTask() { addSubTask(new javascriptSubTask()); } }</ccid_code>
<ccid_code><target name="javascript" depends="jxdoc_init" description="Generate javascript validation-config"> <javascriptdoclet destdir="${jsp}/javascript"> <fileset dir="${src}"> <include name="**/zaibian/*.java"/> </fileset> </javascriptdoclet> </target></ccid_code>
<ccid_code><XDtClass:forAllClasses> 遍历所有含有标签的类(在ant中指定) <XDtMethod:forAllMethods> 遍历当前类的所有方法 <XDtMethod:ifHasMethodTag tagName="javascript.form"> 如果遍历到的方法中含有指定的标签 <XDtMethod:forAllMethodTags tagName="javascript.depend"> 遍历当前方法的所有标签</ccid_code>
<ccid_code><?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE xdoclet PUBLIC "-//XDoclet Team//DTD XDoclet Tags 1.1//EN" "http://xdoclet.sourceforge.net/dtds/xtags_1_1.dtd"></ccid_code>
<ccid_code><xdoclet> <namespace> <name>javascript</name> <tags> <tag> <level>method</level> <name>javascript.form</name> <usage-description>Form</usage-description> <condition type="method"/> <parameter type="text"> <name>id</name> <usage-description>Form id</usage-description> <mandatory>true</mandatory> </parameter> <parameter type="text"> <name>show-error</name> <usage-description>Form Error Display</usage-description> <mandatory>true</mandatory> </parameter> <parameter type="text"> <name>onfail</name> <usage-description>Form Error Run Custom javascript Function</usage-description> <mandatory>false</mandatory> </parameter> </tag> </tags> </namespace> </xdoclet></ccid_code>
<ccid_code>“<level> method </level>”代表该标签出现在方法上而不是类之上。例如 /** *@javascript.form *name=”test” */ public String getXXX() { }</ccid_code>