@Override public void setConfiguration(XmlToObjectConverterConfiguration configuration) { this.configuration = configuration; marshaller = new Jaxb2Marshaller(); if (StringUtils.isNotEmpty(configuration.getContextPath())){ marshaller.setContextPath(configuration.getContextPath()); } else if (ArrayUtils.isNotEmpty(configuration.getContextPaths())){ marshaller.setContextPaths(configuration.getContextPaths()); } else if (ArrayUtils.isNotEmpty(configuration.getClassesToBeBound())){ marshaller.setClassesToBeBound(configuration.getClassesToBeBound()); } marshaller.setUnmarshallerProperties(configuration.getUnmarshallerProperties()); marshaller.setMarshallerProperties(configuration.getMarshallerProperties()); if (configuration.getValidationEventHandler() != null) { marshaller.setValidationEventHandler(configuration.getValidationEventHandler()); } try { marshaller.afterPropertiesSet(); } catch (Exception e) { throw new ConfigurationException(e.getMessage()); } }
@Override public void setConfiguration(XmlStringToObjectConfiguration configuration) { this.configuration = configuration; marshaller = new Jaxb2Marshaller(); if (StringUtils.isNotEmpty(configuration.getContextPath())){ marshaller.setContextPath(configuration.getContextPath()); } else if (ArrayUtils.isNotEmpty(configuration.getContextPaths())){ marshaller.setContextPaths(configuration.getContextPaths()); } else if (ArrayUtils.isNotEmpty(configuration.getClassesToBeBound())){ marshaller.setClassesToBeBound(configuration.getClassesToBeBound()); } marshaller.setUnmarshallerProperties(configuration.getUnmarshallerProperties()); marshaller.setMarshallerProperties(configuration.getMarshallerProperties()); if (configuration.getValidationEventHandler() != null) { marshaller.setValidationEventHandler(configuration.getValidationEventHandler()); } try { marshaller.afterPropertiesSet(); } catch (Exception e) { throw new ConfigurationException(e.getMessage()); } }