Le Jeudi, 4 mars 2004, � 22:56 Europe/Zurich, Sylvain Wallez a �crit :
....Although individual parameter location may be useful, the location parameter I'm talking about is that of the statement. This makes me think "SitemapParameters" with a "getStatementLocation()" is better than "LocatedParameters" I suggested above.
Let's consider the following snippet: 10 ... 11 <map:generate src="foo.xml"> 12 <map:parameter name="bar" value="baz"/> 13 </map:parameter> 14 ...
((SitemapParameters)parameters).getStatementLocation() --> "sitemap.xmap:11:2"
parameters.getLocation("bar") --> "sitemap.xmap:12:4"
getLocation(name) can be useful to notify a problem about a particular parameter, while getStatementLocation() relates to the whole > statement.
getLocation(name) can also be useful for Parameterizable components, as it replaces Configuration.getLocation() which is no more available.
Sounds good, having both is certainly useful for error reporting.
Just a detail, how about casting to a SitemapLocation interface instead of classes?
((SitemapLocation)parameters).getStatementLocation() --> "sitemap.xmap:11:2"
And assuming you get plain Parameters
((SitemapLocation)parameters).getParameterLocation("bar") -> "sitemap.xmap:12:4"
-Bertrand
