/** * Creates a {@code Binder} for W3C DOM. * * @return always a new valid {@code Binder} object. * * @since 1.6, JAXB 2.0 */ public Binder<Node> createBinder() { return createBinder(Node.class); }
binder = jc.createBinder(); JaxbValidationEventHandler eventHandler = new JaxbValidationEventHandler(); eventHandler.setContinue(false);
binder = jc.createBinder(); JaxbValidationEventHandler eventHandler = new JaxbValidationEventHandler(); eventHandler.setContinue(false);
binder = jc.createBinder(); binder = jc.createBinder(); binder.setEventHandler(eventHandler); jaxbElement = (E) XmlUtils.unwrap(binder.unmarshal( doc ));
/** * @return {@link Binder} * @see javax.xml.bind.JAXBContext#createBinder() */ public Binder<Node> createBinder() { return wrappedContext.createBinder(); }
/** * @param <T> type * @param domType dom class * @return {@link Binder} * @see javax.xml.bind.JAXBContext#createBinder(java.lang.Class) */ public <T> Binder<T> createBinder(Class<T> domType) { return wrappedContext.createBinder(domType); }
binder = getJaxbContext().createBinder(); } catch (JAXBException e) { throw new BeanDefinitionStoreException("Failed to create the JAXB binder", e);
@Override protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { doBeforeParse(element); super.doParse(element, parserContext, builder); // now lets parse the routes with JAXB Binder<Node> binder; try { binder = getJaxbContext().createBinder(); } catch (JAXBException e) { throw new BeanDefinitionStoreException("Failed to create the JAXB binder", e); } Object value = parseUsingJaxb(element, parserContext, binder); if (value instanceof CamelEndpointFactoryBean) { CamelEndpointFactoryBean factoryBean = (CamelEndpointFactoryBean) value; builder.addPropertyValue("properties", factoryBean.getProperties()); } } }
binder = getJaxbContext().createBinder(); } catch (JAXBException e) { throw new BeanDefinitionStoreException("Failed to create the JAXB binder", e);
@Override protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { doBeforeParse(element); super.doParse(element, parserContext, builder); // now lets parse the routes with JAXB Binder<Node> binder; try { binder = getJaxbContext().createBinder(); } catch (JAXBException e) { throw new BeanDefinitionStoreException("Failed to create the JAXB binder", e); } Object value = parseUsingJaxb(element, parserContext, binder); if (value instanceof CamelRestContextFactoryBean) { CamelRestContextFactoryBean factoryBean = (CamelRestContextFactoryBean) value; builder.addPropertyValue("rests", factoryBean.getRests()); } // lets inject the namespaces into any namespace aware POJOs injectNamespaces(element, binder); } }
@Override protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { doBeforeParse(element); super.doParse(element, parserContext, builder); // now lets parse the routes with JAXB Binder<Node> binder; try { binder = getJaxbContext().createBinder(); } catch (JAXBException e) { throw new BeanDefinitionStoreException("Failed to create the JAXB binder", e); } Object value = parseUsingJaxb(element, parserContext, binder); if (value instanceof CamelRouteContextFactoryBean) { CamelRouteContextFactoryBean factoryBean = (CamelRouteContextFactoryBean) value; builder.addPropertyValue("routes", factoryBean.getRoutes()); } // lets inject the namespaces into any namespace aware POJOs injectNamespaces(element, binder); } }
/** * Creates a <tt>Binder</tt> for W3C DOM. * * @return always a new valid <tt>Binder</tt> object. * * @since JAXB2.0 */ public Binder<Node> createBinder() { return createBinder(Node.class); }
/** * Creates a <tt>Binder</tt> for W3C DOM. * * @return always a new valid <tt>Binder</tt> object. * * @since JAXB2.0 */ public Binder<Node> createBinder() { return createBinder(Node.class); }
/** * Creates a <tt>Binder</tt> for W3C DOM. * * @return always a new valid <tt>Binder</tt> object. * * @since JAXB2.0 */ public Binder<Node> createBinder() { return createBinder(Node.class); }
/** * Creates a {@code Binder} for W3C DOM. * * @return always a new valid {@code Binder} object. * * @since 1.6, JAXB 2.0 */ public Binder<Node> createBinder() { return createBinder(Node.class); }
/** * Creates a <tt>Binder</tt> for W3C DOM. * * @return always a new valid <tt>Binder</tt> object. * * @since JAXB2.0 */ public Binder<Node> createBinder() { return createBinder(Node.class); }
/** * Creates a {@code Binder} for W3C DOM. * * @return always a new valid {@code Binder} object. * * @since 1.6, JAXB 2.0 */ public Binder<Node> createBinder() { return createBinder(Node.class); }
JAXBContext jc = JAXBContext.newInstance(Customer.class); Binder<Node> binder = jc.createBinder(); Customer customer = (Customer) binder.unmarshal(document); customer.getAddress().setStreet("2 NEW STREET"); binder.updateXML(customer);
private Object convertToJAXBObject(Source source) throws Exception { //this is entirely to work around http://java.net/jira/browse/JAXB-909 //if that bug is ever fixed and we can detect it, we can remove this //complete and total HACK HACK HACK and replace with just: //Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); //JAXBElement<?> jaxbElement = (JAXBElement<?>) unmarshaller.unmarshal(source); //return jaxbElement.getValue(); Document d = StaxUtils.read(source); Binder<Node> binder = jaxbContext.createBinder(); JAXBElement<?> jaxbElement = (JAXBElement<?>)binder.unmarshal(d); walkDom("", d.getDocumentElement(), binder, null); return jaxbElement.getValue(); }
private Object convertToJAXBObject(Source source) throws Exception { //this is entirely to work around http://java.net/jira/browse/JAXB-909 //if that bug is ever fixed and we can detect it, we can remove this //complete and total HACK HACK HACK and replace with just: //Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); //JAXBElement<?> jaxbElement = (JAXBElement<?>) unmarshaller.unmarshal(source); //return jaxbElement.getValue(); Document d = StaxUtils.read(source); Binder<Node> binder = jaxbContext.createBinder(); JAXBElement<?> jaxbElement = (JAXBElement<?>)binder.unmarshal(d); walkDom("", d.getDocumentElement(), binder, null); return jaxbElement.getValue(); }