Examples of createUnmarshallingContext()


Examples of org.jibx.runtime.IBindingFactory.createUnmarshallingContext()

        // load or create customization information
        setLocator(loc);
        m_global = new GlobalCustom(loc);
        if (path != null) {
            IBindingFactory fact = BindingDirectory.getFactory("class_customs_binding", GlobalCustom.class);
            IUnmarshallingContext ictx = fact.createUnmarshallingContext();
            FileInputStream is = new FileInputStream(path);
            ictx.setDocument(is, null);
            ictx.setUserContext(vctx);
            ((IUnmarshallable)m_global).unmarshal(ictx);
        }
View Full Code Here

Examples of org.jibx.runtime.IBindingFactory.createUnmarshallingContext()

               
                // version found, create unmarshaller for the associated binding
                IBindingFactory fact = BindingDirectory.
                    getFactory(m_versionBindings[i], clas);
                UnmarshallingContext context =
                    (UnmarshallingContext)fact.createUnmarshallingContext();
               
                // return object unmarshalled using binding for document version
                context.setFromContext(m_context);
                return context.unmarshalElement();
               
View Full Code Here

Examples of org.jibx.runtime.IBindingFactory.createUnmarshallingContext()

            //  which case you need to use the getFactory() call that takes the
            //  binding name as the first parameter
            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
           
View Full Code Here

Examples of org.jibx.runtime.IBindingFactory.createUnmarshallingContext()

          if (sColName.equalsIgnoreCase(DB.tx_journal)) {
        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;
View Full Code Here

Examples of org.jibx.runtime.IBindingFactory.createUnmarshallingContext()

    }

    if (sEnc==null) sEnc="UTF-8";

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

    final int BUFFER_SIZE = 28000;
    FileInputStream oFileStream = new FileInputStream(sXMLDocPath);
    BufferedInputStream oXMLStream = new BufferedInputStream(oFileStream, BUFFER_SIZE);
View Full Code Here

Examples of org.jibx.runtime.IBindingFactory.createUnmarshallingContext()

    String sResponse = readfilestr(sUrl,"UTF-8");

  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.IBindingFactory.createUnmarshallingContext()

  URL oUrl = new URL("http://boss.yahooapis.com/ysearch/web/v1/"+Gadgets.URLEncode(sQuery)+
                   "?appid="+sKey+"&format=xml&type=html&style=raw"+
                  (sSites==null ? "" : "&sites="+sSites));
  try {
    IBindingFactory oIbf = BindingDirectory.getFactory(YSearchResponse.class);
    IUnmarshallingContext oUmc = oIbf.createUnmarshallingContext();

    ByteArrayOutputStream oOst = new ByteArrayOutputStream();
    DataHandler oHnd = new DataHandler(oUrl);
    oHnd.writeTo(oOst);
    ByteArrayInputStream oIst = new ByteArrayInputStream(oOst.toByteArray());
View Full Code Here

Examples of org.jibx.runtime.IBindingFactory.createUnmarshallingContext()

  private FeatureInfo featureInfo;

  @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.IBindingFactory.createUnmarshallingContext()

  }
 
  @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());
View Full Code Here

Examples of org.jibx.runtime.IBindingFactory.createUnmarshallingContext()

public class ParserTest {

  @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();
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.