Represents a Java bean configured via XML. This class essentially is a much more simple version of Spring. Java objects are loosely configured with this class using reflection and method/field names matching elements in an xml document.
An element in an xml document represents a property that will be set on a Java object. This class supports nested Java objects and their configuration as well. Nested objects are first retrieved via a getter. If they are null, this class will create a new instance with the default empty constructor.
Java objects can first be programmatically configured via Java code followed by overrides in an xml document. Or, Java objects can be configured over and over again by multiple xml documents. Also, a subset of "xpath" is supported to allow elements inside an xml document to become the "root" of the xml document.
Also, a Java object is permitted to throw exceptions when a property is set and that exception will be rethrown inside a PropertyInvocationException. Properties are converted to their Java equivalents based on the Class type of the property of the Java object.
Sample Java Classes: {@code}public class Server public void setPort(int port) { this.port = value; } public void setHost(String value) { this.host = value; } } public class Config { public void setServer(Server value) { this.server = value; } }}
Sample XML: {@code www.google.com 80 }
Sample Client Java Code: {@code XmlBean bean = new XmlBean(); Config config = new Config(); bean.configure(xml, config);}
@author joelauer