|
From: Hans B. <ben...@ch...> - 2003-12-10 15:33:54
|
Hi,
sort of answering my own mail...
I have now found a way to fill those Properties in JTidyPipelineStage, but
though it seems to work for me, I am not sure, whether reading the values
from the ConfigOptions directly and not via the getOptionList method,
causes any trouble.
Any comments?
Thanks,
Hans
-------------
revision 1.5:
-------------
protected Properties getConfigProperties() {
String[] optionKeys =
(String[]) getInfo().getOptions().toArray(new String[0]);
com.babeldoc.core.NameValuePair[] options =
this.getOptionList(optionKeys);
Properties configProperties = new Properties();
for (int i = 0; i < options.length; i++) {
configProperties.put(options[i].getName(), options[i].getValue());
}
return configProperties;
}
--------------
my workaround:
--------------
protected Properties getConfigProperties() {
Properties configProperties = new Properties();
for (Iterator it=getInfo().getOptions().iterator();it.hasNext();) {
ConfigOption opt = (ConfigOption)it.next();
if (opt.getValue()!=null) {
configProperties.put(opt.getName(), opt.getValue());
}
}
return configProperties;
}
On Thu, 4 Dec 2003, Hans Benedict wrote:
> Hi to all,
>
> I am trying to use JTidyPipelineStage the first time since 1.0.2, but it
> throws the following exception:
>
> -------------
> java.lang.ArrayStoreException
> at
> java.util.AbstractCollection.toArray(AbstractCollection.java:174)
> at
> com.babeldoc.core.pipeline.stage.JTidyPipelineStage.getConfigProperties(JTidyPipelineStage.java:336)
> at
> com.babeldoc.core.pipeline.stage.JTidyPipelineStage.process(JTidyPipelineStage.java:291)
> ------------
>
> I assume that casting the ConfigOptions from getOptions() to Strings in
> line 337
> ---
> String[] optionKeys = (String[]) getInfo().getOptions().toArray(new String[0]);
> ---
> causes the problem, but at the moment I have no idea what to do instead
>
> Any suggestions?
>
> Regards,
> Hans
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive? Does it
> help you create better code? SHARE THE LOVE, and help us help
> YOU! Click Here: http://sourceforge.net/donate/
> _______________________________________________
> Babeldoc-devel mailing list
> Bab...@li...
> https://lists.sourceforge.net/lists/listinfo/babeldoc-devel
>
|