See: Description
Class | Description |
---|---|
ConfigElement |
Superclass for all config element tags.
|
ConfigParser |
The class for parsing a Nyx-style XML config file.
|
Annotation Type | Description |
---|---|
DefaultPackage |
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
) or a property (reflected by a class field).ConfigElement
When an XML element is read, a class for its name is searched using the following rules:
.
), prepend the context package (specified by a context
attribute in the root element, otherwise defaults to the org.projectnyx.properties
package, or set
programmatically using ConfigParser.setPackageContext(java.lang.String)
)<NyxConfig>
resolves to org.projectnyx.properties.NyxConfig
<.Foo.Bar>
resolves to
org.projectnyx.properties.Foo.Bar
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()
.
Copyright © 2016. All rights reserved.