commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CONFIGURATION-549) User guide: Validation of XML configuration files: config.load()
Date Thu, 27 Jun 2013 19:59:20 GMT

    [ https://issues.apache.org/jira/browse/CONFIGURATION-549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13695008#comment-13695008
] 

Oliver Heger commented on CONFIGURATION-549:
--------------------------------------------

The example in the user guide is correct. It uses the default constructor to create the configuration
object, sets the file name, and finally calls {{load()}}.

In the documentation of {{load()}} and also in the user's guide (http://commons.apache.org/proper/commons-configuration/userguide/howto_filebased.html#Loading)
it is stated that this method does not clear the configuration. So what you experience is
expected behavior.

Nevertheless, currently development is ongoing on a redesigned (and incompatible) version
2.0. In this version, so-called _configuration builders_ will be used to create and initialize
configuration instances. It is then no longer necessary to call the {{load()}} method explicitly.
This should simplify the creation of configuration objects and hopefully avoid misunderstandings.
                
> User guide: Validation of XML configuration files: config.load()
> ----------------------------------------------------------------
>
>                 Key: CONFIGURATION-549
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-549
>             Project: Commons Configuration
>          Issue Type: Improvement
>          Components: Documentation
>            Reporter: Andy Schönemann
>            Priority: Minor
>
> In the following section of the user guide it would be a good point to write, that when
you use {{config.load()}} to activate the previously set validation of the schema, the default
behavior is that your configuration file is "cloned":
> http://commons.apache.org/proper/commons-configuration/userguide/howto_xml.html#Validation_of_XML_configuration_files
> That means, that calls of {{config.getList(...)}} will contain all results twice!
> Perhaps you better use {{config.refresh()}} here? The using of {{config.reload()}} does
not activate the validation of the schema.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message