antonio 2004/04/02 00:00:03
Modified: src/blocks/forms/java/org/apache/cocoon/forms/formmodel
AbstractWidget.java
Log:
Organize imports
Fix typo.
Revision Changes Path
1.4 +17 -7
cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/AbstractWidget.java
Index: AbstractWidget.java
===================================================================
RCS file:
/home/cvs//cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/AbstractWidget.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AbstractWidget.java 25 Mar 2004 16:41:47 -0000 1.3
+++ AbstractWidget.java 2 Apr 2004 08:00:03 -0000 1.4
@@ -15,7 +15,12 @@
*/
package org.apache.cocoon.forms.formmodel;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
import org.apache.cocoon.forms.Constants;
import org.apache.cocoon.forms.FormContext;
@@ -134,7 +139,6 @@
if (this.validators == null) {
this.validators = new ArrayList();
}
-
this.validators.add(validator);
}
@@ -145,7 +149,11 @@
* @return <code>true</code> if the validator was found.
*/
public boolean removeValidator(WidgetValidator validator) {
- return (this.validators == null)? false :
this.validators.remove(validator);
+ if (this.validators != null) {
+ return this.validators.remove(validator);
+ } else {
+ return false;
+ }
}
public boolean validate(FormContext context) {
@@ -154,7 +162,7 @@
// Failed
return false;
} else {
- // Definition sussessful, test local validators
+ // Definition successful, test local validators
if (this.validators == null) {
// No local validators
return true;
@@ -193,14 +201,16 @@
}
public Object getAttribute(String name) {
- return this.attributes == null ? null : this.attributes.get(name);
+ if (this.attributes != null){
+ return this.attributes.get(name);
+ } else{
+ return null;
}
public void setAttribute(String name, Object value) {
if (this.attributes == null) {
this.attributes = new HashMap();
}
-
this.attributes.put(name, value);
}