Update of
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-qtags/src/test/java/org/xdoclet/plugin/qtags/impl/test
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21143/src/test/java/org/xdoclet/plugin/qtags/impl/test
Modified Files:
FooBarTag.java FooBarTagImpl.java TagLibrary.java
Log Message:
Reformating with Jalopy
Index: FooBarTagImpl.java
===================================================================
RCS file:
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-qtags/src/test/java/org/xdoclet/plugin/qtags/impl/test/FooBarTagImpl.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** FooBarTagImpl.java 18 Jun 2004 16:37:55 -0000 1.16
--- FooBarTagImpl.java 31 May 2005 11:28:59 -0000 1.17
***************
*** 1,20 ****
package org.xdoclet.plugin.qtags.impl.test;
! public class FooBarTagImpl
! extends org.xdoclet.XDocletTag implements
org.xdoclet.plugin.qtags.impl.test.FooBarTag {
public static final String NAME = "foo.bar";
! private static final java.util.List ALLOWED_PARAMETERS = java.util.Arrays
! .asList(new String[]{"apple", "grape-fruit", "funny", "age",""});
! private static final java.util.List ALLOWED_VALUES =
java.util.Arrays.asList( new String[] {""});
! public FooBarTagImpl(String name, String value,
com.thoughtworks.qdox.model.AbstractJavaEntity entity, int lineNumber) {
super(name, value, entity, lineNumber);
}
public java.lang.String getApple() {
boolean required = false;
String result = getNamedParameter("apple");
! if (required && (result == null)) {
bomb("apple=\"???\" must be specified.");
}
--- 1,44 ----
+ /*
+ * Copyright (c) 2003
+ * XDoclet Team
+ * All rights reserved.
+ */
package org.xdoclet.plugin.qtags.impl.test;
! public class FooBarTagImpl extends org.xdoclet.XDocletTag implements
org.xdoclet.plugin.qtags.impl.test.FooBarTag {
public static final String NAME = "foo.bar";
! private static final java.util.List ALLOWED_PARAMETERS =
java.util.Arrays.asList(new String[] {"age", "apple", "funny", "grape-fruit",
""});
! private static final java.util.List ALLOWED_VALUES =
java.util.Arrays.asList(new String[] {""});
! public FooBarTagImpl(String name, String value,
com.thoughtworks.qdox.model.AbstractJavaEntity entity,
! int lineNumber) {
super(name, value, entity, lineNumber);
}
+ public int getAge() {
+ boolean required = false;
+ String result = getNamedParameter("age");
+
+ if (required && result == null) {
+ bomb("age=\"???\" must be specified.");
+ }
+
+ if (result != null) {
+ try {
+ return Integer.decode(result).intValue();
+ } catch (NumberFormatException nfe) {
+ bomb("age=\"" + result + "\" is not valid integer");
+ throw nfe;
+ }
+ } else {
+ return 0;
+ }
+ }
+
public java.lang.String getApple() {
boolean required = false;
String result = getNamedParameter("apple");
! if (required && result == null) {
bomb("apple=\"???\" must be specified.");
}
***************
*** 27,45 ****
}
! if(result == null) {
! result = "green";
! }
! return result;
! }
!
! public java.lang.String getGrapeFruit() {
! boolean required = true;
! String result = getNamedParameter("grape-fruit");
!
! if (required && (result == null)) {
! bomb("grape-fruit=\"???\" must be specified.");
}
-
return result;
}
--- 51,58 ----
}
! if (result == null) {
! result = "green";
}
return result;
}
***************
*** 49,103 ****
String result = getNamedParameter("funny");
! if (required && (result == null)) {
bomb("funny=\"???\" must be specified.");
}
! if(result == null) {
! result="true";
! }
return Boolean.valueOf(result).booleanValue();
}
! public int getAge() {
! boolean required = false;
! String result = getNamedParameter("age");
! if(required && result == null) {
! bomb("age=\"???\" must be specified.");
! }
! if (result != null) {
! try {
! return Integer.decode(result).intValue();
! } catch(NumberFormatException nfe) {
! bomb("age=\"" + result + "\" is not valid integer");
! throw nfe;
! }
! } else {
! return 0;
}
}
protected void validateLocation() {
! if(isOnClass) {
bomb("is not allowed on classes");
}
! if(isOnField) {
bomb("is not allowed on fields");
}
- // check uniqueness
-
// warn deprecation
! System.err.println("@" + getName() + ":" + getValue());
// check for allowed values for whole tag
! if( ALLOWED_VALUES.size() > 1 &&
!ALLOWED_VALUES.contains(getValue())) {
! bomb( "\"" + getValue() +"\" is not a valid value. Allowed values
are ");
}
// Verify that all parameters are known.
final java.util.Collection parameterNames =
getNamedParameterMap().keySet();
for (java.util.Iterator iterator = parameterNames.iterator();
iterator.hasNext();) {
String parameterName = (String) iterator.next();
if (!ALLOWED_PARAMETERS.contains(parameterName)) {
bomb(parameterName + " is an invalid parameter name.");
--- 62,111 ----
String result = getNamedParameter("funny");
! if (required && result == null) {
bomb("funny=\"???\" must be specified.");
}
! if (result == null) {
! result = "true";
! }
return Boolean.valueOf(result).booleanValue();
}
! public java.lang.String getGrapeFruit() {
! boolean required = true;
! String result = getNamedParameter("grape-fruit");
!
! if (required && result == null) {
! bomb("grape-fruit=\"???\" must be specified.");
}
+
+ return result;
}
protected void validateLocation() {
! if (isOnClass) {
bomb("is not allowed on classes");
}
!
! if (isOnField) {
bomb("is not allowed on fields");
}
+ // check uniqueness
// warn deprecation
! System.err.println("@" + getName() + ":" + getValue());
// check for allowed values for whole tag
! if (ALLOWED_VALUES.size() > 1 &&
!ALLOWED_VALUES.contains(getValue())) {
! bomb("\"" + getValue() + "\" is not a valid value. Allowed values
are ");
}
// Verify that all parameters are known.
final java.util.Collection parameterNames =
getNamedParameterMap().keySet();
+
for (java.util.Iterator iterator = parameterNames.iterator();
iterator.hasNext();) {
String parameterName = (String) iterator.next();
+
if (!ALLOWED_PARAMETERS.contains(parameterName)) {
bomb(parameterName + " is an invalid parameter name.");
***************
*** 106,113 ****
// Get all the parameters to validate their contents
getApple();
- getGrapeFruit();
isFunny();
! getAge();
}
! }
--- 114,121 ----
// Get all the parameters to validate their contents
+ getAge();
getApple();
isFunny();
! getGrapeFruit();
}
! }
\ No newline at end of file
Index: TagLibrary.java
===================================================================
RCS file:
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-qtags/src/test/java/org/xdoclet/plugin/qtags/impl/test/TagLibrary.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** TagLibrary.java 9 Dec 2004 16:38:44 -0000 1.7
--- TagLibrary.java 31 May 2005 11:28:59 -0000 1.8
***************
*** 1,2 ****
--- 1,7 ----
+ /*
+ * Copyright (c) 2003
+ * XDoclet Team
+ * All rights reserved.
+ */
package org.xdoclet.plugin.qtags.impl.test;
***************
*** 9,15 ****
public class TagLibrary {
public TagLibrary(MetadataProvider metadataProvider) {
! metadataProvider.getDocletTagFactory().registerTag(FooBarTagImpl.NAME,
! FooBarTagImpl.class);
!
}
! }
--- 14,18 ----
public class TagLibrary {
public TagLibrary(MetadataProvider metadataProvider) {
!
metadataProvider.getDocletTagFactory().registerTag(FooBarTagImpl.NAME,
FooBarTagImpl.class);
}
! }
\ No newline at end of file
Index: FooBarTag.java
===================================================================
RCS file:
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-qtags/src/test/java/org/xdoclet/plugin/qtags/impl/test/FooBarTag.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** FooBarTag.java 7 May 2004 16:34:16 -0000 1.8
--- FooBarTag.java 31 May 2005 11:28:59 -0000 1.9
***************
*** 1,2 ****
--- 1,7 ----
+ /*
+ * Copyright (c) 2003
+ * XDoclet Team
+ * All rights reserved.
+ */
package org.xdoclet.plugin.qtags.impl.test;
***************
*** 9,13 ****
* @qtags.location constructor
* @qtags.deprecated this tag is deprecated. use [EMAIL PROTECTED] instead
! *
* @author Aslak Hellesøy
* @author Konstantin Pribluda
--- 14,18 ----
* @qtags.location constructor
* @qtags.deprecated this tag is deprecated. use [EMAIL PROTECTED] instead
! *
* @author Aslak Hellesøy
* @author Konstantin Pribluda
***************
*** 15,18 ****
--- 20,25 ----
*/
public interface FooBarTag extends DocletTag {
+ int getAge();
+
/**
* Bla bla
***************
*** 25,35 ****
/**
- * Ping pong
- *
- * @qtags.required
- */
- String getGrapeFruit();
-
- /**
* Hip hop
*
--- 32,35 ----
***************
*** 38,41 ****
boolean isFunny();
! int getAge();
! }
--- 38,46 ----
boolean isFunny();
! /**
! * Ping pong
! *
! * @qtags.required
! */
! String getGrapeFruit();
! }
\ No newline at end of file
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
xdoclet-plugins-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-commits