Update of /cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/env
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31694/modules/ejb/src/xdoclet/modules/ejb/env
Modified Files:
EnvTagsHandler.java EnvEjbRefTagsHandler.java
Log Message:
support for methods which return the component-interface added (XDT-1325)
Index: EnvTagsHandler.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/env/EnvTagsHandler.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** EnvTagsHandler.java 6 Apr 2005 21:43:27 -0000 1.1
--- EnvTagsHandler.java 9 Apr 2005 15:44:02 -0000 1.2
***************
*** 10,16 ****
--- 10,18 ----
import java.util.HashMap;
import java.util.Iterator;
+ import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.StringTokenizer;
+ import xjavadoc.XClass;
import xjavadoc.XField;
import xjavadoc.XMember;
***************
*** 270,273 ****
--- 272,289 ----
sb.append(method.getNameWithSignature(true));
+ List exceptions = method.getThrownExceptions();
+
+ if (exceptions.size() > 0) {
+ sb.append(" throws ");
+ for (Iterator it = exceptions.iterator(); it.hasNext(); ) {
+ XClass exception = (XClass) it.next();
+
+ sb.append(exception.getQualifiedName());
+ if (it.hasNext()) {
+ sb.append(", ");
+ }
+ }
+ }
+
return sb.toString();
}
Index: EnvEjbRefTagsHandler.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/env/EnvEjbRefTagsHandler.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** EnvEjbRefTagsHandler.java 9 Apr 2005 08:21:58 -0000 1.3
--- EnvEjbRefTagsHandler.java 9 Apr 2005 15:44:02 -0000 1.4
***************
*** 19,22 ****
--- 19,23 ----
import xdoclet.modules.ejb.XDocletModulesEjbMessages;
import xdoclet.modules.ejb.home.HomeTagsHandler;
+ import xdoclet.modules.ejb.intf.InterfaceTagsHandler;
import xdoclet.util.LogUtil;
import xdoclet.util.Translator;
***************
*** 60,64 ****
/**
! * Evaluates the body block for each ejb reference.
*
* @param template The body of the block tag
--- 61,65 ----
/**
! * Evaluates the body block for each ejb reference.
*
* @param template The body of the block tag
***************
*** 82,86 ****
/**
! * Evaluates the body block for each method- and field-level ejb
reference.
*
* @param template The body of the block tag
--- 83,87 ----
/**
! * Evaluates the body block for each method- and field-level ejb
reference.
*
* @param template The body of the block tag
***************
*** 104,107 ****
--- 105,130 ----
/**
+ * Evaluates the body block for each method-level ejb reference.
+ *
+ * @param template The body of the block tag
+ * @param attributes The attributes of the template tag
+ * @exception XDocletException
+ * @doc.tag type="block"
+ * @doc.param name="tagName" description="the ejb-ref
tag" default="ejb.ejb-ref"
+ */
+ public void forAllEjbRefMethods(String template, Properties attributes)
throws XDocletException
+ {
+ already.clear();
+
+ if (attributes.getProperty("tagName") == null) {
+ attributes.setProperty("tagName", "ejb.ejb-ref");
+ }
+
+ forTags(template, attributes, false, true, false);
+
+ already.clear();
+ }
+
+ /**
* Returns the global JNDI name for the current EJB ref.
*
***************
*** 176,179 ****
--- 199,255 ----
/**
+ * Returns the home interface for the current ejb reference
+ *
+ * @return the fully qualified class name
+ * @throws XDocletException if an error occures
+ * @doc.tag type="content"
+ */
+ public String homeInterface() throws XDocletException
+ {
+ String intf;
+
+ if ("ejb.ejb-external-ref".equals(currentTag.getName())) {
+ intf = currentTag.getAttributeValue("home");
+ if (intf == null) {
+ mandatoryParamNotFound(currentTag.getDoc(), "home",
"ejb.ejb-external-ref");
+ }
+ }
+ else {
+ String type = isRemoteEjbRef(currentTag) ? "remote" : "local";
+
+ intf = HomeTagsHandler.getHomeInterface(type, getCurrentClass());
+ }
+ return intf;
+ }
+
+ /**
+ * Returns the component interface for the current ejb reference
+ *
+ * @return the fully qualified class name
+ * @throws XDocletException if an error occures
+ * @doc.tag type="content"
+ */
+ public String componentInterface() throws XDocletException
+ {
+ String intf;
+
+ if ("ejb.ejb-external-ref".equals(currentTag.getName())) {
+ intf = currentTag.getAttributeValue("business");
+ if (intf == null) {
+ intf = currentTag.getAttributeValue("remote");
+ }
+ if (intf == null) {
+ mandatoryParamNotFound(currentTag.getDoc(), "business",
"ejb.ejb-external-ref");
+ }
+ }
+ else {
+ String type = isRemoteEjbRef(currentTag) ? "remote" : "local";
+
+ intf = InterfaceTagsHandler.getComponentInterface(type,
getCurrentClass());
+ }
+ return intf;
+ }
+
+ /**
* Return true if the ejb-ref is local
*
-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel