Update of /cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/intf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23195/modules/ejb/src/xdoclet/modules/ejb/intf
Modified Files: InterfaceTagsHandler.java Log Message: added full method-permission scopability (XDT-658) Index: InterfaceTagsHandler.java =================================================================== RCS file: /cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/intf/InterfaceTagsHandler.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** InterfaceTagsHandler.java 8 Feb 2005 20:08:35 -0000 1.19 --- InterfaceTagsHandler.java 26 Mar 2005 09:20:49 -0000 1.20 *************** *** 6,9 **** --- 6,10 ---- import java.text.MessageFormat; + import java.util.Arrays; import java.util.Collection; import java.util.Iterator; *************** *** 40,43 **** --- 41,45 ---- private String currentMethodViewType = null; + private String currentTagIntf = null; /** *************** *** 694,697 **** --- 696,802 ---- /** + * Evaluates the body if the view-type of the current method is compatible with the value of the current method + * tag's parameter with the passed name. + * + * @param template The body of the block tag + * @param attributes The attributes of the template tag + * @exception XDocletException Description of Exception + * @doc.tag type="block" + * @doc.param name="paramName" optional="false" description=+The param name for the view-type on + * the current method tag" + */ + public void ifCurrentMethodViewTypeEquals(String template, Properties attributes) throws XDocletException + { + String param = attributes.getProperty("paramName"); + String value = getCurrentMethodTag().getAttributeValue(param); + + if (value == null) { + generate(template); + } + else { + String[] viewTypes = getViewTypesFromString(value); + + Arrays.sort(viewTypes); + if (Arrays.binarySearch(viewTypes, currentMethodViewType) >= 0) { + generate(template); + } + + } + } + + /** + * Evaluates the body for all interfaces which are compatible to the view-type which is set on the current class + * tag. The body of this tag is also evaluated once, if no view-type attribute is set on the current class tag. + * + * @param template The body of the block tag + * @param attributes The attributes of the template tag + * @exception XDocletException Description of Exception + * @doc.tag type="block" + * @doc.param name="paramName" optional="false" description="The param name for the view-type on + * the current class tag." + */ + public void forAllClassTagIntf(String template, Properties attributes) throws XDocletException + { + String param = attributes.getProperty("paramName"); + String value = getCurrentClassTag().getAttributeValue(param); + + if (value == null) { + currentTagIntf = null; + generate(template); + } + else { + String[] view_types = getViewTypesFromString(value); + + for (int i = 0; i < view_types.length; i++) { + if (view_types[i].equals("remote")) { + currentTagIntf = "Remote"; + generate(template); + currentTagIntf = "Home"; + generate(template); + } + else if (view_types[i].equals("local")) { + currentTagIntf = "Local"; + generate(template); + currentTagIntf = "LocalHome"; + generate(template); + } + else if (view_types[i].equals(SERVICE_ENDPOINT)) { + currentTagIntf = SERVICE_ENDPOINT_INTERFACE; + generate(template); + } + } + currentTagIntf = null; + } + } + + /** + * Returns the current interface inside a forAllClassTagIntf block + * + * @return + * @exception XDocletException Description of Exception + * @see #forAllClassTagIntf(String, Properties) + * @doc.tag type="content" + */ + public String classTagIntf() throws XDocletException + { + return currentTagIntf; + } + + /** + * Evaluates the body if a current interface is available inside a forAllClassTagIntf block + * + * @param template The body of the block tag + * @exception XDocletException Description of Exception + * @see #forAllClassTagIntf(String, Properties) + * @doc.tag type="block" + */ + public void ifHasClassTagIntf(String template) throws XDocletException + { + if (currentTagIntf != null) { + generate(template); + } + } + + /** * Implements functionality required by [EMAIL PROTECTED] #ifIsInterfaceMethod} and [EMAIL PROTECTED] #ifIsNotInterfaceMethod}. To * determine what interfaces the method should appear in, check the first for a <code>view-type</code> parameter to ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ xdoclet-devel mailing list xdoclet-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-devel