Package javax.xml.bind

Examples of javax.xml.bind.Marshaller.marshal()


            xrds.getOtherelement().add(xrd);

            Marshaller marshaller = jaxbContext.createMarshaller();
            marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
            marshaller.marshal(xrds, writer);
        } catch (JAXBException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here


            entityDescriptor.getRoleDescriptorOrIDPSSODescriptorOrSPSSODescriptor().add(spSsoDescriptor);

            Marshaller marshaller = metaDataJaxbContext.createMarshaller();
            marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
            marshaller.marshal(metaDataFactory.createEntityDescriptor(entityDescriptor), writer);
        } catch (JAXBException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

            entityDescriptor.getRoleDescriptorOrIDPSSODescriptorOrSPSSODescriptor().add(idpSsoDescriptor);

            Marshaller marshaller = metaDataJaxbContext.createMarshaller();
            marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
            marshaller.marshal(metaDataFactory.createEntityDescriptor(entityDescriptor), writer);
        } catch (JAXBException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

    try {
      final JAXBContext context = JAXBContext.newInstance(AbstractSqlResourceMetaData.class);
      final Marshaller marshaller = context.createMarshaller();
      marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
      final StringWriter writer = new StringWriter();
      marshaller.marshal(this, writer);
      return writer.toString();
    } catch (final JAXBException exception) {
      return exception.toString();
    }
  }
View Full Code Here

  public static String marshallJAXBObject(String namespace, Object o, boolean addXMLDeclaration) throws JAXBException {
    JAXBContext jc = getJAXBContext(namespace);
    Marshaller marshaller = jc.createMarshaller();
    marshaller.setProperty("com.sun.xml.bind.xmlDeclaration", addXMLDeclaration);
    StringWriter sw = new StringWriter();
    marshaller.marshal(o, sw);
    return sw.toString();
  }
 
  public static JAXBContext getJAXBContext(String namespace) throws JAXBException {
    if (!JAXBContextInstances.containsKey(namespace))
View Full Code Here

      Marshaller marshaller = jaxbHelper.createMarshaller();

      // OpsSecretEncryptionStrategy strategy = new OpsSecretEncryptionStrategy(itemSecret);
      // strategy.setAdapter(marshaller);

      marshaller.marshal(mutableItem, writer);
    } catch (JAXBException e) {
      throw new IllegalArgumentException("Could not serialize data", e);
    }
    String xml = writer.toString();
View Full Code Here

        StringWriter xmlReq = new StringWriter();
        Marshaller marshaller = getJaxbContext().createMarshaller();
        marshaller.setProperty( "jaxb.formatted.output",
                                true );
        marshaller.marshal( cmd,
                            xmlReq );

        System.out.println( xmlReq.toString() );

        String xmlCmd = "";
View Full Code Here

        StringWriter xmlReq = new StringWriter();
        Marshaller marshaller = getJaxbContext().createMarshaller();
        marshaller.setProperty( "jaxb.formatted.output",
                                true );
        marshaller.marshal( cmd,
                            xmlReq );

        System.out.println( xmlReq.toString() );

        byte[] xmlResp = (byte[]) template.requestBody( "direct:test-with-session",
View Full Code Here

        StringWriter xmlReq = new StringWriter();
        Marshaller marshaller = getJaxbContext().createMarshaller();
        marshaller.setProperty( "jaxb.formatted.output",
                                true );
        marshaller.marshal( cmd,
                            xmlReq );

        System.out.println( xmlReq.toString() );

        byte[] xmlResp = (byte[]) template.requestBody( "direct:test-with-session",
View Full Code Here

        StringWriter xmlReq = new StringWriter();
        Marshaller marshaller = getJaxbContext().createMarshaller();
        marshaller.setProperty( "jaxb.formatted.output",
                                true );
        marshaller.marshal( cmd,
                            xmlReq );

        byte[] xmlResp = (byte[]) template.requestBody( "direct:test-with-session",
                                                        xmlReq.toString() );
        assertNotNull( xmlResp );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.