From: Vance K. <va...@us...> - 2006-01-03 01:33:50
|
User: vancek Date: 06/01/02 17:33:44 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3 EJB3ScriptHelper.java Log: refactored getAttributesAsList out to the session facade Revision Changes Path 1.2 +1 -44 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/EJB3ScriptHelper.java Index: EJB3ScriptHelper.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/EJB3ScriptHelper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- EJB3ScriptHelper.java 28 Dec 2005 00:32:56 -0000 1.1 +++ EJB3ScriptHelper.java 3 Jan 2006 01:33:44 -0000 1.2 @@ -1,6 +1,7 @@ package org.andromda.cartridges.ejb3; import org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacade; +import org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade; import org.andromda.metafacades.uml.AttributeFacade; import org.andromda.metafacades.uml.ModelElementFacade; @@ -18,50 +19,6 @@ */ public class EJB3ScriptHelper { - - /** - * Create a comma seperated list of attributes. - * <p/> - * This method can be used to generated e.g. argument lists for constructors, method calls etc. - * <p/> - * It will not return attributes tagged to be optimistic lock values. - * - * @param attributes a collection of {@link Attribute} objects - * @param includeTypes if <code>true</code>, the type names of the attributes are included. - * @param includeNames if <code>true</code>, the names of the attributes are included - */ - public String getAttributesAsList(Collection attributes, boolean includeTypes, boolean includeNames) - { - if (!includeNames && !includeTypes || attributes == null) - { - return ""; - } - - StringBuffer sb = new StringBuffer(); - String separator = ""; - - for (final Iterator it = attributes.iterator(); it.hasNext();) - { - // AttributeFacade attr = (AttributeFacade)it.next(); - EJB3EntityAttributeFacade attr = (EJB3EntityAttributeFacade)it.next(); - if (!attr.isVersion()) - { - sb.append(separator); - separator = ", "; - if (includeTypes) - { - sb.append(attr.getType().getFullyQualifiedName()); - sb.append(" "); - } - if (includeNames) - { - sb.append(attr.getName()); - } - } - } - return sb.toString(); - } - /** * Create a collection of String objects representing the argument names. * |