Class TrdpConfig
java.lang.Object
com.trdp.config.TrdpConfig
Loads TRDP device configuration from XML files conforming to the IEC 61375-2-3
trdp-config.xsd schema.
The XML is first validated against the XSD (bundled on the classpath), then
deserialized into an immutable DeviceConfig object graph.
Usage:
DeviceConfig config = TrdpConfig.load(Path.of("trdp-config.xml"));
for (BusInterface bi : config.getBusInterfaces()) {
System.out.println(bi.getName() + " -> " + bi.getTelegrams().size() + " telegrams");
}
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic DeviceConfigload(InputStream inputStream) Loads and validates a TRDP configuration from the given input stream.static DeviceConfigLoads and validates a TRDP configuration from the given file path.
-
Method Details
-
load
Loads and validates a TRDP configuration from the given file path.- Parameters:
path- the path to the XML configuration file.- Returns:
- the parsed device configuration.
- Throws:
TrdpConfigException- if the file cannot be read, fails XSD validation, or cannot be deserialized.
-
load
Loads and validates a TRDP configuration from the given input stream.- Parameters:
inputStream- the input stream containing the XML configuration.- Returns:
- the parsed device configuration.
- Throws:
TrdpConfigException- if the stream cannot be read, fails XSD validation, or cannot be deserialized.
-