Examples of unmarshalDocument()


Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

           
            // unmarshal customer information from file
            IBindingFactory bfact = BindingDirectory.getFactory(Order.class);
            IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
            FileInputStream in = new FileInputStream(args[0]);
            Order order = (Order)uctx.unmarshalDocument(in, null);
           
            // compute the total amount of the order
            float total = 0.0f;
            for (Iterator<Item> iter = order.getItems().iterator(); iter.hasNext();) {
                Item item = iter.next();
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

           
            // unmarshal customer information from file
            IBindingFactory bfact = BindingDirectory.getFactory(Order.class);
            IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
            FileInputStream in = new FileInputStream(args[0]);
            Order order = (Order)uctx.unmarshalDocument(in, null);
           
            // compute the total amount of the order
            float total = 0.0f;
            for (Iterator iter = order.getItems().iterator(); iter.hasNext();) {
                Item item = (Item)iter.next();
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

            IBindingFactory bfact = BindingDirectory.getFactory(Customer.class);
           
            // unmarshal customer information from file
            IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
            FileInputStream in = new FileInputStream(args[0]);
            Customer customer = (Customer)uctx.unmarshalDocument(in, null);
           
            // you can add code here to alter the unmarshalled customer
           
      // marshal object back out to file (with nice indentation, as UTF-8)
      IMarshallingContext mctx = bfact.createMarshallingContext();
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

        try {
        Reader oRdr = oRSet.getCharacterStream(c);
              if (!oRSet.wasNull()) {
            IBindingFactory bfact = BindingDirectory.getFactory(NewsGroupJournal.class);
            IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
                oJournal = (NewsGroupJournal) uctx.unmarshalDocument (oRdr);
            oRdr.close();
                put(DB.tx_journal, oRSet.getString(c));
          } else {
              oJournal = null;
              } // fi
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

    final int BUFFER_SIZE = 28000;
    FileInputStream oFileStream = new FileInputStream(sXMLDocPath);
    BufferedInputStream oXMLStream = new BufferedInputStream(oFileStream, BUFFER_SIZE);

    Object obj = uctx.unmarshalDocument (oXMLStream, sEnc);

    oXMLStream.close();
    oFileStream.close();

    if (DebugFile.trace) {
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

  StringBufferInputStream oResponse = new StringBufferInputStream(sResponse);

    IBindingFactory bfact = BindingDirectory.getFactory(CalendarResponse.class);
    IUnmarshallingContext uctx = bfact.createUnmarshallingContext();

    oCalRsp = (CalendarResponse) uctx.unmarshalDocument (oResponse, "UTF-8");

  return oCalRsp;
  } // get

}
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

    ByteArrayOutputStream oOst = new ByteArrayOutputStream();
    DataHandler oHnd = new DataHandler(oUrl);
    oHnd.writeTo(oOst);
    ByteArrayInputStream oIst = new ByteArrayInputStream(oOst.toByteArray());
    oYsr = (YSearchResponse) oUmc.unmarshalDocument (oIst, "UTF8");   
    oIst.close();
    oOst.close();
  } catch (JiBXException jibxe) {
    throw new IOException(jibxe.getMessage(), jibxe);
  }
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

  @Test
  public void testSingleStyle() throws JiBXException, LayerException {
    IBindingFactory bfact = BindingDirectory.getFactory(StyledLayerDescriptorInfo.class);
    IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
    Object object = uctx.unmarshalDocument(getClass().getResourceAsStream("/org/geomajas/testdata/sld/single_layer_no_stylename.sld"), null);
    StyledLayerDescriptorInfo sld = (StyledLayerDescriptorInfo) object;
    NamedStyleInfo info = styleConverterService.convert(sld, featureInfo, "layer", "style");
    Assert.assertNotNull(info);
    Assert.assertEquals("Some title", info.getName());
  }
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

 
  @Test
  public void testPickStyle() throws JiBXException, LayerException {
    IBindingFactory bfact = BindingDirectory.getFactory(StyledLayerDescriptorInfo.class);
    IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
    Object object = uctx.unmarshalDocument(getClass().getResourceAsStream("/org/geomajas/testdata/sld/multiple_layer_stylename.sld"), null);
    StyledLayerDescriptorInfo sld = (StyledLayerDescriptorInfo) object;
    NamedStyleInfo info1 = styleConverterService.convert(sld, featureInfo, "Layer1", "Style1");
    Assert.assertNotNull(info1);
    Assert.assertEquals("Style1", info1.getName());
    Assert.assertEquals(1, info1.getFeatureStyles().size());
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

  @Test
  public void testRead() throws JiBXException {
    IBindingFactory bfact = BindingDirectory.getFactory(StyledLayerDescriptorInfo.class);
    IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
    Object object = uctx.unmarshalDocument(getClass().getResourceAsStream("samples/example-sld.xml"), null);
    StyledLayerDescriptorInfo sld = (StyledLayerDescriptorInfo) object;
    for (ChoiceInfo choice : sld.getChoiceList()) {
      if (choice.ifNamedLayer()) {
        NamedLayerInfo layer = choice.getNamedLayer();
        Assert.assertEquals("OCEANSEA_1M:Foundation", layer.getName());
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.