dlr 2002/10/10 10:49:53
Modified: src/java/org/apache/velocity/runtime/resource Resource.java
Log:
Added JavaDoc to process() spurred by investigatin of Ilkka's "Less
messages from ContentResource" patch.
The JavaDoc I added brings up an interesting dichotomy between the
Template and ContentResource classes -- the former currently always
throws a ResourceNotFoundException when it can't find a template,
while with Ilkka's patch the latter will be returning false instead.
It seems to be that these should act in a consistent manner, so
perhaps I'll simply have ContentResource re-throw any
ResourceNotFoundException it encounters in process() (rather than
returning false).
Though this makes things consistent and seems to use
ResourceNotFoundException as intended, it still leaves the API open to
too much interpretation. More JavaDoc on the process() method which
suggests when it is appropriate to return false would be very help.
Please chime in on this one guys.
Revision Changes Path
1.10 +8 -1
jakarta-velocity/src/java/org/apache/velocity/runtime/resource/Resource.java
Index: Resource.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/resource/Resource.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -u -r1.9 -r1.10
--- Resource.java 22 Oct 2001 03:53:25 -0000 1.9
+++ Resource.java 10 Oct 2002 17:49:53 -0000 1.10
@@ -142,6 +142,13 @@
* to be done by a resource. In the case of a template
* the actual parsing of the input stream needs to be
* performed.
+ *
+ * @return Whether the resource could be processed successfully.
+ * For a {@link org.apache.velocity.Template} or {@link
+ * org.apache.velocity.runtime.resource.ContentResource}, this
+ * indicates whether the resource could be read.
+ * @exception ResourceNotFoundException Similar in semantics as
+ * returning <code>false</code>.
*/
public abstract boolean process()
throws ResourceNotFoundException, ParseErrorException, Exception;
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>