public class RecoveringUDA10DeviceDescriptorBinderImpl extends UDA10DeviceDescriptorBinderImpl
Constructor and Description |
---|
RecoveringUDA10DeviceDescriptorBinderImpl() |
Modifier and Type | Method and Description |
---|---|
<D extends Device> |
describe(D undescribedDevice,
String descriptorXml) |
protected String |
fixGarbageTrailingChars(String descriptorXml,
DescriptorBindingException ex) |
protected String |
fixMissingNamespaces(String descriptorXml,
DescriptorBindingException ex) |
protected void |
handleInvalidDescriptor(String xml,
DescriptorBindingException exception)
Handle processing errors while reading XML descriptors.
|
protected <D extends Device> |
handleInvalidDevice(String xml,
D device,
ValidationException exception)
Handle processing errors while binding XML descriptors.
|
buildDOM, buildInstance, describe, error, fatalError, generate, generateDevice, generateDeviceList, generateIconList, generateRoot, generateServiceList, generateSpecVersion, hydrateDevice, hydrateDeviceList, hydrateIconList, hydrateRoot, hydrateServiceList, hydrateSpecVersion, parseURI, warning
public RecoveringUDA10DeviceDescriptorBinderImpl()
public <D extends Device> D describe(D undescribedDevice, String descriptorXml) throws DescriptorBindingException, ValidationException
describe
in interface DeviceDescriptorBinder
describe
in class UDA10DeviceDescriptorBinderImpl
DescriptorBindingException
ValidationException
protected String fixGarbageTrailingChars(String descriptorXml, DescriptorBindingException ex)
protected String fixMissingNamespaces(String descriptorXml, DescriptorBindingException ex)
protected void handleInvalidDescriptor(String xml, DescriptorBindingException exception) throws DescriptorBindingException
Typically you want to log this problem or create an error report, and in any
case, throw a DescriptorBindingException
to notify the caller of the
binder of this failure. The default implementation simply rethrows the
given exception.
xml
- The original XML causing the parsing failure.exception
- The original exception while parsing the XML.DescriptorBindingException
protected <D extends Device> D handleInvalidDevice(String xml, D device, ValidationException exception) throws ValidationException
Typically you want to log this problem or create an error report. You
should throw a ValidationException
to notify the caller of the
binder of failure. The default implementation simply rethrows the
given exception.
This method gives you a final chance to fix the problem, instead of
throwing an exception, you could try to create valid Device
model and return it.
xml
- The original XML causing the binding failure.device
- The unfinished Device
that failed validationexception
- The errors found when validating the Device
model.Device
model, instead of throwing an exception.ValidationException
Copyright © 2016 4th Line GmbH, Switzerland. All rights reserved.