Package org.jibx.runtime

Examples of org.jibx.runtime.IUnmarshallingContext


               if (LOG.isTraceEnabled())
                  LOG.trace("About to parse configuration file " + document);

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

               return (Configuration)uctx.unmarshalDocument(new StringReader(document), null);
            }
         });
      }
      catch (PrivilegedActionException pae)
      {
View Full Code Here


            {
               throw new RuntimeException(cause);
            }
         }

         IUnmarshallingContext uctx = factory.createUnmarshallingContext();
         RepositoryServiceConfiguration conf =
                  (RepositoryServiceConfiguration) uctx.unmarshalDocument(PrivilegedFileHelper
                           .fileInputStream(configFile), null);

         RepositoryEntry repositoryEntry = conf.getRepositoryConfiguration(getBackupConfig().getRepository());

         if (repositoryEntry.getWorkspaceEntries().size() != 1)
View Full Code Here

      InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("test-trim-value.xml");
      assertNotNull(is);
      try
      {
         IBindingFactory bfact = BindingDirectory.getFactory(XMLObject.class);
         IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
         Configuration conf =
            (Configuration)uctx.unmarshalDocument(is, null);

         assertNotNull(conf);
         Iterator it = conf.getContainerLifecyclePluginIterator();
         assertNotNull(it);
         assertTrue(it.hasNext());
View Full Code Here

      System.setProperty("double_value", "172.5");

      //
      String projectdir = System.getProperty("basedir");
      IBindingFactory bfact = BindingDirectory.getFactory(XMLObject.class);
      IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
      Configuration conf =
         (Configuration)uctx.unmarshalDocument(new FileInputStream(projectdir
            + "/src/test/resources/test-resolved-property.xml"), null);

      assertNotNull(conf);

      //
View Full Code Here

   public void testMarshallAndUnmarshall() throws Exception
   {
      String projectdir = System.getProperty("basedir");
      IBindingFactory bfact = BindingDirectory.getFactory(XMLObject.class);
      IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
      Object obj = uctx.unmarshalDocument(new FileInputStream(projectdir + "/src/test/resources/object.xml"), null);

      IMarshallingContext mctx = bfact.createMarshallingContext();
      mctx.setIndent(2);
      mctx.marshalDocument(obj, "UTF-8", null, new FileOutputStream(projectdir + "/target/object.xml"));
   }
View Full Code Here

                                                                                          JiBXException,
                                                                                          RepositoryConfigurationException {
    WorkspaceEntry wsEntry = null;

    IBindingFactory factory = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
    IUnmarshallingContext uctx = factory.createUnmarshallingContext();
    RepositoryServiceConfiguration conf = (RepositoryServiceConfiguration) uctx.unmarshalDocument(wEntryStream,
                                                                                                  null);
    RepositoryEntry rEntry = conf.getRepositoryConfiguration(repositoryName);
   
    for (WorkspaceEntry wEntry : rEntry.getWorkspaceEntries())
      if (wEntry.getName().equals(workspaceName))
View Full Code Here

    public ConfigurationManager(InputStream inputStream) throws Exception {
        // Logger first
        log = LoggerFactory.getLogger(ConfigurationManager.class);

        IBindingFactory bfact = BindingDirectory.getFactory(WebuiConfiguration.class);
        IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
        WebuiConfiguration config = (WebuiConfiguration) uctx.unmarshalDocument(inputStream, null);
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        if (config.getAnnotationClasses() != null) {
            for (String annotationClass : config.getAnnotationClasses()) {
                // process annotation and get the Component
                Component[] components = annotationToComponents(cl, annotationClass);
View Full Code Here

            throw new WorkspaceRestoreExeption("The backup set is not contains original workspace configuration : "
                     + getBackupConfig().getBackupDir().getCanonicalPath());
         }

         IBindingFactory factory = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
         IUnmarshallingContext uctx = factory.createUnmarshallingContext();
         RepositoryServiceConfiguration conf =
                  (RepositoryServiceConfiguration) uctx.unmarshalDocument(new FileInputStream(configFile), null);

         RepositoryEntry repositoryEntry = conf.getRepositoryConfiguration(getBackupConfig().getRepository());

         if (repositoryEntry.getWorkspaceEntries().size() != 1)
         {
View Full Code Here

            throw new RepositoryRestoreExeption("The backup set is not contains original repositpry configuration : "
                     + getBackupConfig().getBackupDir().getCanonicalPath());
         }

         IBindingFactory factory = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
         IUnmarshallingContext uctx = factory.createUnmarshallingContext();
         RepositoryServiceConfiguration conf =
                  (RepositoryServiceConfiguration) uctx.unmarshalDocument(new FileInputStream(configFile), null);

         if (conf.getRepositoryConfigurations().size() != 1)
         {
            throw new RepositoryRestoreExeption(
                     "The oririginal configuration should be contains only one repository entry :"
View Full Code Here

   }

   public static XMLCollection getXMLCollection(InputStream is) throws Exception
   {
      IBindingFactory bfact = XMLObject.getBindingFactoryInPriviledgedMode(XMLObject.class);
      IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
      return (XMLCollection)uctx.unmarshalDocument(is, null);
   }
View Full Code Here

TOP

Related Classes of org.jibx.runtime.IUnmarshallingContext

Copyright © 2018 www.massapicom. 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.