Skip navigation links

Package org.projectnyx.config

This package reads XML-encoded configs whose structure is reflected by runtime Java classes.

See: Description

Package org.projectnyx.config Description

This package reads XML-encoded configs whose structure is reflected by runtime Java classes.

Each XML element in the config either represents an object (reflected by a class that extends ConfigElement) or a property (reflected by a class field).

When an XML element is read, a class for its name is searched using the following rules:

If such class exists and it extends ConfigElement, an instance of this class will be created and added to the its parent element (if any). The parser will search through the declared fields (not any inherited fields) to find a suitable List field that this element can be added into. If no available fields are found, it will be added into ConfigElement.getOtherChildren().

If this class does not exist, it will be parsed as an attribute instead. (If it is the root element, an error will be thrown) If a field in the current element has the same name as this tag's name, the current field will be converted into the type required by this field. If no such field is found, the string will be added as-is into ConfigElement.getOtherAttributes().

Skip navigation links

Copyright © 2016. All rights reserved.