User: vharcq Date: 02/04/04 14:56:03 Modified: core/src/xdoclet/ejb/tags/vendor MVCSoftTagsHandler.java Log: Replace "..." by ' ...' and use StringBuffer for performance Revision Changes Path 1.6 +158 -141 xdoclet/core/src/xdoclet/ejb/tags/vendor/MVCSoftTagsHandler.java Index: MVCSoftTagsHandler.java =================================================================== RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/ejb/tags/vendor/MVCSoftTagsHandler.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- MVCSoftTagsHandler.java 4 Apr 2002 01:03:09 -0000 1.5 +++ MVCSoftTagsHandler.java 4 Apr 2002 22:56:03 -0000 1.6 @@ -21,7 +21,8 @@ * @author Daniel OConnor ([EMAIL PROTECTED]) * @created November 1, 2001 */ -public class MVCSoftTagsHandler extends ClassTagsHandler { +public class MVCSoftTagsHandler extends ClassTagsHandler +{ /** * @todo-javadoc Describe the field */ @@ -43,7 +44,6 @@ */ protected static String currentColName; - /** * Describe what the method does * @@ -53,11 +53,11 @@ * @todo-javadoc Write javadocs for return value * @todo-javadoc Write javadocs for exception */ - public String methodParamType() throws XDocletException { + public String methodParamType() throws XDocletException + { return currentQueryMethodParameter.type().qualifiedName(); } - /** * Describe what the method does * @@ -67,17 +67,18 @@ * @todo-javadoc Write javadocs for method parameter * @todo-javadoc Write javadocs for exception */ - public void forAllQueryMethodParams(String template) throws XDocletException { + public void forAllQueryMethodParams( String template ) throws XDocletException + { XParameter[] parameters = getCurrentMethod().parameters(); - for (int k = 0; k < (parameters.length - 2); k++) { + for( int k = 0; k < ( parameters.length - 2 ); k++ ) + { currentQueryMethodParameter = parameters[k]; generate(template); } } - /** * Describe what the method does * @@ -87,19 +88,21 @@ * @todo-javadoc Write javadocs for return value * @todo-javadoc Write javadocs for exception */ - public String fieldName() throws XDocletException { + public String fieldName() throws XDocletException + { String token = currentToken(new java.util.Properties()); - int idx = token.indexOf(" "); + int idx = token.indexOf( ' ' ); - if (idx == -1) { + if( idx == -1 ) + { return token; } - else { + else + { return token.substring(0, idx).trim(); } } - /** * Describe what the method does * @@ -109,29 +112,33 @@ * @todo-javadoc Write javadocs for return value * @todo-javadoc Write javadocs for exception */ - public String sortDirection() throws XDocletException { + public String sortDirection() throws XDocletException + { String token = currentToken(new java.util.Properties()); token = token.trim(); - int idx = token.indexOf(" "); + int idx = token.indexOf( ' ' ); - if (idx == -1) { + if( idx == -1 ) + { return ""; } - else { + else + { String sort = token.substring(idx, token.length()).trim(); - if (sort.equalsIgnoreCase("desc")) { + if( sort.equalsIgnoreCase( "desc" ) ) + { return "Descending"; } - else { + else + { return "Ascending"; } } } - /** * Describe what the method does * @@ -141,13 +148,14 @@ * @todo-javadoc Write javadocs for method parameter * @todo-javadoc Write javadocs for exception */ - public void ifHasSortDirection(String template) throws XDocletException { - if (!sortDirection().equals("")) { + public void ifHasSortDirection( String template ) throws XDocletException + { + if( !sortDirection().equals( "" ) ) + { generate(template); } } - /** * Describe what the method does * @@ -157,10 +165,12 @@ * @todo-javadoc Write javadocs for method parameter * @todo-javadoc Write javadocs for exception */ - public void forEachRoleMapping(String template) throws XDocletException { + public void forEachRoleMapping( String template ) throws XDocletException + { String aliases = getKeyAliases(); - if (aliases == null) { + if( aliases == null ) + { return; } @@ -168,20 +178,22 @@ String rightRole = null; int idx = aliases.indexOf(";"); - if (idx == -1) { + if( idx == -1 ) + { leftRole = aliases; } - else { + else + { leftRole = aliases.substring(0, idx); rightRole = aliases.substring(idx + 1); } doForExtendedRole(leftRole, template); - if (rightRole != null) { + if( rightRole != null ) + { doForExtendedRole(rightRole, template); } } - /** * Describe what the method does * @@ -191,17 +203,18 @@ * @todo-javadoc Write javadocs for method parameter * @todo-javadoc Write javadocs for exception */ - public void forSingleRoleMapping(String template) throws XDocletException { + public void forSingleRoleMapping( String template ) throws XDocletException + { String aliases = getKeyAliases(); - if (aliases == null) { + if( aliases == null ) + { return; } currentAliases = new StringTokenizer(aliases, ",", false); generate(template); } - /** * Describe what the method does * @@ -211,12 +224,15 @@ * @todo-javadoc Write javadocs for method parameter * @todo-javadoc Write javadocs for exception */ - public void forAllAliases(String template) throws XDocletException { - while (currentAliases.hasMoreTokens()) { + public void forAllAliases( String template ) throws XDocletException + { + while( currentAliases.hasMoreTokens() ) + { String token = currentAliases.nextToken(); - int idx = token.indexOf("="); + int idx = token.indexOf( '=' ); - if (idx == -1) { + if( idx == -1 ) + { throw new XDocletException(Translator.getString("xdoclet.ejb.vendor.MVCSoftMessages", "alias_form")); } currentFieldName = token.substring(0, idx).trim(); @@ -225,7 +241,6 @@ } } - /** * Describe what the method does * @@ -235,11 +250,11 @@ * @todo-javadoc Write javadocs for return value * @todo-javadoc Write javadocs for exception */ - public String roleName() throws XDocletException { + public String roleName() throws XDocletException + { return currentRoleName; } - /** * Describe what the method does * @@ -249,11 +264,11 @@ * @todo-javadoc Write javadocs for return value * @todo-javadoc Write javadocs for exception */ - public String keyFieldName() throws XDocletException { + public String keyFieldName() throws XDocletException + { return currentFieldName; } - /** * Describe what the method does * @@ -263,11 +278,11 @@ * @todo-javadoc Write javadocs for return value * @todo-javadoc Write javadocs for exception */ - public String colName() throws XDocletException { + public String colName() throws XDocletException + { return currentColName; } - /** * Gets the KeyAliases attribute of the MVCSoftTagsHandler object * @@ -275,11 +290,11 @@ * @exception XDocletException Describe the exception * @todo-javadoc Write javadocs for exception */ - private String getKeyAliases() throws XDocletException { + private String getKeyAliases() throws XDocletException + { return getCurrentMethod().doc().tagAttributeValue("mvcsoft:relation", "key-aliases", false); } - /** * Describe what the method does * @@ -291,10 +306,12 @@ * @todo-javadoc Write javadocs for method parameter * @todo-javadoc Write javadocs for exception */ - private void doForExtendedRole(String token, String template) throws XDocletException { - int idx = token.indexOf(":"); + private void doForExtendedRole( String token, String template ) throws XDocletException + { + int idx = token.indexOf( ':' ); - if (idx == -1) { + if( idx == -1 ) + { throw new XDocletException(Translator.getString("xdoclet.ejb.vendor.MVCSoftMessages", "key_alias_form")); }
_______________________________________________ Xdoclet-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-devel