Examples of marshal()


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

      try {
        context = JAXBContext.newInstance(rootClass);
        Marshaller marshaller = context.createMarshaller();
        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
        Object example = rootClass.getConstructor(OServerConfigurationLoaderXml.class).newInstance(this);
        marshaller.marshal(example, System.out);
      } catch (Exception ex) {
      }

      throw new IOException(e);
    }
View Full Code Here

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

  public void save(final OServerConfiguration iRootObject) throws IOException {
    try {
      context = JAXBContext.newInstance(rootClass);
      Marshaller marshaller = context.createMarshaller();
      marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
      marshaller.marshal(iRootObject, new FileWriter(file));
    } catch (JAXBException e) {
      throw new IOException(e);
    }
  }
View Full Code Here

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

      Marshaller marshaller = context.createMarshaller();
      marshaller.setSchema(s);
      marshaller.setEventHandler(monitor);
      Document doc = getTargetDocument();
     
      marshaller.marshal(event.getMarshallableType(), doc);
      //dumpDocument(doc, "c:/doc.xml");
     
      /*Unmarshaller unmarshaller = context.createUnmarshaller();
      unmarshaller.setSchema(s);
      unmarshaller.setEventHandler(monitor);
View Full Code Here

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

        Document doc = getTargetDocument();
       
        if (obj instanceof JaxbEventBase) {
          JaxbEventBase jeb = (JaxbEventBase)obj;
          marshaller.marshal(jeb.getMarshallableType(), doc);
        } else {
          marshaller.marshal(obj, doc);
        }
        result = doc.getDocumentElement();
      } catch (JAXBException e) {
View Full Code Here

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

       
        if (obj instanceof JaxbEventBase) {
          JaxbEventBase jeb = (JaxbEventBase)obj;
          marshaller.marshal(jeb.getMarshallableType(), doc);
        } else {
          marshaller.marshal(obj, doc);
        }
        result = doc.getDocumentElement();
      } catch (JAXBException e) {
        throw new TranslationException("Unable to marshall response", e); //$NON-NLS-1$
      } catch (Exception e) {
View Full Code Here

Examples of javax.xml.bind.annotation.adapters.HexBinaryAdapter.marshal()

    md.update(password.getBytes(UTF_8));
    md.update(user.getBytes(UTF_8));
    tempDigest = md.digest();

    byte[] hexDigest = hex.marshal(tempDigest).toLowerCase().getBytes(US_ASCII);

    md.update(hexDigest);
    md.update(salt);
    passDigest = md.digest();
View Full Code Here

Examples of javax.xml.bind.annotation.adapters.XmlAdapter.marshal()

    protected Object checkAdapter(Object obj, Annotation[] anns) {
        XmlJavaTypeAdapter typeAdapter = AnnotationUtils.getAnnotation(anns, XmlJavaTypeAdapter.class);
        if (typeAdapter != null) {
            try {
                XmlAdapter xmlAdapter = typeAdapter.value().newInstance();
                return xmlAdapter.marshal(obj);
            } catch (Exception ex) {
                LOG.warning("Problem using the XmlJavaTypeAdapter");
                ex.printStackTrace();
            }
        }
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfo.marshal()

    public static void main(String[] args) throws Exception {
        KeyInfoFactory fac = KeyInfoFactory.getInstance();
        KeyInfo ki = fac.newKeyInfo
            (Collections.singletonList(fac.newKeyName("foo")), "keyid");
        try {
            ki.marshal(null, null);
            throw new Exception("Should raise a NullPointerException");
        } catch (NullPointerException npe) {}

        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
View Full Code Here

Examples of net.buffalo.protocal.converters.Converter.marshal()

  public void convertAnother(Object value) {
    if (value == null) {
      converterLookup.getNullConverter().marshal(value, this, streamWriter);
    } else {
      Converter converter = converterLookup.lookupConverterForType(value.getClass());
      converter.marshal(value, this, streamWriter);
    }
  }

  public List getObjects() {
    return this.objects;
View Full Code Here

Examples of net.buffalo.protocal.converters.SqlDateConverter.marshal()

    StringWriter stringWriter = new StringWriter();
    StreamWriter streamWriter = new FastStreamWriter(stringWriter);
   
    DefaultConverterLookup defaultConverterLookup = new DefaultConverterLookup();
    MarshallingContext context = new DefaultMarshallingContext(defaultConverterLookup, streamWriter);
    converter.marshal(sdate, context, streamWriter);
   
    String string = "<map><type>java.sql.Date</type><string>value</string><date>20061101T000000Z</date></map>";
    assertEquals(string,
        stringWriter.getBuffer().toString());
   
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.