Hi Ede,

I'm not aware of a mechanism to define a default value in XML2Java framework. Currently, the default behaviour is to throw an exception if an attribute defined in a .java2xml configuration file is not there (null). Warning instead of throwing an exception is just a nasty hack we added to assure backward compatibility (attribute names logging a warn message are hard-coded in the XML2Java class).

It could make sense to add a "default" attribute in the .java2xml object specification to manage this kind of situation in a proper way. Ex :

<attribute xml-name="interior" java-name="interiorBorder" default="false"/>

I can do a Feature Request in that way if you think it is a good idea.

Michaël


envoyé : 27 décembre 2020 à 16:38
de : edgar.sol...@web.de
à : jump-pilot-devel@lists.sourceforge.net
objet : Re: [JPP-Devel] Some Sextante tools don't like negative pixel values


Mike,

On 23.12.2020 11:42, Rahkonen Jukka (MML) wrote:

- about the warning : yes, this warning has been added with the interior border capability. Maybe it is not really useful. It throws a warning because 'interior' attribute is not really an optional tag, but it is accepted (hard-coded exception) in order to guarantee backward compatibility.

is there a specific reason why it is mandatory as opposed to just use a default value when it is missing? isn't it safe to assume we come from a old version if it is missing?

..ede


_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to