cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Re: Strengthening setup() contract
Date Wed, 19 Mar 2003 14:54:00 GMT
Vadim Gritsenko wrote:

> Jeff Turner wrote:
>
>> Hi,
>>
>> Generator, Reader and Transformer all inherit from
>> SitemapModelComponent, which declares the setup() method:
>>
>> public interface SitemapModelComponent extends Component {
>>    /**
>>     * Set the <code>SourceResolver</code>, objectModel
>>     * <code>Map</code>, the source and sitemap <code>Parameters</code>
>>     * used to process the request.
>>     */
>>    void setup(SourceResolver resolver, Map objectModel, String src, 
>> Parameters par)
>>        throws ProcessingException, SAXException, IOException;
>> }
>>
>> If there's no objections, I would like to:
>> - assert in the Javadoc that 'src' will never be null
>>
>
> Some generators do not require src attribute.

Yep.

>> - modify AbstractProcessingPipeline to ensure this, and throw meaningful
>>   exceptions otherwise.
>>
>> Currently, leaving out the 'src' attribute causes a typically unhelpful
>> Cocoon error message:
>>
>> java.net.MalformedURLException: Invalid System ID
>>
>
> May be add more helpful message to the AbstractGenerator / 
> AbstractTransformer?

Nope, as we still don't know there if the "src" attribute will be of 
real use. This is the job of each concrete implementation, or at least a 
common superclass that actually does something with the "src".

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }



Mime
View raw message