Update of /cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/mdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21663/modules/ejb/src/xdoclet/modules/ejb/mdb
Modified Files: MdbTagsHandler.java Log Message: added support for ejb 2.1 message destination links (XDT-1307) Index: MdbTagsHandler.java =================================================================== RCS file: /cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/mdb/MdbTagsHandler.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** MdbTagsHandler.java 1 Mar 2005 22:48:03 -0000 1.13 --- MdbTagsHandler.java 25 Mar 2005 20:56:59 -0000 1.14 *************** *** 25,28 **** --- 25,31 ---- public class MdbTagsHandler extends EjbTagsHandler { + + private XTag currentDestination; + /** * Gets the MdbClassFor attribute of the MdbTagsHandler class *************** *** 175,178 **** --- 178,287 ---- /** + * Evaluates the body block for each ejb:message-destination defined in class level + * + * @param template The body of the block tag + * @exception XDocletException + * @see #destinationName() + * @see #destinationDescription() + * @see #destinationDisplayName() + * @doc.tag type="block" + */ + public void forAllDestinations(String template) throws XDocletException + { + Collection classes = getXJavaDoc().getSourceClasses(); + + Map dests = new HashMap(); + + for (Iterator i = classes.iterator(); i.hasNext(); ) { + XClass clazz = (XClass) i.next(); + + setCurrentClass(clazz); + + if (getCurrentClass().getDoc().hasTag("ejb.message-destination")) { + XTag tag = (XTag) getCurrentClass().getDoc().getTag("ejb.message-destination"); + String destName = tag.getAttributeValue("name"); + + if (destName != null) { + dests.put(destName, tag); + } + } + } + + // Output set of destinations + for (Iterator it = dests.values().iterator(); it.hasNext(); ) { + currentDestination = (XTag) it.next(); + + generate(template); + } + } + + /** + * Returns the name of the current message destination + * + * @return Current message destination's name + * @exception XDocletException + * @see #forAllDestinations(java.lang.String) + * @doc.tag type="content" + */ + public String destinationName() throws XDocletException + { + return currentDestination.getAttributeValue("name"); + } + + /** + * Returns the display-name of the current message destination + * + * @return Current message destination's display-name + * @exception XDocletException + * @see #forAllDestinations(java.lang.String) + * @doc.tag type="content" + */ + public String destinationDisplayName() throws XDocletException + { + return currentDestination.getAttributeValue("display-name"); + } + + /** + * Evaluate the body block if the current message destination has a display-name + * + * @param template The body of the block tag + * @exception XDocletException + * @doc.tag type="block" + */ + public void ifDestinationHasDisplayName(String template) throws XDocletException + { + if (destinationDisplayName() != null) { + generate(template); + } + } + + /** + * Returns the description of the current message destination + * + * @return Current message destination's description + * @exception XDocletException + * @see #forAllDestinations(java.lang.String) + * @doc.tag type="content" + */ + public String destinationDescription() throws XDocletException + { + return currentDestination.getAttributeValue("description"); + } + + /** + * Evaluate the body block if the current message destination has a descrition + * + * @param template The body of the block tag + * @exception XDocletException + * @doc.tag type="block" + */ + public void ifDestinationHasDescription(String template) throws XDocletException + { + if (destinationDescription() != null) { + generate(template); + } + } + + /** * Returns true if the current class has a activation config * *************** *** 209,212 **** --- 318,322 ---- return hasTag(props, FOR_CLASS); } + } ------------------------------------------------------- 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