Package org.jupnp.binding.xml
Klasse RecoveringUDA10DeviceDescriptorBinderImpl
java.lang.Object
org.jupnp.binding.xml.UDA10DeviceDescriptorBinderImpl
org.jupnp.binding.xml.RecoveringUDA10DeviceDescriptorBinderImpl
- Alle implementierten Schnittstellen:
DeviceDescriptorBinder,ErrorHandler
- Autor:
- Michael Pujos, Kai Kreuzer - added faulty descriptors as found by Belkin WeMo, Roland Edelhoff - avoid description of Sonos group devices, Jochen Hiller - use SpecificationViolationReporter, change logger to be final
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibung<D extends Device>
Dprotected StringfixGarbageTrailingChars(String descriptorXml, DescriptorBindingException e) protected StringfixMimeTypes(String descriptorXml) protected StringfixMissingNamespaces(String descriptorXml, DescriptorBindingException e) protected StringfixWemoMakerUDN(String descriptorXml) protected StringfixWrongNamespaces(String descriptorXml) protected voidhandleInvalidDescriptor(String xml, DescriptorBindingException exception) Handle processing errors while reading XML descriptors.protected <D extends Device>
DhandleInvalidDevice(String xml, D device, ValidationException exception) Handle processing errors while binding XML descriptors.Von Klasse geerbte Methoden org.jupnp.binding.xml.UDA10DeviceDescriptorBinderImpl
buildDOM, buildInstance, describe, error, fatalError, generate, generateDevice, generateDeviceList, generateIconList, generateRoot, generateServiceList, generateSpecVersion, hydrateDevice, hydrateDeviceList, hydrateIconList, hydrateRoot, hydrateServiceList, hydrateSpecVersion, parseURI, warning
-
Konstruktordetails
-
RecoveringUDA10DeviceDescriptorBinderImpl
public RecoveringUDA10DeviceDescriptorBinderImpl()
-
-
Methodendetails
-
describe
public <D extends Device> D describe(D undescribedDevice, String descriptorXml) throws DescriptorBindingException, ValidationException - Angegeben von:
describein SchnittstelleDeviceDescriptorBinder- Setzt außer Kraft:
describein KlasseUDA10DeviceDescriptorBinderImpl- Löst aus:
DescriptorBindingExceptionValidationException
-
fixGarbageTrailingChars
-
fixMimeTypes
-
fixWrongNamespaces
-
fixMissingNamespaces
-
fixWemoMakerUDN
-
handleInvalidDescriptor
protected void handleInvalidDescriptor(String xml, DescriptorBindingException exception) throws DescriptorBindingException Handle processing errors while reading XML descriptors.Typically you want to log this problem or create an error report, and in any case, throw a
DescriptorBindingExceptionto notify the caller of the binder of this failure. The default implementation simply rethrows the given exception.- Parameter:
xml- The original XML causing the parsing failure.exception- The original exception while parsing the XML.- Löst aus:
DescriptorBindingException
-
handleInvalidDevice
protected <D extends Device> D handleInvalidDevice(String xml, D device, ValidationException exception) throws ValidationException Handle processing errors while binding XML descriptors.Typically you want to log this problem or create an error report. You should throw a
ValidationExceptionto 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
Devicemodel and return it.- Parameter:
xml- The original XML causing the binding failure.device- The unfinishedDevicethat failed validationexception- The errors found when validating theDevicemodel.- Gibt zurück:
- Device A "fixed"
Devicemodel, instead of throwing an exception. - Löst aus:
ValidationException
-