Examples of unmarshalDocument()


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

   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

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

                                                                                          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

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

        // 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

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

         }

         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

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

         }

         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

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

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

   public static Collection<Object> getCollection(InputStream is) throws Exception
   {
      return getXMLCollection(is).getCollection();
View Full Code Here

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

   public static XMLObject getXMLObject(InputStream is) throws Exception
   {
      IBindingFactory bfact = getBindingFactoryInPriviledgedMode(XMLObject.class);
      IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
      XMLObject xmlobject = (XMLObject)uctx.unmarshalDocument(is, "UTF-8");
      return xmlobject;
   }

   public static Object getObject(InputStream is) throws Exception
   {
View Full Code Here

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

   {
      try
      {
         IBindingFactory factory = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
         IUnmarshallingContext uctx = factory.createUnmarshallingContext();
         RepositoryServiceConfiguration conf = (RepositoryServiceConfiguration)uctx.unmarshalDocument(is, null);

         this.defaultRepositoryName = conf.getDefaultRepositoryName();
         this.repositoryConfigurations = conf.getRepositoryConfigurations();

         //      setDefaultRepositoryName(conf.getDefaultRepositoryName());
View Full Code Here

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

   {
      try
      {
         IBindingFactory factory = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
         IUnmarshallingContext uctx = factory.createUnmarshallingContext();
         RepositoryServiceConfiguration conf = (RepositoryServiceConfiguration)uctx.unmarshalDocument(is, null);

         if (defaultRepositoryName == null)
         {
            this.defaultRepositoryName = conf.getDefaultRepositoryName();           
         }
View Full Code Here

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

   {
      try
      {
         IBindingFactory factory = BindingDirectory.getFactory(NodeTypeValuesList.class);
         IUnmarshallingContext uctx = factory.createUnmarshallingContext();
         NodeTypeValuesList nodeTypeValuesList = (NodeTypeValuesList)uctx.unmarshalDocument(is, null);
         List ntvList = nodeTypeValuesList.getNodeTypeValuesList();
         return converter.convertFromValueToData(ntvList);
      }
      catch (JiBXException e)
      {
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.