public void setProperty(String name, Object value) throws PropertyException { if (name == null) throw new IllegalArgumentException(Messages.NULL_PROPERTY_NAME.format()); // exclude RI properties that don't make sense for Binder if (excludeProperty(name)) { throw new PropertyException(name, value); } PropertyException pe = null; try { getMarshaller().setProperty(name, value); return; } catch (PropertyException p) { pe = p; } try { getUnmarshaller().setProperty(name, value); return; } catch (PropertyException p) { pe = p; } // replace the stacktrace - we don't want to see a trace // originating from Un|Marshaller.setProperty pe.setStackTrace(Thread.currentThread().getStackTrace()); throw pe; }
public void setProperty(String name, Object value) throws PropertyException { if (name == null) throw new IllegalArgumentException(Messages.NULL_PROPERTY_NAME.format()); // exclude RI properties that don't make sense for Binder if (excludeProperty(name)) { throw new PropertyException(name, value); } PropertyException pe = null; try { getMarshaller().setProperty(name, value); return; } catch (PropertyException p) { pe = p; } try { getUnmarshaller().setProperty(name, value); return; } catch (PropertyException p) { pe = p; } // replace the stacktrace - we don't want to see a trace // originating from Un|Marshaller.setProperty pe.setStackTrace(Thread.currentThread().getStackTrace()); throw pe; }
@SuppressWarnings("rawtypes") @Override public MarshallerImpl decorate(MarshallerImpl target, CdataXml annotation, Class type, Annotation[] annotations, MediaType mediaType) { try { target.setProperty("com.sun.xml.bind.marshaller.CharacterEscapeHandler", new CdataXmlEscapeHandler("UTF-8")); } catch (PropertyException e) { throw new RuntimeException("Could not decorate marshaller!", e); } return target; } }
public void setProperty(String name, Object value) throws PropertyException { if (name == null) throw new IllegalArgumentException(Messages.NULL_PROPERTY_NAME.format()); // exclude RI properties that don't make sense for Binder if (excludeProperty(name)) { throw new PropertyException(name, value); } PropertyException pe = null; try { getMarshaller().setProperty(name, value); return; } catch (PropertyException p) { pe = p; } try { getUnmarshaller().setProperty(name, value); return; } catch (PropertyException p) { pe = p; } // replace the stacktrace - we don't want to see a trace // originating from Un|Marshaller.setProperty pe.setStackTrace(Thread.currentThread().getStackTrace()); throw pe; }
public void setProperty(String name, Object value) throws PropertyException { if (name == null) throw new IllegalArgumentException(Messages.NULL_PROPERTY_NAME.format()); // exclude RI properties that don't make sense for Binder if (excludeProperty(name)) { throw new PropertyException(name, value); } PropertyException pe = null; try { getMarshaller().setProperty(name, value); return; } catch (PropertyException p) { pe = p; } try { getUnmarshaller().setProperty(name, value); return; } catch (PropertyException p) { pe = p; } // replace the stacktrace - we don't want to see a trace // originating from Un|Marshaller.setProperty pe.setStackTrace(Thread.currentThread().getStackTrace()); throw pe; }