I would like to create a class in Java based on the fields defined in the XML configuration file:
For example: if the XML file contains (syntax has been cracked for publication):
<property name="agent_host"></property> <property name="subsystem"></property>
then inside he will create a class event, such as Event (String agentHost, String subSystem), which the client can create. Note: the client always knows that this class will be called "Event", but does not know how many "required parameters" it needs to pass.
On the other hand, if I have an XML file with:
<property name="agent_host"></property>
then it will create an event (String eventHost) that the client can use to create the instance.
source share