Package org.jibx.runtime

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


        if (JibxSimpleTypes.isSimpleType(jtype)) {
            factory = JibxNullBindingFactory.getFactory();
        } else {
            factory = BindingDirectory.getFactory(jtype);
        }
        UnmarshallingContext ctx = (UnmarshallingContext)factory.createUnmarshallingContext();
        StAXReaderWrapper wrapper = new StAXReaderWrapper(reader, "Data-element", true);
        ctx.setDocument(wrapper);
        ctx.toTag();
        return ctx;
    }
View Full Code Here


        if (JibxSimpleTypes.isSimpleType(jtype)) {
            factory = JibxNullBindingFactory.getFactory();
        } else {
            factory = BindingDirectory.getFactory(jtype);
        }
        UnmarshallingContext ctx = (UnmarshallingContext)factory.createUnmarshallingContext();
        StAXReaderWrapper wrapper = new StAXReaderWrapper(reader, "Data-element", true);
        ctx.setDocument(wrapper);
        ctx.toTag();
        return ctx;
    }
View Full Code Here

    public T getObject() throws JiBXException, IOException {
        if ((this.object == null) && (this.xmlRepresentation != null)) {
            // Try to unmarshal the wrapped XML representation
            IBindingFactory jibxBFact = JibxRepresentation.getBindingFactory(
                    this.bindingName, this.bindingClass);
            IUnmarshallingContext uctx = jibxBFact.createUnmarshallingContext();
            return (T) uctx.unmarshalDocument(
                    this.xmlRepresentation.getStream(), null);
        }

        return this.object;
View Full Code Here

     * @see IUnmarshallingContext#unmarshalDocument(java.io.InputStream, String)
     */
    private Container toContainer(final String xml) throws Exception {
        ByteArrayInputStream is = new ByteArrayInputStream(xml.getBytes());
        IBindingFactory bfact = BindingDirectory.getFactory(Container.class);
        IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
        return (Container) uctx.unmarshalDocument(is, null);
    }

    /**
     * Get windowId of <code>UIPortlet</code>
View Full Code Here

            + piece.name().toLowerCase() + XML_EXT);

        IBindingFactory bfact = BindingDirectory
            .getFactory(PieceDef.class);

        IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
        PieceDef unmarshalledPiece = (PieceDef) uctx.unmarshalDocument(
            new BufferedReader(new InputStreamReader(piecePath
                .openStream())), null);
        pieceMap.put(piece, unmarshalledPiece);
      }
View Full Code Here

      URL basiliskFile = new URL(
          "http://dragonchess.darkhelm.org/xml/pieces/basilisk.xml");

      IBindingFactory bfact = BindingDirectory.getFactory(PieceDef.class);

      IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
      PieceDef piece = (PieceDef) uctx.unmarshalDocument(new BufferedReader(
          new InputStreamReader(basiliskFile.openStream())), null);

      PrintWriter out = resp.getWriter();
View Full Code Here

    URL boardPath = Boards.class.getResource(XML_PATH
        + board.name().toLowerCase() + XML_EXT);

    IBindingFactory bfact = BindingDirectory.getFactory(BoardDef.class);

    IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
    BoardDef ret = ((BoardDef) uctx.unmarshalDocument(new BufferedReader(
        new InputStreamReader(boardPath.openStream())), null)).clone();
    ret.set = set;
    return ret;
  }
View Full Code Here

  private BoardDef loadBoard(String pieceFile) throws JiBXException, IOException {
    URL boardPath = Boards.class.getResource("/xml/boards/" + pieceFile);

    IBindingFactory bfact = BindingDirectory.getFactory(BoardDef.class);

    IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
    return (BoardDef) uctx.unmarshalDocument(new BufferedReader(
        new InputStreamReader(boardPath.openStream())), null);
  }
}
View Full Code Here

         mctx.marshalDocument(newRepositoryServiceConfiguration, "ISO-8859-1", null, saveStream);
         saveStream.close();

         // 1st unmarshal
         factory = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
         IUnmarshallingContext uctx = factory.createUnmarshallingContext();
         RepositoryServiceConfiguration conf =
            (RepositoryServiceConfiguration)uctx
               .unmarshalDocument(PrivilegedFileHelper.fileInputStream(tempFile), null);

         // 1st check
View Full Code Here

         mctx.marshalDocument(newRepositoryServiceConfiguration, "ISO-8859-1", null, saveStream);
         saveStream.close();

         // 2nd unmarshal
         factory = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
         uctx = factory.createUnmarshallingContext();
         conf =
            (RepositoryServiceConfiguration)uctx
               .unmarshalDocument(PrivilegedFileHelper.fileInputStream(tempFile), null);

         // 2nd check
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.