User: rinkrank
Date: 02/04/03 16:27:48
Modified: core/src/xdoclet/ejb/tags/vendor
JBossRelationTagsHandler.java JBossTagsHandler.java
MVCSoftTagsHandler.java StrutsFormTagsHandler.java
WeblogicRelationTagsHandler.java
Log:
Re-enabled the beautifier (which I turned off during xjavadoc refactoring)
Revision Changes Path
1.6 +320 -135
xdoclet/core/src/xdoclet/ejb/tags/vendor/JBossRelationTagsHandler.java
Index: JBossRelationTagsHandler.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/core/src/xdoclet/ejb/tags/vendor/JBossRelationTagsHandler.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -r1.5 -r1.6
--- JBossRelationTagsHandler.java 25 Mar 2002 20:16:59 -0000 1.5
+++ JBossRelationTagsHandler.java 4 Apr 2002 00:27:48 -0000 1.6
@@ -1,3 +1,38 @@
+/*
+ * Copyright (c) 2001, Aslak Helles�y, BEKK Consulting
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of BEKK Consulting nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+/*
+ * Change log
+ *
+ */
package xdoclet.ejb.tags.vendor;
import xdoclet.ejb.tags.RelationTagsHandler;
@@ -9,70 +44,166 @@
/**
* @author <a href="mailto:[EMAIL PROTECTED]">David Budworth</a>
* @created Feb 4, 2002
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
+ */
+public class JBossRelationTagsHandler extends RelationTagsHandler {
+ /**
+ * @todo-javadoc Describe the field
*/
-public class JBossRelationTagsHandler extends RelationTagsHandler
-{
private String currentFKRelField = null;
+ /**
+ * @todo-javadoc Describe the field
+ */
private String currentFKCol = null;
- public void ifNotLeftHasFK( String template ) throws XDocletException
- {
- if( !leftHasFK() )
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public void ifNotLeftHasFK(String template) throws XDocletException {
+ if (!leftHasFK()) {
generate( template );
}
+ }
+
- public void ifNotRightHasFK( String template ) throws XDocletException
- {
- if( !rightHasFK() )
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public void ifNotRightHasFK(String template) throws XDocletException {
+ if (!rightHasFK()) {
generate( template );
}
+ }
- public void ifLeftHasFK( String template ) throws XDocletException
- {
- if( leftHasFK() )
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public void ifLeftHasFK(String template) throws XDocletException {
+ if (leftHasFK()) {
generate( template );
}
+ }
- public void ifRightHasFK( String template ) throws XDocletException
- {
- if( rightHasFK() )
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public void ifRightHasFK(String template) throws XDocletException {
+ if (rightHasFK()) {
generate( template );
}
+ }
+
- public void forAllLeftForeignKeys( String template ) throws XDocletException
- {
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public void forAllLeftForeignKeys(String template) throws XDocletException {
forAllForeignKeys( template, true );
}
- public void forAllRightForeignKeys( String template ) throws XDocletException
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public void forAllRightForeignKeys(String template) throws XDocletException {
forAllForeignKeys( template, false );
}
- public String relatedPKField()
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ */
+ public String relatedPKField() {
return currentFKRelField;
}
- public String fkColumn()
- {
+
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ */
+ public String fkColumn() {
return currentFKCol;
}
- public void ifLeftHasFKConstraint( String template ) throws XDocletException
- {
- if( leftHasFKConstraint() )
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public void ifLeftHasFKConstraint(String template) throws XDocletException {
+ if (leftHasFKConstraint()) {
generate( template );
}
+ }
+
- public void ifRightHasFKConstraint( String template ) throws XDocletException
- {
- if( rightHasFKConstraint() )
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public void ifRightHasFKConstraint(String template) throws XDocletException {
+ if (rightHasFKConstraint()) {
generate( template );
}
+ }
+
- public String leftFKConstraint() throws XDocletException
- {
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public String leftFKConstraint() throws XDocletException {
return getTagValue(
currentRelation.getLeftMethod().doc(),
"jboss:relation",
@@ -84,9 +215,17 @@
);
}
- public String rightFKConstraint() throws XDocletException
- {
- if( currentRelation.isBidirectional() )
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public String rightFKConstraint() throws XDocletException {
+ if (currentRelation.isBidirectional()) {
return getTagValue(
currentRelation.getRightMethod().doc(),
"jboss:relation",
@@ -96,7 +235,8 @@
false,
false
);
- else
+ }
+ else {
return getTagValue(
currentRelation.getLeftMethod().doc(),
"jboss:target-relation",
@@ -107,11 +247,21 @@
false
);
}
+ }
+
- private boolean leftHasFKConstraint() throws XDocletException
- {
- if (currentRelation.getLeftMethod() == null)
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ private boolean leftHasFKConstraint() throws XDocletException {
+ if (currentRelation.getLeftMethod() == null) {
return false;
+ }
return getTagValue(
currentRelation.getLeftMethod().doc(),
"jboss:relation",
@@ -123,9 +273,17 @@
) != null;
}
- private boolean rightHasFKConstraint() throws XDocletException
- {
- if( currentRelation.isBidirectional() )
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ private boolean rightHasFKConstraint() throws XDocletException {
+ if (currentRelation.isBidirectional()) {
return getTagValue(
currentRelation.getRightMethod().doc(),
"jboss:relation",
@@ -135,10 +293,11 @@
false,
false
) != null;
- else
- {
- if (currentRelation.getLeftMethod() == null)
+ }
+ else {
+ if (currentRelation.getLeftMethod() == null) {
return false;
+ }
return getTagValue(
currentRelation.getLeftMethod().doc(),
"jboss:target-relation",
@@ -151,49 +310,75 @@
}
}
- private boolean leftHasFK() throws XDocletException
- {
- if (currentRelation.getLeftMethod() == null)
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ private boolean leftHasFK() throws XDocletException {
+ if (currentRelation.getLeftMethod() == null) {
return false;
+ }
return currentRelation.getLeftMethod().doc().hasTag( "jboss:relation"
);
}
- private boolean rightHasFK() throws XDocletException
- {
- if( currentRelation.isBidirectional() )
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ private boolean rightHasFK() throws XDocletException {
+ if (currentRelation.isBidirectional()) {
return currentRelation.getRightMethod().doc().hasTag(
"jboss:relation" );
}
- else
- {
- if (currentRelation.getLeftMethod() == null)
+ else {
+ if (currentRelation.getLeftMethod() == null) {
return false;
+ }
return currentRelation.getLeftMethod().doc().hasTag(
"jboss:target-relation" );
}
}
- private void forAllForeignKeys( String template, boolean left ) throws
XDocletException
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @param left Describe what the parameter does @todo-javadoc Write javadocs
+ * for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ private void forAllForeignKeys(String template, boolean left) throws
XDocletException {
XTag[] fktags = null;
- if( left )
- {
+ if (left) {
fktags = currentRelation.getLeftMethod().doc().tags(
"jboss:relation" );
}
- else
- {
- if( currentRelation.isBidirectional() )
+ else {
+ if (currentRelation.isBidirectional()) {
fktags = currentRelation.getRightMethod().doc().tags(
"jboss:relation" );
- if( fktags == null )
+ }
+ if (fktags == null) {
fktags = currentRelation.getLeftMethod().doc().tags(
"jboss:target-relation" );
}
+ }
//maybe we should throw here?
- if( fktags == null )
+ if (fktags == null) {
return;
+ }
- for( int i = 0; i < fktags.length; i++ )
- {
+ for (int i = 0; i < fktags.length; i++) {
currentFKRelField = fktags[i].attributeValue(
"related-pk-field" );
currentFKCol = fktags[i].attributeValue( "fk-column" );
generate( template );
1.5 +68 -29 xdoclet/core/src/xdoclet/ejb/tags/vendor/JBossTagsHandler.java
Index: JBossTagsHandler.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/core/src/xdoclet/ejb/tags/vendor/JBossTagsHandler.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -r1.4 -r1.5
--- JBossTagsHandler.java 24 Mar 2002 17:44:18 -0000 1.4
+++ JBossTagsHandler.java 4 Apr 2002 00:27:48 -0000 1.5
@@ -1,3 +1,38 @@
+/*
+ * Copyright (c) 2001, Aslak Helles�y, BEKK Consulting
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of BEKK Consulting nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+/*
+ * Change log
+ *
+ */
package xdoclet.ejb.tags.vendor;
import xjavadoc.XJavaDoc;
@@ -18,16 +53,21 @@
/**
* @author Dmitri Colebatch ([EMAIL PROTECTED])
* @created October 18, 2001
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
-public class JBossTagsHandler extends ClassTagsHandler
-{
- public String jBossResourceClassName() throws XDocletException
- {
+public class JBossTagsHandler extends ClassTagsHandler {
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public String jBossResourceClassName() throws XDocletException {
Category cat = Log.getCategory( JBossTagsHandler.class,
"jBossResourceClassName" );
- if( cat.isDebugEnabled() )
- {
+ if (cat.isDebugEnabled()) {
cat.debug( "Searching @jboss:resource-manager res-man-class
for Class " + getCurrentClass().name() );
}
@@ -40,6 +80,7 @@
return classTagValue( prop );
}
+
/**
* Evaluates the body if at least one of the classes has an jboss:dvc tag,
* otherwise not.
@@ -47,8 +88,7 @@
* @param template The body of the block tag
* @exception XDocletException Description of Exception
*/
- public void ifHasDVC( String template ) throws XDocletException
- {
+ public void ifHasDVC(String template) throws XDocletException {
boolean hasDVC = false;
XClass[] classes = null;
try {
@@ -57,19 +97,18 @@
throw new XDocletException( e, e.getMessage() );
}
- for( int i = 0; i < classes.length; i++ )
- {
+ for (int i = 0; i < classes.length; i++) {
XTag dvc = classes[i].doc().tag( "jboss:dvc" );
- if( dvc != null )
- {
+ if (dvc != null) {
hasDVC = true;
break;
}
}
- if( hasDVC )
+ if (hasDVC) {
generate( template );
+ }
}
}
1.4 +229 -91 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.3
retrieving revision 1.4
diff -u -w -r1.3 -r1.4
--- MVCSoftTagsHandler.java 24 Mar 2002 17:44:18 -0000 1.3
+++ MVCSoftTagsHandler.java 4 Apr 2002 00:27:48 -0000 1.4
@@ -1,3 +1,38 @@
+/*
+ * Copyright (c) 2001, Aslak Helles�y, BEKK Consulting
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of BEKK Consulting nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+/*
+ * Change log
+ *
+ */
package xdoclet.ejb.tags.vendor;
import xjavadoc.XParameter;
@@ -17,87 +52,140 @@
* @author Daniel OConnor ([EMAIL PROTECTED])
* @created November 1, 2001
*/
-public class MVCSoftTagsHandler extends ClassTagsHandler
-{
+public class MVCSoftTagsHandler extends ClassTagsHandler {
+ /**
+ * @todo-javadoc Describe the field
+ */
protected static XParameter currentQueryMethodParameter;
+ /**
+ * @todo-javadoc Describe the field
+ */
protected static StringTokenizer currentAliases;
+ /**
+ * @todo-javadoc Describe the field
+ */
protected static String currentRoleName;
+ /**
+ * @todo-javadoc Describe the field
+ */
protected static String currentFieldName;
+ /**
+ * @todo-javadoc Describe the field
+ */
protected static String currentColName;
- public String methodParamType() throws XDocletException
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public String methodParamType() throws XDocletException {
return currentQueryMethodParameter.type().qualifiedName();
}
- public void forAllQueryMethodParams( String template ) throws XDocletException
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ 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 );
}
}
- public String fieldName() throws XDocletException
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public String fieldName() throws XDocletException {
String token = currentToken( new java.util.Properties() );
int idx = token.indexOf( " " );
- if( idx == -1 )
- {
+ if (idx == -1) {
return token;
}
- else
- {
+ else {
return token.substring( 0, idx ).trim();
}
}
- public String sortDirection() throws XDocletException
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public String sortDirection() throws XDocletException {
String token = currentToken( new java.util.Properties() );
token = token.trim();
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";
}
}
}
- public void ifHasSortDirection( String template ) throws XDocletException
- {
- if( !sortDirection().equals( "" ) )
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public void ifHasSortDirection(String template) throws XDocletException {
+ if (!sortDirection().equals("")) {
generate( template );
}
}
- public void forEachRoleMapping( String template ) throws XDocletException
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public void forEachRoleMapping(String template) throws XDocletException {
String aliases = getKeyAliases();
- if( aliases == null )
- {
+ if (aliases == null) {
return;
}
@@ -105,43 +193,53 @@
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 );
}
}
- public void forSingleRoleMapping( String template ) throws XDocletException
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public void forSingleRoleMapping(String template) throws XDocletException {
String aliases = getKeyAliases();
- if( aliases == null )
- {
+ if (aliases == null) {
return;
}
currentAliases = new StringTokenizer( aliases, ",", false );
generate( template );
}
- public void forAllAliases( String template ) throws XDocletException
- {
- while( currentAliases.hasMoreTokens() )
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public void forAllAliases(String template) throws XDocletException {
+ while (currentAliases.hasMoreTokens()) {
String token = currentAliases.nextToken();
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();
@@ -150,32 +248,72 @@
}
}
- public String roleName() throws XDocletException
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public String roleName() throws XDocletException {
return currentRoleName;
}
- public String keyFieldName() throws XDocletException
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public String keyFieldName() throws XDocletException {
return currentFieldName;
}
- public String colName() throws XDocletException
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public String colName() throws XDocletException {
return currentColName;
}
- private String getKeyAliases() throws XDocletException
- {
+
+ /**
+ * Gets the KeyAliases attribute of the MVCSoftTagsHandler object
+ *
+ * @return The KeyAliases value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ private String getKeyAliases() throws XDocletException {
return getCurrentMethod().doc().tagAttributeValue( "mvcsoft:relation",
"key-aliases", false );
}
- private void doForExtendedRole( String token, String template ) throws
XDocletException
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param token Describe what the parameter does @todo-javadoc Write javadocs
+ * for method parameter
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ 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" ) );
}
1.16 +165 -106
xdoclet/core/src/xdoclet/ejb/tags/vendor/StrutsFormTagsHandler.java
Index: StrutsFormTagsHandler.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/core/src/xdoclet/ejb/tags/vendor/StrutsFormTagsHandler.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -w -r1.15 -r1.16
--- StrutsFormTagsHandler.java 3 Apr 2002 08:58:32 -0000 1.15
+++ StrutsFormTagsHandler.java 4 Apr 2002 00:27:48 -0000 1.16
@@ -1,3 +1,38 @@
+/*
+ * Copyright (c) 2001, Aslak Helles�y, BEKK Consulting
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of BEKK Consulting nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+/*
+ * Change log
+ *
+ */
package xdoclet.ejb.tags.vendor;
import java.text.MessageFormat;
@@ -29,50 +64,9 @@
/**
* @author Dmitri Colebatch ([EMAIL PROTECTED])
* @created Oct 19, 2001
- * @version $Revision: 1.15 $
- */
-public class StrutsFormTagsHandler extends EjbTagsHandler
-{
- public static String getStrutsFormClassFor( XClass clazz ) throws
XDocletException
- {
- String packageName = clazz.containingPackage().name();
-
- packageName = choosePackage( packageName, null,
StrutsFormSubTask.SUBTASK_NAME );
- return packageName + '.' + getStrutsFormClassName( clazz );
- }
-
- public static String getStrutsFormClassName( XClass clazz ) throws
XDocletException
- {
- XTag currentTag = ( ( StrutsFormSubTask )
DocletContext.getInstance().getSubTaskBy( StrutsFormSubTask.SUBTASK_NAME )
).getCurrentFormTag();
-
- // check if there is a name parameter
- String name = currentTag.attributeValue( "name" );
- if( name == null )
- {
- return getShortEjbNameFor( clazz ) + "Form";
- }
- else
- {
- return MessageFormat.format( getStrutsFormClassPattern(), new
Object[]{getShortEjbNameFor( clazz ), name } );
- }
- }
-
- /**
- * return true if at least one struts:form tag is defined
- *
- * @param clazz Class to check
- * @return whether class has struts:form tag defined
- * @exception XDocletException Description of Exception
+ * @version $Revision: 1.16 $
*/
- public static boolean hasFormDefinition( XClass clazz ) throws XDocletException
- {
- return clazz.doc().hasTag( "struts:form", false );
- }
-
- protected static String getStrutsFormClassPattern()
- {
- return ( ( StrutsFormSubTask )
DocletContext.getInstance().getSubTaskBy( StrutsFormSubTask.SUBTASK_NAME )
).getStrutsFormClassPattern();
- }
+public class StrutsFormTagsHandler extends EjbTagsHandler {
/**
* Return the class name for the current class.
@@ -80,25 +74,27 @@
* @return Description of the Returned Value
* @exception XDocletException Description of Exception
*/
- public String strutsFormClass() throws XDocletException
- {
+ public String strutsFormClass() throws XDocletException {
return getStrutsFormClassFor( getCurrentClass() );
}
+
/**
* @return Description of the Returned Value
* @exception XDocletException Description of Exception
*/
- public String strutsFormName() throws XDocletException
- {
+ public String strutsFormName() throws XDocletException {
XTag currentTag = ( ( StrutsFormSubTask )
getDocletContext().getSubTaskBy( StrutsFormSubTask.SUBTASK_NAME )
).getCurrentFormTag();
String formName = currentTag.attributeValue( "name" );
- if( formName == null || formName.trim().length() == 0 )
+ if (formName == null || formName.trim().length() == 0) {
return Introspector.decapitalize( getEjbNameFor(
getCurrentClass() ) + "Form" );
- else
+ }
+ else {
return Introspector.decapitalize( getEjbNameFor(
getCurrentClass() ) + '.' + formName );
}
+ }
+
/**
* Evaluates body for all fields included in form generation
@@ -108,8 +104,7 @@
* @doc:tag type="block"
*/
- public void forAllFormFields( String template ) throws XDocletException
- {
+ public void forAllFormFields(String template) throws XDocletException {
// all fields carrying @struts:form-field form-name="<bla>" where
<bla> is current
// form name, or all persistent fields if include-all="true" is set
// pk fields are included implicitly, unless include-pk="false" is
specified.
@@ -118,29 +113,28 @@
XClass cur_class = getCurrentClass();
Map foundFields = new HashMap();
- if( cat.isDebugEnabled() )
+ if (cat.isDebugEnabled()) {
cat.debug( "BEGIN-----------------------------------------" );
+ }
- do
- {
+ do {
pushCurrentClass( cur_class );
- if( cat.isDebugEnabled() )
+ if (cat.isDebugEnabled()) {
cat.debug( "-----CLASS=" + getCurrentClass().name() +
"----------------" );
+ }
XMethod[] methods = getCurrentClass().methods();
- for( int j = 0; j < methods.length; j++ )
- {
+ for (int j = 0; j < methods.length; j++) {
setCurrentMethod( methods[j] );
// we are interested in persistent methods only
- if( MethodTagsHandler.isGetter(
getCurrentMethod().name() ) && !foundFields.containsKey( getCurrentMethod().name() ) )
- {
+ if
(MethodTagsHandler.isGetter(getCurrentMethod().name()) &&
!foundFields.containsKey(getCurrentMethod().name())) {
//
- if( useMethodInForm( getCurrentMethod() ) )
- {
- if( cat.isDebugEnabled() )
+ if (useMethodInForm(getCurrentMethod())) {
+ if (cat.isDebugEnabled()) {
cat.debug( "METHOD(I=" +
getCurrentMethod().name() );
+ }
// Store that we found this field so
we don't add it twice
foundFields.put(
getCurrentMethod().name(), getCurrentMethod().name() );
@@ -152,8 +146,7 @@
}
// Add super class info
- if( getCurrentClass().superclass().qualifiedName().equals(
"java.lang.Object" ) )
- {
+ if
(getCurrentClass().superclass().qualifiedName().equals("java.lang.Object")) {
popCurrentClass();
break;
}
@@ -162,9 +155,11 @@
cur_class = cur_class.superclass();
}while ( true );
- if( cat.isDebugEnabled() )
+ if (cat.isDebugEnabled()) {
cat.debug( "END-------------------------------------------" );
}
+ }
+
/**
* check that method has struts:form-field tag with valid name, or is pk field
@@ -174,38 +169,102 @@
* @return Description of the Returned Value
* @exception XDocletException Description of Exception
*/
- protected boolean useMethodInForm( XMethod method ) throws XDocletException
- {
+ protected boolean useMethodInForm(XMethod method) throws XDocletException {
// check for include-all
XTag currentTag = ( ( StrutsFormSubTask )
getDocletContext().getSubTaskBy( StrutsFormSubTask.SUBTASK_NAME )
).getCurrentFormTag();
String value = currentTag.attributeValue( "include-all" );
// by default, include all is true
- if( value == null || value.trim().length() == 0 )
+ if (value == null || value.trim().length() == 0) {
return true;
+ }
- if( value.equals( "true" ) )
+ if (value.equals("true")) {
return true;
+ }
// include all pk fields unless include-pk="false"
value = currentTag.attributeValue( "include-pk" );
- if( PersistentTagsHandler.isPkField( method ) && ( ( value == null )
|| ( value != null && !value.equals( "false" ) ) ) )
+ if (PersistentTagsHandler.isPkField(method) && ((value == null) ||
(value != null && !value.equals("false")))) {
return true;
+ }
// check for explicit inclusion
XTag[] mTags = method.doc().tags( "struts:form-field" );
- for( int i = 0; i < mTags.length; i++ )
- {
+ for (int i = 0; i < mTags.length; i++) {
XTag mTag = mTags[i];
String pname = mTag.attributeValue( "form-name" );
String fname = mTag.attributeValue( "name" );
- if( pname != null && fname != null && fname.equals( pname ) )
+ if (pname != null && fname != null && fname.equals(pname)) {
return true;
}
+ }
// no need in such field...
return false;
+ }
+
+
+ /**
+ * Gets the StrutsFormClassFor attribute of the StrutsFormTagsHandler class
+ *
+ * @param clazz Describe what the parameter does @todo-javadoc Write javadocs
+ * for method parameter
+ * @return The StrutsFormClassFor value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public static String getStrutsFormClassFor(XClass clazz) throws
XDocletException {
+ String packageName = clazz.containingPackage().name();
+
+ packageName = choosePackage(packageName, null,
StrutsFormSubTask.SUBTASK_NAME);
+ return packageName + '.' + getStrutsFormClassName(clazz);
+ }
+
+
+ /**
+ * Gets the StrutsFormClassName attribute of the StrutsFormTagsHandler class
+ *
+ * @param clazz Describe what the parameter does @todo-javadoc Write javadocs
+ * for method parameter
+ * @return The StrutsFormClassName value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public static String getStrutsFormClassName(XClass clazz) throws
XDocletException {
+ XTag currentTag =
((StrutsFormSubTask)DocletContext.getInstance().getSubTaskBy(StrutsFormSubTask.SUBTASK_NAME)).getCurrentFormTag();
+
+ // check if there is a name parameter
+ String name = currentTag.attributeValue("name");
+ if (name == null) {
+ return getShortEjbNameFor(clazz) + "Form";
+ }
+ else {
+ return MessageFormat.format(getStrutsFormClassPattern(), new
Object[]{getShortEjbNameFor(clazz), name});
+ }
+ }
+
+
+ /**
+ * return true if at least one struts:form tag is defined
+ *
+ * @param clazz Class to check
+ * @return whether class has struts:form tag defined
+ * @exception XDocletException Description of Exception
+ */
+ public static boolean hasFormDefinition(XClass clazz) throws XDocletException {
+ return clazz.doc().hasTag("struts:form", false);
+ }
+
+
+ /**
+ * Gets the StrutsFormClassPattern attribute of the StrutsFormTagsHandler class
+ *
+ * @return The StrutsFormClassPattern value
+ */
+ protected static String getStrutsFormClassPattern() {
+ return
((StrutsFormSubTask)DocletContext.getInstance().getSubTaskBy(StrutsFormSubTask.SUBTASK_NAME)).getStrutsFormClassPattern();
}
}
1.11 +189 -85
xdoclet/core/src/xdoclet/ejb/tags/vendor/WeblogicRelationTagsHandler.java
Index: WeblogicRelationTagsHandler.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/core/src/xdoclet/ejb/tags/vendor/WeblogicRelationTagsHandler.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -r1.10 -r1.11
--- WeblogicRelationTagsHandler.java 24 Mar 2002 22:40:33 -0000 1.10
+++ WeblogicRelationTagsHandler.java 4 Apr 2002 00:27:48 -0000 1.11
@@ -1,3 +1,38 @@
+/*
+ * Copyright (c) 2001, Aslak Helles�y, BEKK Consulting
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of BEKK Consulting nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+/*
+ * Change log
+ *
+ */
package xdoclet.ejb.tags.vendor;
import java.util.Iterator;
@@ -12,27 +47,38 @@
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Aslak Helles�y</a>
* @created Sept 11, 2001
- * @version $Revision: 1.10 $
+ * @version $Revision: 1.11 $
+ */
+public class WeblogicRelationTagsHandler extends RelationTagsHandler {
+ /**
+ * @todo-javadoc Describe the field
*/
-public class WeblogicRelationTagsHandler extends RelationTagsHandler
-{
private String currentForeignKeyColumn;
+ /**
+ * @todo-javadoc Describe the field
+ */
private String currentKeyColumn;
- public void forAllLeftColumnMaps( String template ) throws XDocletException
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public void forAllLeftColumnMaps(String template) throws XDocletException {
XTag[] columnMapTags = null;
- if( currentRelation.getLeftMethod() != null )
- {
+ if (currentRelation.getLeftMethod() != null) {
// bidirectional
columnMapTags = currentRelation.getLeftMethod().doc().tags(
"weblogic:column-map" );
if( columnMapTags.length == 0 ) {
//throw new XDocletException(
currentRelation.getRightMethod().name() + " should have at least one
@weblogic:column-map tag (B)" );
}
}
- else
- {
+ else {
// unidirectional
columnMapTags = currentRelation.getRightMethod().doc().tags(
"weblogic:target-column-map" );
if( columnMapTags.length == 0 ) {
@@ -40,28 +86,33 @@
}
}
- for( int i = 0; i < columnMapTags.length; i++ )
- {
+ for (int i = 0; i < columnMapTags.length; i++) {
currentForeignKeyColumn = columnMapTags[i].attributeValue(
"foreign-key-column" );
currentKeyColumn = columnMapTags[i].attributeValue(
"key-column" );
generate( template );
}
}
- public void forAllRightColumnMaps( String template ) throws XDocletException
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public void forAllRightColumnMaps(String template) throws XDocletException {
XTag[] columnMapTags = null;
- if( currentRelation.getRightMethod() != null )
- {
+ if (currentRelation.getRightMethod() != null) {
// bidirectional
columnMapTags = currentRelation.getRightMethod().doc().tags(
"weblogic:column-map" );
if( columnMapTags.length == 0 ) {
//throw new XDocletException(
currentRelation.getRightMethod().name() + " should have at least one
@weblogic:column-map tag (B)" );
}
}
- else
- {
+ else {
// unidirectional
columnMapTags = currentRelation.getLeftMethod().doc().tags(
"weblogic:target-column-map" );
if( columnMapTags.length == 0 ) {
@@ -69,16 +120,17 @@
}
}
- for( int i = 0; i < columnMapTags.length; i++ )
- {
+ for (int i = 0; i < columnMapTags.length; i++) {
currentForeignKeyColumn = columnMapTags[i].attributeValue(
"foreign-key-column" );
currentKeyColumn = columnMapTags[i].attributeValue(
"key-column" );
generate( template );
}
}
+
/**
- * Makes sure the column-map tags are on the left side and target-column-map
tags right
+ * Makes sure the column-map tags are on the left side and target-column-map
+ * tags right
*/
public void ensureColumnMapTagsRight() {
boolean leftHasTargetColumnMapTags = false;
@@ -94,84 +146,136 @@
}
}
- public String joinTableName() throws XDocletException
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public String joinTableName() throws XDocletException {
// We say mandatory is false (last parameter), so we can provide a
more detailed error message.
String leftJoinTableName =
currentRelation.getLeftMethod().doc().tagAttributeValue( "weblogic:relation",
"join-table-name", false );
String joinTableName = leftJoinTableName;
String rightJoinTableName = null;
// do some sanity checking
- if( leftJoinTableName == null && currentRelation.getRightMethod() !=
null )
- {
+ if (leftJoinTableName == null && currentRelation.getRightMethod() !=
null) {
rightJoinTableName =
currentRelation.getRightMethod().doc().tagAttributeValue( "weblogic:relation",
"join-table-name", false );
joinTableName = rightJoinTableName;
}
- if( leftJoinTableName != null && rightJoinTableName != null )
- {
+ if (leftJoinTableName != null && rightJoinTableName != null) {
throw new XDocletException( Translator.getString(
"xdoclet.ejb.vendor.WeblogicMessages", "join_table_name_only_one_side" ) );
}
- if( leftJoinTableName == null && rightJoinTableName == null )
- {
+ if (leftJoinTableName == null && rightJoinTableName == null) {
throw new XDocletException( Translator.getString(
"xdoclet.ejb.vendor.WeblogicMessages",
"join_table_name_needed", new String[]{relationName()}
) );
}
return joinTableName;
}
- public String leftGroupName() throws XDocletException
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public String leftGroupName() throws XDocletException {
return currentRelation.getLeftMethod().doc().tagAttributeValue(
"weblogic:relation", "group-name", false );
}
- public void ifHasLeftGroupName( String template ) throws XDocletException
- {
- if( leftGroupName() != null )
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public void ifHasLeftGroupName(String template) throws XDocletException {
+ if (leftGroupName() != null) {
generate( template );
}
}
- public String rightGroupName() throws XDocletException
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public String rightGroupName() throws XDocletException {
String groupName = null;
- if( currentRelation.getRightMethod() != null )
- {
+ if (currentRelation.getRightMethod() != null) {
// bidirectional
groupName =
currentRelation.getRightMethod().doc().tagAttributeValue( "weblogic:relation",
"group-name", false );
}
- else
- {
+ else {
// unidirectional
groupName =
currentRelation.getLeftMethod().doc().tagAttributeValue( "weblogic:relation",
"group-name", false );
}
return groupName;
}
- public void ifHasRightGroupName( String template ) throws XDocletException
- {
- if( rightGroupName() != null )
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public void ifHasRightGroupName(String template) throws XDocletException {
+ if (rightGroupName() != null) {
generate( template );
}
}
- public void ifHasKeyColumn( String template ) throws XDocletException
- {
- if( keyColumn() != null )
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @param template Describe what the parameter does @todo-javadoc Write
+ * javadocs for method parameter
+ * @exception XDocletException Describe the exception @todo-javadoc Write
+ * javadocs for exception
+ */
+ public void ifHasKeyColumn(String template) throws XDocletException {
+ if (keyColumn() != null) {
generate( template );
}
}
- public String keyColumn()
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ */
+ public String keyColumn() {
return currentKeyColumn;
}
- public String foreignKeyColumn()
- {
+
+ /**
+ * Describe what the method does @todo-javadoc Write javadocs for method
+ *
+ * @return Describe the return value @todo-javadoc Write javadocs for return
+ * value
+ */
+ public String foreignKeyColumn() {
return currentForeignKeyColumn;
}
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel