[maven-release-plugin] copy for tag fulcrum-intake-1.2.2
git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/tags/fulcrum-intake-1.2.2@1773053 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index 8823cf3..18c009b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -175,6 +175,29 @@
</plugins>
</build>
</profile>
+ <profile>
+ <id>java8</id>
+ <activation>
+ <jdk>[1.8,)</jdk>
+ </activation>
+ <reporting>
+ <plugins>
+ <!-- Use Java 8 compatible Findbugs version -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <version>3.0.1</version>
+ <configuration>
+ <threshold>Normal</threshold>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+ <properties>
+ <!-- ignore doclint errors (should be warnings) -->
+ <additionalparam>-Xdoclint:none</additionalparam>
+ </properties>
+ </profile>
</profiles>
<properties>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 7a48b7a..fbea682 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -27,7 +27,7 @@
<body>
<release version="1.2.3" date="in Subversion">
</release>
- <release version="1.2.2" date="2016-11-27">
+ <release version="1.2.2" date="2016-12-07">
<action dev="tv" type="update">
Move all post-processing to afterUnmarshal(), privatize a number of fields
</action>
diff --git a/src/java/org/apache/fulcrum/intake/IntakeService.java b/src/java/org/apache/fulcrum/intake/IntakeService.java
index b852b52..2f861c3 100644
--- a/src/java/org/apache/fulcrum/intake/IntakeService.java
+++ b/src/java/org/apache/fulcrum/intake/IntakeService.java
@@ -20,7 +20,6 @@
*/
import java.beans.IntrospectionException;
-
import java.lang.reflect.Method;
import org.apache.fulcrum.intake.model.Group;
@@ -32,9 +31,9 @@
* <p>Localization of Intake's error messages can be accomplished
* using Turbine's <code>LocalizationTool</code> from a Velocity template
* as follows:
- * <blockquote><code></pre>
+ * <code>
* $l10n.get($intake.SomeGroup.SomeField.Message)
- * </pre></code></blockquote>
+ * </code>
* </p>
*
* @author <a href="mailto:jmcnally@collab.net">John McNally</a>
@@ -98,7 +97,7 @@
* Gets the current size of the pool for a named group.
*
* @param groupName the name of the group.
- *
+ * @return the size of the group pool
* @throws IntakeException The passed group name does not exist.
*/
int getSize(String groupName)
@@ -133,8 +132,8 @@
* @param className the name of the object.
* @param propName the name of the property.
* @return the setter.
- * @throws ClassNotFoundException
- * @throws IntrospectionException
+ * @throws ClassNotFoundException if the class specified could not be loaded
+ * @throws IntrospectionException if the property setter could not be called
*/
Method getFieldSetter(String className, String propName)
throws ClassNotFoundException, IntrospectionException;
@@ -145,14 +144,9 @@
* @param className the name of the object.
* @param propName the name of the property.
* @return the getter.
- * @throws ClassNotFoundException
- * @throws IntrospectionException
+ * @throws ClassNotFoundException if the class specified could not be loaded
+ * @throws IntrospectionException if the property getter could not be called
*/
Method getFieldGetter(String className, String propName)
throws ClassNotFoundException, IntrospectionException;
}
-
-
-
-
-
diff --git a/src/java/org/apache/fulcrum/intake/IntakeServiceFacade.java b/src/java/org/apache/fulcrum/intake/IntakeServiceFacade.java
index 142e694..fd824a6 100644
--- a/src/java/org/apache/fulcrum/intake/IntakeServiceFacade.java
+++ b/src/java/org/apache/fulcrum/intake/IntakeServiceFacade.java
@@ -26,14 +26,14 @@
/**
* This is a Facade class for IntakeService.
- *
+ *
* This class provides static methods that call related methods of the
* implementation of the IntakeService used by the System, according to the
* settings in your intake.xml file.
- *
+ *
* Note: How should a facade class work? It seems to me that maybe it should
* only have a hook into the Avalon Component Manager somehow?
- *
+ *
* @author <a href="mailto:jmcnally@collab.net">John McNally</a>
* @author <a href="mailto:quintonm@bellsouth.net">Quinton McCombs</a>
* @version $Id$
@@ -41,7 +41,6 @@
public class IntakeServiceFacade
{
/** Static instance of the intakeService. */
-
private static IntakeService intakeService;
/**
@@ -56,7 +55,7 @@
/**
* Gets an instance of a named group either from the pool or by calling the
* Factory Service if the pool is empty.
- *
+ *
* @param groupName
* the name of the group.
* @return a Group instance.
@@ -74,7 +73,7 @@
/**
* Puts a group back to the pool.
- *
+ *
* @param instance
* the object instance to recycle.
* @throws IntakeException
@@ -87,7 +86,7 @@
/**
* Gets the current size of the pool for a named group.
- *
+ *
* @param groupName
* the name of the group.
* @return the current pool size
@@ -101,7 +100,7 @@
/**
* Names of all the defined groups.
- *
+ *
* @return array of names.
*/
public static String[] getGroupNames()
@@ -111,7 +110,7 @@
/**
* Gets the key (usually a short identifier) for a group.
- *
+ *
* @param groupName
* the name of the group.
* @return the the key.
@@ -123,7 +122,7 @@
/**
* Gets the group name given its key.
- *
+ *
* @param groupKey
* the key.
* @return groupName the name of the group.
@@ -135,14 +134,14 @@
/**
* Gets the Method that can be used to set a property.
- *
+ *
* @param className
* the name of the object.
* @param propName
* the name of the property.
* @return the setter.
- * @throws ClassNotFoundException
- * @throws IntrospectionException
+ * @throws ClassNotFoundException if the class specified could not be loaded
+ * @throws IntrospectionException if the property setter could not be called
*/
public static Method getFieldSetter(String className, String propName) throws IntrospectionException, ClassNotFoundException
{
@@ -151,14 +150,14 @@
/**
* Gets the Method that can be used to get a property value.
- *
+ *
* @param className
* the name of the object.
* @param propName
* the name of the property.
* @return the getter.
- * @throws ClassNotFoundException
- * @throws IntrospectionException
+ * @throws ClassNotFoundException if the class specified could not be loaded
+ * @throws IntrospectionException if the property getter could not be called
*/
public static Method getFieldGetter(String className, String propName) throws IntrospectionException, ClassNotFoundException
{
@@ -167,7 +166,7 @@
/**
* Utility method for accessing the service implementation
- *
+ *
* @return a IntakeService implementation instance
*/
private static IntakeService getService()
diff --git a/src/java/org/apache/fulcrum/intake/IntakeServiceImpl.java b/src/java/org/apache/fulcrum/intake/IntakeServiceImpl.java
index c94ce56..a15e021 100644
--- a/src/java/org/apache/fulcrum/intake/IntakeServiceImpl.java
+++ b/src/java/org/apache/fulcrum/intake/IntakeServiceImpl.java
@@ -33,6 +33,7 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.ListIterator;
import java.util.Map;
import java.util.Set;
@@ -548,8 +549,8 @@
* @param propName
* the name of the property.
* @return the setter.
- * @throws ClassNotFoundException
- * @throws IntrospectionException
+ * @throws ClassNotFoundException if the class specified could not be loaded
+ * @throws IntrospectionException if the property setter could not be called
*/
@Override
public Method getFieldSetter(String className, String propName)
@@ -607,8 +608,8 @@
* @param propName
* the name of the property.
* @return the getter.
- * @throws ClassNotFoundException
- * @throws IntrospectionException
+ * @throws ClassNotFoundException if the class specified could not be loaded
+ * @throws IntrospectionException if the property getter could not be called
*/
@Override
public Method getFieldGetter(String className, String propName)
@@ -797,9 +798,9 @@
String groupPrefix = appData.getGroupPrefix();
- for (int i = glist.size() - 1; i >= 0; i--)
+ for (ListIterator<Group> i = glist.listIterator(glist.size()); i.hasPrevious();)
{
- Group g = glist.get(i);
+ Group g = i.previous();
String groupName = g.getIntakeGroupName();
boolean registerUnqualified = registerGroup(groupName, g, appData, true);
diff --git a/src/java/org/apache/fulcrum/intake/Retrievable.java b/src/java/org/apache/fulcrum/intake/Retrievable.java
index 0f65b49..4cc2984 100644
--- a/src/java/org/apache/fulcrum/intake/Retrievable.java
+++ b/src/java/org/apache/fulcrum/intake/Retrievable.java
@@ -30,13 +30,18 @@
/**
* get an id that differentiates this object from others
* of its class.
+ *
+ * @return the unique key identifying the object
*/
String getQueryKey();
/**
* set an id that differentiates this object from others
* of its class.
+ *
+ * @param key the identifying key
+ *
+ * @throws Exception if the key could not be set
*/
void setQueryKey(String key) throws Exception;
-
}
diff --git a/src/java/org/apache/fulcrum/intake/model/AppData.java b/src/java/org/apache/fulcrum/intake/model/AppData.java
index 02683bc..4a21b49 100644
--- a/src/java/org/apache/fulcrum/intake/model/AppData.java
+++ b/src/java/org/apache/fulcrum/intake/model/AppData.java
@@ -33,7 +33,7 @@
/**
* A class for holding application data structures.
*
- * @author <a href="mailto:jmcnally@collab.net>John McNally</a>
+ * @author <a href="mailto:jmcnally@collab.net">John McNally</a>
* @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
* @author <a href="mailto:tv@apache.org">Thomas Vandahl</a>
* @version $Id$
@@ -63,6 +63,7 @@
* This method is used in the IntakeService to register all the
* groups with and without prefix in the service.
*
+ * @return the list of groups
*/
public List<Group> getGroups()
{
diff --git a/src/java/org/apache/fulcrum/intake/model/Field.java b/src/java/org/apache/fulcrum/intake/model/Field.java
index f1e6baf..f6af209 100644
--- a/src/java/org/apache/fulcrum/intake/model/Field.java
+++ b/src/java/org/apache/fulcrum/intake/model/Field.java
@@ -42,7 +42,7 @@
* Base class for Intake generated input processing classes.
*
* @author <a href="mailto:jmcnally@collab.net">John McNally</a>
- * @author <a href="mailto:dlr@finemaltcoding.com>Daniel Rall</a>
+ * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
* @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
* @author <a href="mailto:quintonm@bellsouth.net">Quinton McCombs</a>
* @author <a href="mailto:jh@byteaction.de">Jürgen Hoffmann</a>
@@ -107,12 +107,6 @@
/** Is this field always required? This is only set through the XML file */
private boolean alwaysRequired;
- /**
- * Value of the field if an error occurs while getting
- * the value from the mapped object
- */
- private T onError;
-
/** Default value of the field */
protected T defaultValue;
@@ -183,8 +177,6 @@
* @param group a <code>Group</code> value
* @throws IntakeException indicates the validator was not valid or
* could not be loaded.
- * @throws SystemError only occurs is the Validation object does not
- * extend InitableByConstraintMap
*/
public Field(XmlField field, Group group) throws IntakeException
{
@@ -415,6 +407,8 @@
/**
* Get the name of the object that takes this input
+ *
+ * @return the name of the mapped object
*/
public String getMapToObject()
{
@@ -517,6 +511,8 @@
* Use in a hidden field assign a default value in the event the
* field is absent from the query parameters. Used to track checkboxes,
* since they only show up if checked.
+ *
+ * @return the value if not in the request
*/
public String getValueIfAbsent()
{
@@ -575,6 +571,8 @@
* used in building data entry forms and serve as a
* user friendly description of the data contained in
* the field.
+ *
+ * @param newDisplayName the new display name for the field
*/
public void setDisplayName(String newDisplayName)
{
@@ -593,6 +591,8 @@
/**
* Sets an error message. The field is also marked as invalid.
+ *
+ * @param message the new error message
*/
public void setMessage(String message)
{
@@ -601,6 +601,8 @@
}
/**
+ * Set the internal flag that the field has been set
+ *
* @param setFlag the setFlag to set
*/
protected void setSet(boolean setFlag)
@@ -609,6 +611,8 @@
}
/**
+ * Set the internal flag that the field is valid
+ *
* @param validFlag the validFlag to set
*/
protected void setValid(boolean validFlag)
@@ -617,6 +621,8 @@
}
/**
+ * Set the internal flag that the field has been validated
+ *
* @param validated the validated to set
*/
protected void setValidated(boolean validated)
@@ -625,16 +631,9 @@
}
/**
- * @deprecated Call validate() instead (with no parameters).
- */
- @Deprecated
- protected boolean validate(ValueParser pp)
- {
- return validate();
- }
-
- /**
* Compares request data with constraints and sets the valid flag.
+ *
+ * @return true if the validation succeeded
*/
public boolean validate()
{
@@ -757,7 +756,7 @@
* be used as the initial value.
*
* @return an <code>Object</code> value
- * @exception IntakeException indicates the value could not be
+ * @throws IntakeException indicates the value could not be
* returned from the mapped object
*/
public T getInitialValue() throws IntakeException
@@ -790,7 +789,8 @@
/**
* Get the value input by a user that will be validated.
*
- * @return an <code>Object</code> value
+ * @param <TT> the type of the test value
+ * @return an <code>TT</code> value
*/
@SuppressWarnings("unchecked")
public <TT> TT getTestValue()
@@ -826,11 +826,6 @@
val = getTestValue();
}
- if (val == null)
- {
- val = onError;
- }
-
return val;
}
@@ -873,6 +868,8 @@
/**
* Loads the valid value from a bean
*
+ * @param obj the object whose getter to call
+ *
* @throws IntakeException indicates a problem during the execution of the
* object's getter method
*/
@@ -913,6 +910,8 @@
/**
* Calls a setter method on obj, if this field has been set.
*
+ * @param obj the object whose setter to call
+ *
* @throws IntakeException indicates a problem during the execution of the
* object's setter method
*/
@@ -1052,8 +1051,10 @@
/**
* Gets the display size of the field. This is useful when
- * building the HTML input tag. If no displaySize was set,
+ * building the HTML input tag. If no displaySize was set,
* an empty string is returned.
+ *
+ * @return the size information for this field
*/
public String getDisplaySize()
{
@@ -1063,7 +1064,9 @@
/**
* Gets the maximum size of the field. This is useful when
* building the HTML input tag. The maxSize is set with the maxLength
- * rule. If this rule was not set, an empty string is returned.
+ * rule. If this rule was not set, an empty string is returned.
+ *
+ * @return the maximum size information of the field
*/
public String getMaxSize()
{
diff --git a/src/java/org/apache/fulcrum/intake/model/FieldAdapter.java b/src/java/org/apache/fulcrum/intake/model/FieldAdapter.java
index e875834..0c6440d 100644
--- a/src/java/org/apache/fulcrum/intake/model/FieldAdapter.java
+++ b/src/java/org/apache/fulcrum/intake/model/FieldAdapter.java
@@ -201,6 +201,7 @@
* in the xml file.
*
* @param xmlField a <code>XmlField</code> value
+ * @param xmlGroup the group this field belongs to
* @return a <code>Field</code> value
* @throws IntakeException indicates that an unknown type was specified for a field.
*/
diff --git a/src/java/org/apache/fulcrum/intake/model/FileItemField.java b/src/java/org/apache/fulcrum/intake/model/FileItemField.java
index 66ea872..243d5ca 100644
--- a/src/java/org/apache/fulcrum/intake/model/FileItemField.java
+++ b/src/java/org/apache/fulcrum/intake/model/FileItemField.java
@@ -55,10 +55,10 @@
/**
* It is not possible to set the default value for this field type.
* Calling this method with a non-null parameter will result in a
- * TurbineRuntimeException
+ * IntakeRuntimeException
*
* @param prop Parameter for the default values
- * @throws TurbineRuntimeException
+ * @throws IntakeRuntimeException if the parameter is not null
*/
@Override
public void setDefaultValue(String prop)
@@ -76,10 +76,10 @@
/**
* It is not possible to set the empty value for this field type.
* Calling this method with a non-null parameter will result in a
- * TurbineRuntimeException
+ * IntakeRuntimeException
*
* @param prop Parameter for the empty values
- * @throws TurbineRuntimeException
+ * @throws IntakeRuntimeException if the parameter is not null
*/
@Override
public void setEmptyValue(String prop)
@@ -113,7 +113,7 @@
*
* @param vp a <code>ValueParser</code> value
* @return a <code>Field</code> value
- * @exception IntakeException if an error occurs
+ * @throws IntakeException if an error occurs
*/
@Override
public Field<FileItem> init(ValueParser vp)
diff --git a/src/java/org/apache/fulcrum/intake/model/Group.java b/src/java/org/apache/fulcrum/intake/model/Group.java
index 554444d..39d875b 100644
--- a/src/java/org/apache/fulcrum/intake/model/Group.java
+++ b/src/java/org/apache/fulcrum/intake/model/Group.java
@@ -125,7 +125,7 @@
/**
* The object containing the request data
*/
- private ValueParser pp;
+ private transient ValueParser pp;
/**
* A flag to help prevent duplicate hidden fields declaring this group.
@@ -155,6 +155,7 @@
*
* @param pp a <code>ValueParser</code> value
* @return this Group
+ * @throws IntakeException if at least one field could not be initialized
*/
public Group init(ValueParser pp) throws IntakeException
{
@@ -165,8 +166,10 @@
* Initializes the Group with parameters from RunData
* corresponding to key.
*
+ * @param key the group id
* @param pp a <code>ValueParser</code> value
* @return this Group
+ * @throws IntakeException if at least one field could not be initialized
*/
public Group init(String key, ValueParser pp) throws IntakeException
{
@@ -314,7 +317,7 @@
*
* @param pp a <code>ValueParser</code> value
* @return an <code>ArrayList</code> value
- * @exception IntakeException if an error occurs
+ * @throws IntakeException if an error occurs
*/
public List<Group> getObjects(ValueParser pp) throws IntakeException
{
@@ -332,8 +335,10 @@
}
/**
- * Get the Field .
- * @return Field.
+ * Get the Field
+ *
+ * @param fieldName the name of the field
+ * @return the named field
* @throws IntakeException indicates the field could not be found.
*/
public Field<?> get(String fieldName)
@@ -351,7 +356,7 @@
}
/**
- * Get the list of Fields .
+ * Get the list of Fields.
* @return list of Fields
*/
public List<Field<?>> getFields()
@@ -362,7 +367,7 @@
/**
* Set a collection of fields for this group
*
- * @param fields the fields to set
+ * @param inputFields the fields to set
*/
@XmlElement(name="field")
@XmlJavaTypeAdapter(FieldAdapter.class)
@@ -447,6 +452,8 @@
* test passes call setProperties. Use this method when some data is
* known to be invalid, but you still want to set the object properties
* that are valid.
+ *
+ * @param obj the object to set the properties for
*/
public void setValidProperties(Object obj)
{
@@ -591,6 +598,8 @@
/**
* A xhtml valid hidden input field that notifies intake of the
* group's presence.
+ *
+ * @param sb the string builder to append the HTML to
*/
public void appendHtmlFormInput(StringBuilder sb)
{
diff --git a/src/java/org/apache/fulcrum/intake/model/IntegerField.java b/src/java/org/apache/fulcrum/intake/model/IntegerField.java
index 8464b5e..a827a98 100644
--- a/src/java/org/apache/fulcrum/intake/model/IntegerField.java
+++ b/src/java/org/apache/fulcrum/intake/model/IntegerField.java
@@ -61,7 +61,7 @@
return;
}
- defaultValue = new Integer(prop);
+ defaultValue = Integer.valueOf(prop);
}
/**
@@ -82,7 +82,7 @@
return;
}
- emptyValue = new Integer(prop);
+ emptyValue = Integer.valueOf(prop);
}
/**
diff --git a/src/java/org/apache/fulcrum/intake/model/LongField.java b/src/java/org/apache/fulcrum/intake/model/LongField.java
index f979791..066d349 100644
--- a/src/java/org/apache/fulcrum/intake/model/LongField.java
+++ b/src/java/org/apache/fulcrum/intake/model/LongField.java
@@ -61,7 +61,7 @@
return;
}
- defaultValue = new Long(prop);
+ defaultValue = Long.valueOf(prop);
}
/**
@@ -82,7 +82,7 @@
return;
}
- emptyValue = new Long(prop);
+ emptyValue = Long.valueOf(prop);
}
/**
diff --git a/src/java/org/apache/fulcrum/intake/model/ShortField.java b/src/java/org/apache/fulcrum/intake/model/ShortField.java
index ab0d44f..5d23e7b 100644
--- a/src/java/org/apache/fulcrum/intake/model/ShortField.java
+++ b/src/java/org/apache/fulcrum/intake/model/ShortField.java
@@ -61,7 +61,7 @@
return;
}
- defaultValue = new Short(prop);
+ defaultValue = Short.valueOf(prop);
}
/**
@@ -82,7 +82,7 @@
return;
}
- emptyValue = new Short(prop);
+ emptyValue = Short.valueOf(prop);
}
/**
diff --git a/src/java/org/apache/fulcrum/intake/model/XmlField.java b/src/java/org/apache/fulcrum/intake/model/XmlField.java
index 72601b1..6c479e8 100644
--- a/src/java/org/apache/fulcrum/intake/model/XmlField.java
+++ b/src/java/org/apache/fulcrum/intake/model/XmlField.java
@@ -121,6 +121,8 @@
/**
* Return Avalon logger
+ *
+ * @return the logger
*/
public Logger getLogger()
{
@@ -129,6 +131,8 @@
/**
* Get the name of the property
+ *
+ * @return the raw name of the property
*/
public String getRawName()
{
@@ -137,6 +141,8 @@
/**
* Get the name of the property
+ *
+ * @return the name of the property with underscores removed
*/
public String getName()
{
@@ -145,6 +151,8 @@
/**
* Get the display name of the property
+ *
+ * @return the display name of the property
*/
public String getDisplayName()
{
@@ -154,6 +162,8 @@
/**
* Gets the display size of the field. This is
* useful for constructing the HTML input tag.
+ *
+ * @return the display size for the field
*/
public String getDisplaySize()
{
@@ -162,6 +172,8 @@
/**
* Get the parameter key of the property
+ *
+ * @return the key of the property
*/
public String getKey()
{
@@ -170,6 +182,8 @@
/**
* Get the type of the property
+ *
+ * @return the type of the field
*/
public String getType()
{
@@ -177,7 +191,9 @@
}
/**
- * can this field have several values?
+ * Can this field have several values?
+ *
+ * @return true if the field can have multiple values
*/
public boolean isMultiValued()
{
@@ -186,6 +202,8 @@
/**
* Get the name of the object that takes this input
+ *
+ * @return the name of the mapped object
*/
public String getMapToObject()
{
@@ -194,6 +212,8 @@
/**
* Get the property method that takes this input
+ *
+ * @return the property this field is mapped to
*/
public String getMapToProperty()
{
@@ -209,6 +229,8 @@
/**
* Get the className of the validator
+ *
+ * @return the validator class name
*/
public String getValidator()
{
@@ -237,6 +259,8 @@
/**
* Get the parent XmlGroup of the field
+ *
+ * @return the group this field belongs to
*/
public Group getGroup()
{
@@ -317,6 +341,8 @@
/**
* String representation of the column. This
* is an xml representation.
+ *
+ * @return the value of this field as an XML representation
*/
@Override
public String toString()
diff --git a/src/java/org/apache/fulcrum/intake/validator/BigDecimalValidator.java b/src/java/org/apache/fulcrum/intake/validator/BigDecimalValidator.java
index b41f553..72b914a 100644
--- a/src/java/org/apache/fulcrum/intake/validator/BigDecimalValidator.java
+++ b/src/java/org/apache/fulcrum/intake/validator/BigDecimalValidator.java
@@ -30,6 +30,7 @@
* listed in NumberValidator and DefaultValidator.
*
* <table>
+ * <caption>Validation rules</caption>
* <tr><th>Name</th><th>Valid Values</th><th>Default Value</th></tr>
* <tr><td>minValue</td><td>greater than BigDecimal minValue</td>
* <td> </td></tr>
diff --git a/src/java/org/apache/fulcrum/intake/validator/BooleanValidator.java b/src/java/org/apache/fulcrum/intake/validator/BooleanValidator.java
index 7d42e91..3bd5191 100644
--- a/src/java/org/apache/fulcrum/intake/validator/BooleanValidator.java
+++ b/src/java/org/apache/fulcrum/intake/validator/BooleanValidator.java
@@ -76,7 +76,7 @@
* in the constraints defined for this validator
*
* @param testValue a <code>String</code> to be tested
- * @exception ValidationException containing an error message if the
+ * @throws ValidationException containing an error message if the
* testValue did not pass the validation tests.
*/
@Override
@@ -102,7 +102,8 @@
* Parses a string value into a Boolean object.
*
* @param stringValue the value to parse
- * @return a <code>Boolean</a> object
+ * @return a <code>Boolean</code> object
+ * @throws ParseException if the value cannot be parsed to a boolean
*/
public Boolean parse(String stringValue)
throws ParseException
diff --git a/src/java/org/apache/fulcrum/intake/validator/Constraint.java b/src/java/org/apache/fulcrum/intake/validator/Constraint.java
index ec5c2b8..331e8d3 100644
--- a/src/java/org/apache/fulcrum/intake/validator/Constraint.java
+++ b/src/java/org/apache/fulcrum/intake/validator/Constraint.java
@@ -36,16 +36,22 @@
{
/**
* Get the name of the constraint.
+ *
+ * @return the constraint name
*/
String getName();
/**
* Get the value of the constraint.
+ *
+ * @return the constraint value
*/
String getValue();
/**
* Get the error message.
+ *
+ * @return the constraint error message
*/
String getMessage();
}
diff --git a/src/java/org/apache/fulcrum/intake/validator/DateRangeValidator.java b/src/java/org/apache/fulcrum/intake/validator/DateRangeValidator.java
index 4fa134a..7a5d220 100644
--- a/src/java/org/apache/fulcrum/intake/validator/DateRangeValidator.java
+++ b/src/java/org/apache/fulcrum/intake/validator/DateRangeValidator.java
@@ -34,6 +34,7 @@
* Validates a DateString field in dependency on another DateString field.
*
* <table>
+ * <caption>Validation rules</caption>
* <tr>
* <th>Name</th><th>Valid Values</th><th>Default Value</th>
* </tr>
@@ -82,8 +83,8 @@
/**
* Constructor to use when initializing Object
*
- * @param paramMap
- * @throws InvalidMaskException
+ * @param paramMap a map of parameters
+ * @throws InvalidMaskException one of the mask rules is invalid
*/
@Override
public void init(Map<String, ? extends Constraint> paramMap)
@@ -162,7 +163,7 @@
* in the constraints defined for this validator
*
* @param testField a <code>Field</code> to be tested
- * @exception ValidationException containing an error message if the
+ * @throws ValidationException containing an error message if the
* testValue did not pass the validation tests.
*/
@Override
@@ -197,7 +198,7 @@
* @param testValue a <code>String</code> to be tested
* @param group the group this field belongs to
*
- * @exception ValidationException containing an error message if the
+ * @throws ValidationException containing an error message if the
* testValue did not pass the validation tests.
*/
public void assertValidity(final String testValue, final Group group)
diff --git a/src/java/org/apache/fulcrum/intake/validator/DateStringValidator.java b/src/java/org/apache/fulcrum/intake/validator/DateStringValidator.java
index 966e28c..6b24326 100644
--- a/src/java/org/apache/fulcrum/intake/validator/DateStringValidator.java
+++ b/src/java/org/apache/fulcrum/intake/validator/DateStringValidator.java
@@ -33,6 +33,7 @@
* listed in DefaultValidator.
*
* <table>
+ * <caption>Validation rules</caption>
* <tr><th>Name</th><th>Valid Values</th><th>Default Value</th></tr>
* <tr><td>format</td><td>see SimpleDateFormat javadoc</td>
* <td> </td></tr>
@@ -79,8 +80,8 @@
/**
* Constructor to use when initializing Object
*
- * @param paramMap
- * @throws InvalidMaskException
+ * @param paramMap a map of parameters
+ * @throws InvalidMaskException one of the mask rules is invalid
*/
@Override
public void init(Map<String, ? extends Constraint> paramMap)
@@ -127,7 +128,7 @@
* in the constraints defined for this validator
*
* @param testValue a <code>String</code> to be tested
- * @exception ValidationException containing an error message if the
+ * @throws ValidationException containing an error message if the
* testValue did not pass the validation tests.
*/
@Override
@@ -157,6 +158,8 @@
* format that includes a 4 digit year, but that will parse the date using
* a format that accepts 2 digit years.
*
+ * @param s possibly a date string
+ * @return the date parsed
* @throws ParseException indicates that the string could not be
* parsed into a date.
*/
diff --git a/src/java/org/apache/fulcrum/intake/validator/DefaultValidator.java b/src/java/org/apache/fulcrum/intake/validator/DefaultValidator.java
index dcb3b31..dfd1171 100644
--- a/src/java/org/apache/fulcrum/intake/validator/DefaultValidator.java
+++ b/src/java/org/apache/fulcrum/intake/validator/DefaultValidator.java
@@ -31,6 +31,7 @@
* constraints:
*
* <table>
+ * <caption>Validation rules</caption>
* <tr><th>Name</th><th>Valid Values</th><th>Default Value</th></tr>
* <tr><td>required</td><td>true|false</td><td>false</td></tr>
* <tr><td>mask</td><td>regexp</td><td> </td></tr>
@@ -92,11 +93,11 @@
/**
* Extract the relevant parameters from the constraints listed
- * in <rule> tags within the intake.xml file.
+ * in <rule> tags within the intake.xml file.
*
* @param paramMap a <code>Map</code> of <code>Rule</code>'s
* containing constraints on the input.
- * @exception InvalidMaskException An invalid mask was specified for one of the rules
+ * @throws InvalidMaskException An invalid mask was specified for one of the rules
*/
@Override
public void init(Map<String, ? extends Constraint> paramMap)
@@ -155,7 +156,7 @@
* in the constraints defined for this validator
*
* @param field a <code>Field</code> to be tested
- * @exception ValidationException containing an error message if the
+ * @throws ValidationException containing an error message if the
* testValue did not pass the validation tests.
*/
@Override
@@ -186,6 +187,7 @@
*
* @deprecated use isValid(Field) instead
*/
+ @Deprecated
@Override
public boolean isValid(String testValue)
{
@@ -207,7 +209,7 @@
* in the constraints defined for this validator
*
* @param testValue a <code>String</code> to be tested
- * @exception ValidationException containing an error message if the
+ * @throws ValidationException containing an error message if the
* testValue did not pass the validation tests.
*/
@Override
diff --git a/src/java/org/apache/fulcrum/intake/validator/DoubleValidator.java b/src/java/org/apache/fulcrum/intake/validator/DoubleValidator.java
index e677b25..bbf22ae 100644
--- a/src/java/org/apache/fulcrum/intake/validator/DoubleValidator.java
+++ b/src/java/org/apache/fulcrum/intake/validator/DoubleValidator.java
@@ -28,6 +28,7 @@
* listed in NumberValidator and DefaultValidator.
*
* <table>
+ * <caption>Validation rules</caption>
* <tr><th>Name</th><th>Valid Values</th><th>Default Value</th></tr>
* <tr><td>minValue</td><td>greater than Double.MIN_VALUE</td>
* <td> </td></tr>
diff --git a/src/java/org/apache/fulcrum/intake/validator/FieldReference.java b/src/java/org/apache/fulcrum/intake/validator/FieldReference.java
index 390d4cb..10e35e1 100644
--- a/src/java/org/apache/fulcrum/intake/validator/FieldReference.java
+++ b/src/java/org/apache/fulcrum/intake/validator/FieldReference.java
@@ -30,6 +30,7 @@
* comparisons are supported:
*
* <table>
+ * <caption>Validation rules</caption>
* <tr>
* <th>Name</th><th>Valid Values</th><th>Default Value</th>
* </tr>
@@ -188,7 +189,9 @@
* @param value the parsed value of the related field
* @param group the group the related field belongs to
*
- * @throws ValidationException
+ * @param <T> the field type
+ *
+ * @throws ValidationException if the validation against at least one related field fails
*/
public static <T> void checkReferences(List<FieldReference> fieldReferences, CompareCallback<T> compareCallback,
T value, Group group)
diff --git a/src/java/org/apache/fulcrum/intake/validator/FileValidator.java b/src/java/org/apache/fulcrum/intake/validator/FileValidator.java
index 7718f4c..6ebbbb9 100644
--- a/src/java/org/apache/fulcrum/intake/validator/FileValidator.java
+++ b/src/java/org/apache/fulcrum/intake/validator/FileValidator.java
@@ -48,7 +48,7 @@
* in the constraints defined for this validator
*
* @param testValue a <code>FileItem</code> to be tested
- * @exception ValidationException containing an error message if the
+ * @throws ValidationException containing an error message if the
* testValue did not pass the validation tests.
*/
public void assertValidity(FileItem testValue)
diff --git a/src/java/org/apache/fulcrum/intake/validator/FloatValidator.java b/src/java/org/apache/fulcrum/intake/validator/FloatValidator.java
index 578795d..97aa332 100644
--- a/src/java/org/apache/fulcrum/intake/validator/FloatValidator.java
+++ b/src/java/org/apache/fulcrum/intake/validator/FloatValidator.java
@@ -28,6 +28,7 @@
* listed in NumberValidator and DefaultValidator.
*
* <table>
+ * <caption>Validation rules</caption>
* <tr><th>Name</th><th>Valid Values</th><th>Default Value</th></tr>
* <tr><td>minValue</td><td>greater than Float.MIN_VALUE</td>
* <td> </td></tr>
diff --git a/src/java/org/apache/fulcrum/intake/validator/InitableByConstraintMap.java b/src/java/org/apache/fulcrum/intake/validator/InitableByConstraintMap.java
index 620ca25..cefdb74 100644
--- a/src/java/org/apache/fulcrum/intake/validator/InitableByConstraintMap.java
+++ b/src/java/org/apache/fulcrum/intake/validator/InitableByConstraintMap.java
@@ -32,11 +32,11 @@
{
/**
* Extract the relevant parameters from the constraints listed
- * in <input-param> tags within the intake.xml file.
+ * in <input-param> tags within the intake.xml file.
*
* @param inputParameters a <code>Map</code> of <code>Constraint</code>'s
* containing rules and error messages.
- * @exception InvalidMaskException one of the mask rules is invalid
+ * @throws InvalidMaskException one of the mask rules is invalid
*/
void init(Map<String, ? extends Constraint> inputParameters)
throws InvalidMaskException;
diff --git a/src/java/org/apache/fulcrum/intake/validator/IntegerRangeValidator.java b/src/java/org/apache/fulcrum/intake/validator/IntegerRangeValidator.java
index cb1d19a..2aa3fdd 100644
--- a/src/java/org/apache/fulcrum/intake/validator/IntegerRangeValidator.java
+++ b/src/java/org/apache/fulcrum/intake/validator/IntegerRangeValidator.java
@@ -33,6 +33,7 @@
* Validates an int field in dependency on another int field.
*
* <table>
+ * <caption>Validation rules</caption>
* <tr>
* <th>Name</th><th>Valid Values</th><th>Default Value</th>
* </tr>
@@ -81,8 +82,8 @@
/**
* Constructor to use when initializing Object
*
- * @param paramMap
- * @throws InvalidMaskException
+ * @param paramMap a map of parameters
+ * @throws InvalidMaskException one of the mask rules is invalid
*/
@Override
public void init(Map<String, ? extends Constraint> paramMap)
@@ -161,7 +162,7 @@
* in the constraints defined for this validator
*
* @param testField a <code>Field</code> to be tested
- * @exception ValidationException containing an error message if the
+ * @throws ValidationException containing an error message if the
* testValue did not pass the validation tests.
*/
@Override
@@ -198,7 +199,7 @@
* @param group the group this field belongs to
* @param locale the locale for this field
*
- * @exception ValidationException containing an error message if the
+ * @throws ValidationException containing an error message if the
* testValue did not pass the validation tests.
*/
public void assertValidity(final String testValue, final Group group, final Locale locale)
diff --git a/src/java/org/apache/fulcrum/intake/validator/IntegerValidator.java b/src/java/org/apache/fulcrum/intake/validator/IntegerValidator.java
index f9a0355..0dac034 100644
--- a/src/java/org/apache/fulcrum/intake/validator/IntegerValidator.java
+++ b/src/java/org/apache/fulcrum/intake/validator/IntegerValidator.java
@@ -26,6 +26,7 @@
* listed in NumberValidator and DefaultValidator.
*
* <table>
+ * <caption>Validation rules</caption>
* <tr><th>Name</th><th>Valid Values</th><th>Default Value</th></tr>
* <tr><td>minValue</td><td>greater than Integer.MIN_VALUE</td>
* <td> </td></tr>
diff --git a/src/java/org/apache/fulcrum/intake/validator/LongValidator.java b/src/java/org/apache/fulcrum/intake/validator/LongValidator.java
index 3b83c9b..e195cb5 100644
--- a/src/java/org/apache/fulcrum/intake/validator/LongValidator.java
+++ b/src/java/org/apache/fulcrum/intake/validator/LongValidator.java
@@ -26,6 +26,7 @@
* listed in NumberValidator and DefaultValidator.
*
* <table>
+ * <caption>Validation rules</caption>
* <tr><th>Name</th><th>Valid Values</th><th>Default Value</th></tr>
* <tr><td>minValue</td><td>greater than Long.MIN_VALUE</td>
* <td> </td></tr>
diff --git a/src/java/org/apache/fulcrum/intake/validator/NumberValidator.java b/src/java/org/apache/fulcrum/intake/validator/NumberValidator.java
index df0ad81..618f3f6 100644
--- a/src/java/org/apache/fulcrum/intake/validator/NumberValidator.java
+++ b/src/java/org/apache/fulcrum/intake/validator/NumberValidator.java
@@ -30,6 +30,7 @@
* listed in DefaultValidator.
*
* <table>
+ * <caption>Validation rules</caption>
* <tr><th>Name</th><th>Valid Values</th><th>Default Value</th></tr>
* <tr><td>minValue</td><td>greater than BigDecimal.MIN_VALUE</td>
* <td> </td></tr>
@@ -69,11 +70,11 @@
/**
* Extract the relevant parameters from the constraints listed
- * in <rule> tags within the intake.xml file.
+ * in <rule> tags within the intake.xml file.
*
* @param paramMap a <code>Map</code> of <code>rule</code>'s
* containing constraints on the input.
- * @exception InvalidMaskException an invalid mask was specified
+ * @throws InvalidMaskException an invalid mask was specified
*/
@Override
public void init(Map<String, ? extends Constraint> paramMap)
@@ -136,7 +137,7 @@
* in the constraints defined for this validator
*
* @param field a <code>Field</code> to be tested
- * @exception ValidationException containing an error message if the
+ * @throws ValidationException containing an error message if the
* testValue did not pass the validation tests.
*/
@Override
@@ -165,7 +166,7 @@
*
* @param testValue a <code>String</code> to be tested
* @param locale the Locale of the associated field
- * @exception ValidationException containing an error message if the
+ * @throws ValidationException containing an error message if the
* testValue did not pass the validation tests.
*/
public void assertValidity(String testValue, Locale locale) throws ValidationException
diff --git a/src/java/org/apache/fulcrum/intake/validator/ShortValidator.java b/src/java/org/apache/fulcrum/intake/validator/ShortValidator.java
index f146736..63f478b 100644
--- a/src/java/org/apache/fulcrum/intake/validator/ShortValidator.java
+++ b/src/java/org/apache/fulcrum/intake/validator/ShortValidator.java
@@ -26,6 +26,7 @@
* listed in NumberValidator and DefaultValidator.
*
* <table>
+ * <caption>Validation rules</caption>
* <tr><th>Name</th><th>Valid Values</th><th>Default Value</th></tr>
* <tr><td>minValue</td><td>greater than Short.MIN_VALUE</td>
* <td> </td></tr>
diff --git a/src/java/org/apache/fulcrum/intake/validator/StringValidator.java b/src/java/org/apache/fulcrum/intake/validator/StringValidator.java
index 68c4d7b..5fc086c 100644
--- a/src/java/org/apache/fulcrum/intake/validator/StringValidator.java
+++ b/src/java/org/apache/fulcrum/intake/validator/StringValidator.java
@@ -29,6 +29,7 @@
* A validator that will compare a testValue against the following
* constraints:
* <table>
+ * <caption>Validation rules</caption>
* <tr><th>Name</th><th>Valid Values</th><th>Default Value</th></tr>
* <tr><td>required</td><td>true|false</td><td>false</td></tr>
* <tr><td>mask</td><td>regexp</td><td> </td></tr>
@@ -67,11 +68,11 @@
/**
* Extract the relevant parameters from the constraints listed
- * in <rule> tags within the intake.xml file.
+ * in <rule> tags within the intake.xml file.
*
* @param paramMap a <code>Map</code> of <code>Rule</code>'s
* containing constraints on the input.
- * @exception InvalidMaskException An invalid mask was specified for one of the rules
+ * @throws InvalidMaskException An invalid mask was specified for one of the rules
*/
@Override
public void init(Map<String, ? extends Constraint> paramMap)
@@ -94,7 +95,7 @@
* in the constraints defined for this validator
*
* @param testValue a <code>String</code> to be tested
- * @exception ValidationException containing an error message if the
+ * @throws ValidationException containing an error message if the
* testValue did not pass the validation tests.
*/
@Override
diff --git a/src/java/org/apache/fulcrum/intake/validator/Validator.java b/src/java/org/apache/fulcrum/intake/validator/Validator.java
index 3784739..fb2b6ea 100644
--- a/src/java/org/apache/fulcrum/intake/validator/Validator.java
+++ b/src/java/org/apache/fulcrum/intake/validator/Validator.java
@@ -71,7 +71,7 @@
* in the constraints defined for this validator
*
* @param field a <code>Field</code> to be tested
- * @exception ValidationException containing an error message if the
+ * @throws ValidationException containing an error message if the
* testValue did not pass the validation tests.
*/
void assertValidity(Field<T> field)
@@ -93,7 +93,7 @@
* in the constraints defined for this validator
*
* @param testValue a <code>String</code> to be tested
- * @exception ValidationException containing an error message if the
+ * @throws ValidationException containing an error message if the
* testValue did not pass the validation tests.
*/
void assertValidity(String testValue)
diff --git a/src/test/org/apache/fulcrum/intake/test/AnotherForm.java b/src/test/org/apache/fulcrum/intake/test/AnotherForm.java
index 935814b..2e3762e 100644
--- a/src/test/org/apache/fulcrum/intake/test/AnotherForm.java
+++ b/src/test/org/apache/fulcrum/intake/test/AnotherForm.java
@@ -1,6 +1,5 @@
package org.apache.fulcrum.intake.test;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,28 +19,31 @@
* under the License.
*/
-
/**
* Test form for Intake
*
* @author <a href="mailto:epugh@upstate.com">epugh@upstate.com</a>
* @version $Id$
*/
-public class AnotherForm {
+public class AnotherForm
+{
- private String username;
- /**
- * @return
- */
- public String getUsername() {
- return username;
- }
+ private String username;
- /**
- * @param username
- */
- public void setUsername(String username) {
- this.username = username;
- }
+ /**
+ * @return the user name
+ */
+ public String getUsername()
+ {
+ return username;
+ }
+
+ /**
+ * @param username
+ */
+ public void setUsername(String username)
+ {
+ this.username = username;
+ }
}
diff --git a/src/test/org/apache/fulcrum/intake/test/MyField.java b/src/test/org/apache/fulcrum/intake/test/MyField.java
index 6038a53..9251cda 100644
--- a/src/test/org/apache/fulcrum/intake/test/MyField.java
+++ b/src/test/org/apache/fulcrum/intake/test/MyField.java
@@ -26,6 +26,9 @@
public class MyField extends StringField
{
+ /** Serial version */
+ private static final long serialVersionUID = 1L;
+
public MyField(XmlField field, Group group) throws IntakeException
{
super(field, group);