We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HI
I wonder, if I could create new object instances from my properties in ".xml" file. Suppose I have a class Person with few fields:
class Person { String name; Integer age; public Person(String name, Integer age) { //omitted } //getters and setters }
And Configuration.xml:
<properties> <person> <name>Vas</name> <age>22</age> </person> </properties
And interface:
interface Configuration extends Config { @Key("properties.person") Person samplePerson(); }
So how can I create some instance like that:
class TestDrive { public static void main(String[] args) { Configuration config = ConfigFactory.create(Configuration.class); Person Andry = config.samplePerson(); System.out.println(Andry.getName()); // Vas System.out.println(Andry.getAge); // 22 } }
The text was updated successfully, but these errors were encountered:
Hi @vaspoz
This would be nice, but at the moment it is not supported. It sounds similar to #45 and #129.
At the moment I don't think this can be done with existing features.
Sorry, something went wrong.
No branches or pull requests
HI
I wonder, if I could create new object instances from my properties in ".xml" file.
Suppose I have a class Person with few fields:
And Configuration.xml:
And interface:
So how can I create some instance like that:
The text was updated successfully, but these errors were encountered: