Package org.jibx.runtime

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


        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);
      }
      return pieceMap.get(piece).clone();
View Full Code Here


          "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();

      resp.setContentType("text/plain");
View Full Code Here

        + 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

    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

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

         // 1st check
         RepositoryEntry unmarshledRepositoryEntry =
            conf.getRepositoryConfiguration(repository.getConfiguration().getName());
View Full Code Here

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

         // 2nd check
         unmarshledRepositoryEntry = conf.getRepositoryConfiguration(repository.getConfiguration().getName());
         assertEquals(lockManagerTimeOut, unmarshledRepositoryEntry.getWorkspaceEntries().get(0).getLockManager()
View Full Code Here

         persiter.write(new ByteArrayInputStream(((ByteArrayOutputStream)saveStream).toByteArray()));

         IBindingFactory factory = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
         IUnmarshallingContext uctx = factory.createUnmarshallingContext();
         RepositoryServiceConfiguration storedConf =
            (RepositoryServiceConfiguration)uctx.unmarshalDocument(persiter.read(), null);

         for (int i = 0; i < theadsCount; i++)
         {
            // test if respository has been created
            ManageableRepository repository = threads[i].getRepository();
View Full Code Here

    URL piecePath = Pieces.class.getResource("/xml/pieces/" + pieceFile);

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

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

   private RepositoryEntry getRepositoryEntry(InputStream wEntryStream, String repositoryName)
            throws FileNotFoundException, JiBXException, RepositoryConfigurationException
   {
      IBindingFactory factory = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
      IUnmarshallingContext uctx = factory.createUnmarshallingContext();
      RepositoryServiceConfiguration conf = (RepositoryServiceConfiguration) uctx.unmarshalDocument(wEntryStream, null);
      RepositoryEntry rEntry = conf.getRepositoryConfiguration(repositoryName);

      return rEntry;
   }
View Full Code Here

    public Object unmarshal(Exchange exchange, InputStream stream) throws Exception {
        ObjectHelper.notNull(getUnmarshallClass(), "unmarshallClass");
        IBindingFactory bindingFactory = BindingDirectory.getFactory(getUnmarshallClass());
        IUnmarshallingContext unmarshallingContext = bindingFactory.createUnmarshallingContext();
        return unmarshallingContext.unmarshalDocument(stream, null);
    }

    public Class<?> getUnmarshallClass() {
        return unmarshallClass;
    }
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.