Update of /cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/entity In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19755/modules/ejb/src/xdoclet/modules/ejb/entity
Modified Files: ValueObjectTagsHandler.java Log Message: added parameter for controlling the plural form of aggregate-name and compose-name (XDT-139) Index: ValueObjectTagsHandler.java =================================================================== RCS file: /cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/entity/ValueObjectTagsHandler.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** ValueObjectTagsHandler.java 3 Apr 2005 12:03:20 -0000 1.23 --- ValueObjectTagsHandler.java 4 Apr 2005 18:18:43 -0000 1.24 *************** *** 48,51 **** --- 48,52 ---- private String currentAggregateName; + private String currentAggregateNamePlural; private String currentRelationBeanClass; *************** *** 495,505 **** /** ! * Describe what the method does * ! * @return Describe the return value */ ! public String currentAggregateName() { ! return currentAggregateName; } --- 496,518 ---- /** ! * Returns the current aggregate's name * ! * @param attributes ! * @return ! * @throws XDocletException if an error occures ! * @doc.param name="plural" optional="true" values="true, false" default="false" ! * descriptions="returns the plural if set to true" ! * @doc.tag type="content" */ ! public String currentAggregateName(Properties attributes) { ! String plural = attributes.getProperty("plural"); ! ! if ("true".equals(plural)) { ! return currentAggregateNamePlural; ! } ! else { ! return currentAggregateName; ! } } *************** *** 913,916 **** --- 926,934 ---- String aggreg = tag.getAttributeValue(type); String aggregName = tag.getAttributeValue(type + "-name"); + String aggregNamePlural = tag.getAttributeValue(type + "s-name"); + + if (aggregNamePlural == null) { + aggregNamePlural = aggregName + "s"; + } if (log.isDebugEnabled()) { *************** *** 935,938 **** --- 953,957 ---- currentAggregateType = aggreg; currentAggregateName = aggregName; + currentAggregateNamePlural = aggregNamePlural; String relationInterface = tag.getAttributeValue("members"); *************** *** 951,954 **** --- 970,974 ---- currentAggregateType = aggreg; currentAggregateName = aggregName; + currentAggregateNamePlural = aggregNamePlural; currentRelationBeanClass = InterfaceTagsHandler.getBeanClassNameFromInterfaceNameFor(getCurrentMethod().getReturnType().getType().getQualifiedName()); } *************** *** 956,959 **** --- 976,980 ---- currentAggregateType = null; currentAggregateName = null; + currentAggregateNamePlural = null; currentRelationBeanClass = null; break; ------------------------------------------------------- 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