@Override public void setAdapter(XmlAdapter adapter) { jaxbMarshaller.setAdapter(adapter); }
@Override public <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter) { jaxbMarshaller.setAdapter(type, adapter); }
/** * Template method that can be overridden by concrete JAXB marshallers for custom initialization behavior. * Gets called after creation of JAXB {@code Marshaller}, and after the respective properties have been set. * <p>The default implementation sets the {@link #setMarshallerProperties(Map) defined properties}, the {@link * #setValidationEventHandler(ValidationEventHandler) validation event handler}, the {@link #setSchemas(Resource[]) * schemas}, {@link #setMarshallerListener(javax.xml.bind.Marshaller.Listener) listener}, and * {@link #setAdapters(XmlAdapter[]) adapters}. */ protected void initJaxbMarshaller(Marshaller marshaller) throws JAXBException { if (this.marshallerProperties != null) { for (String name : this.marshallerProperties.keySet()) { marshaller.setProperty(name, this.marshallerProperties.get(name)); } } if (this.marshallerListener != null) { marshaller.setListener(this.marshallerListener); } if (this.validationEventHandler != null) { marshaller.setEventHandler(this.validationEventHandler); } if (this.adapters != null) { for (XmlAdapter<?, ?> adapter : this.adapters) { marshaller.setAdapter(adapter); } } if (this.schema != null) { marshaller.setSchema(this.schema); } }
@Override protected void customizeMarshaller(Marshaller marshaller) { marshaller.setAdapter(new MyCustomElementAdapter()); }
public <A extends XmlAdapter> void setAdapter(Class<A> aClass, A a) { marshaller.setAdapter(aClass, a); }
public void setAdapter(XmlAdapter xmlAdapter) { marshaller.setAdapter(xmlAdapter); }
public <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter) { jaxbMarshaller.setAdapter(type, adapter); }
public void setAdapter(XmlAdapter adapter) { jaxbMarshaller.setAdapter(adapter); }
/** * {@inheritDoc} */ @Override public <A extends XmlAdapter> void setAdapter( final Class<A> type, final A adapter ) { marshaller.setAdapter( type, adapter ); }
@SuppressWarnings("rawtypes") @Override public void setAdapter(XmlAdapter adapter) { marshaller.setAdapter(adapter); }
@SuppressWarnings("rawtypes") @Override public <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter) { marshaller.setAdapter(type, adapter); }
/** * {@inheritDoc} */ @Override public void setAdapter( final XmlAdapter adapter ) { marshaller.setAdapter( adapter ); }
/** * Replaces the {@code sis-metadata} adapter by this adapter. */ @Override public void register(final Marshaller marshaller) { marshaller.setAdapter(org.apache.sis.internal.jaxb.gml.SC_VerticalCRS.class, this); }
Marshaller marshaller = context.createMarshaller(); ABeanAdapterList adapterList = new ABeanAdapterList(); marshaller.setAdapter(adapterList); ABeanAdapterImpl beanAdapter = new ABeanAdapterImpl(adapterList); marshaller.setAdapter(beanAdapter); marshaller.marshal(sBean, new File("testSBean.xml"));
private String marshallObject(MyObject myObject) throws JAXBException{ JAXBContext jaxbContext = JAXBContext.newInstance(MyObject.class); Marshaller jaxbMarshaller = jaxbContext.createMarshaller(); jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); jaxbMarshaller.setAdapter(new CalendarDateTimeAdapter()); StringWriter sw = new StringWriter(); jaxbMarshaller.marshal(myObject, sw); String output = sw.toString(); return output; }
/** * Delegates to the wrapped marshaller. The initial state will be saved * if it was not already done, for future restoration by {@link #reset(Pooled)}. */ @Override @SuppressWarnings("rawtypes") public <A extends XmlAdapter> void setAdapter(final Class<A> type, final A adapter) { super.setAdapter(type, adapter); marshaller.setAdapter(type, adapter); }
/** * Delegates to the wrapped marshaller. The initial state will be saved * if it was not already done, for future restoration by {@link #reset(Pooled)}. */ @Override @SuppressWarnings("rawtypes") public <A extends XmlAdapter> void setAdapter(final Class<A> type, final A adapter) { super.setAdapter(type, adapter); marshaller.setAdapter(type, adapter); }
@Override protected Marshaller getMarshaller( final Class<?> type, final Annotation[] annotations, final MediaType mediaType) { final Marshaller marshaller = super.getMarshaller(type, annotations, mediaType); marshaller.setAdapter(PersistentEntityAdapter.class, new PersistentEntityAdapter() { @Override protected BookmarkService getBookmarkService() { return getServicesInjector().lookupServiceElseFail(BookmarkService.class); } }); return marshaller; }
@Override protected void configure(final Marshaller marshaller) { marshaller.setAdapter(PersistentEntityAdapter.class, serviceRegistry.injectServicesInto(new PersistentEntityAdapter())); marshaller.setAdapter(PersistentEntitiesAdapter.class, serviceRegistry.injectServicesInto(new PersistentEntitiesAdapter())); }
private JAXBElement getEK(Marshaller writer) throws JAXBException, XWSSecurityException{ CVAdapter adapter = new CVAdapter(dep); writer.setAdapter(CVAdapter.class,adapter); com.sun.xml.security.core.xenc.ObjectFactory obj = new com.sun.xml.security.core.xenc.ObjectFactory(); return obj.createEncryptedKey(ekt); }