You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Henning Schmiedehausen (JIRA)" <ji...@apache.org> on 2006/11/01 12:14:19 UTC

[jira] Reopened: (VELOCITY-423) Report invalid references

     [ http://issues.apache.org/jira/browse/VELOCITY-423?page=all ]

Henning Schmiedehausen reopened VELOCITY-423:
---------------------------------------------

             
The following Javadoc Issues were introduced by the patches related here. As Javadocs are currently the most important documentation for this feature, it would be good if the docs are really up to date to the function. I e.g. hunted for quite a while for *what* is returned from invalidGetMethod()...

  [javadoc] /home/scratch/velocity/engine/bin/src/org/apache/velocity/app/event/EventHandlerMethodExecutor.java:47: warning - @return tag has no arguments.
  [javadoc] /home/scratch/velocity/engine/bin/src/org/apache/velocity/app/event/EventHandlerUtil.java:248: warning - @return tag has no arguments.
  [javadoc] /home/scratch/velocity/engine/bin/src/org/apache/velocity/app/event/EventHandlerUtil.java:296: warning - @return tag has no arguments.
  [javadoc] /home/scratch/velocity/engine/bin/src/org/apache/velocity/app/event/EventHandlerUtil.java:316: warning - @return tag has no arguments.
  [javadoc] /home/scratch/velocity/engine/bin/src/org/apache/velocity/app/event/EventHandlerUtil.java:271: warning - @param argument "reference" is not a parameter name.
  [javadoc] /home/scratch/velocity/engine/bin/src/org/apache/velocity/app/event/EventHandlerUtil.java:271: warning - @param argument "object" is not a parameter name.
  [javadoc] /home/scratch/velocity/engine/bin/src/org/apache/velocity/app/event/EventHandlerUtil.java:271: warning - @param argument "property" is not a parameter name.
  [javadoc] /home/scratch/velocity/engine/bin/src/org/apache/velocity/app/event/InvalidReferenceEventHandler.java:70: warning - @param argument "property" is not a parameter name.
  [javadoc] /home/scratch/velocity/engine/bin/src/org/apache/velocity/app/event/InvalidReferenceEventHandler.java:70: warning - @param argument "if" is not a parameter name.
  [javadoc] /home/scratch/velocity/engine/bin/src/org/apache/velocity/app/event/MethodExceptionEventHandler.java:83: warning - @return tag cannot be used in method with void return type.
  [javadoc] /home/scratch/velocity/engine/bin/src/org/apache/velocity/app/event/implement/ReportInvalidReferences.java:131: warning - @param argument "reference" is not a parameter name.
  [javadoc] /home/scratch/velocity/engine/bin/src/org/apache/velocity/app/event/implement/ReportInvalidReferences.java:131: warning - @param argument "object" is not a parameter name.
  [javadoc] /home/scratch/velocity/engine/bin/src/org/apache/velocity/app/event/implement/ReportInvalidReferences.java:131: warning - @param argument "method" is not a parameter name.
  [javadoc] /home/scratch/velocity/engine/bin/src/org/apache/velocity/app/event/implement/ReportInvalidReferences.java:131: warning - @param argument "always" is not a parameter name.


> Report invalid references
> -------------------------
>
>                 Key: VELOCITY-423
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-423
>             Project: Velocity
>          Issue Type: New Feature
>          Components: Source
>            Reporter: Will Glass-Husain
>         Assigned To: Will Glass-Husain
>             Fix For: 1.5
>
>         Attachments: invalidreference.txt
>
>
> I've made a new patch that includes a ReferenceInsertionEventHandler ("InvalidReferenceHandler") that collects a list of all invalid references in a Velocity page.
> To see how it works, look at the test code (the last two methods) in BuiltInEventHandlerTestCase.
> To make this work, I had to make some changes to the internals.  So I thought I'd hold off a couple days before committing, let any interested parties comment. 
> There's a couple of interesting new pieces for plugin writers.
> (1) In any user-defined plugin (event handlers, uberspectors, etc) you can now throw a subclass of VelocityRuntimeException (new exception).  to signal unrecoverable states to the calling application.  This runtime exception requires no change to the interface signature and is passed through the Velocity parsing process.  (In the past, all Exceptions were caught and logged).
> Example use: a custom uberspector or event handler that wishes to stop page processing.  For example, the InvalidReferenceHandler can be configured to throw an exception at the first reference error.
> (2) Event handlers can now receive information on the template name, line number, and column by implementing InfoAware.  This only works for Local event handlers attached to a context (as opposed to the new Global type defined in Velocity properties).  
> Example use: InvalidReferenceHandler reports out the line,column, and template name of each reference error.
> Everything is completely backwards compatible.  It'd be simpler if it wasn't of course as they we could just redo the interfaces.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org