Examples of unmarshalDocument()


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

                        logger.error("Service definition not found for service " + path + " at " + file);
                        throw new UnavailableException("Service definition not found for service " + path + " at "
                            + file + ". Check configuration of servlet " + servlet.getServletName()
                            + " in WEB-INF/web.xml.");
                    }
                    ServiceDefinition sdef = (ServiceDefinition) ctx.unmarshalDocument(is, null);
                    if (!path.startsWith("/")) {
                        path = "/" + path;
                    }
                    map.put(path, sdef);
View Full Code Here

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

            if (split > 0) {
                InputStream is = null;
                try {
                    ports[i] = Integer.parseInt(arg.substring(split + 1));
                    is = new FileInputStream(path);
                    sdefs[i] = (ServiceDefinition)ctx.unmarshalDocument(is, null);
                } catch (NumberFormatException e) {
                    System.err.println("Error parsing port number in argument " + i + ": " + arg);
                    valid = false;
                } catch (FileNotFoundException e) {
                    System.err.println("Service definition file not found for argument " + i + ": " + path);
View Full Code Here

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

   public void testPageSetMapping() throws Exception
   {
      IBindingFactory bfact = BindingDirectory.getFactory(PageSet.class);
      IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
      Object obj =
         uctx.unmarshalDocument(new FileInputStream("src/test/resources/portal/portal/classic/pages.xml"), null);
      assertEquals(Page.PageSet.class, obj.getClass());
   }

   public void testPortalConfigMapping() throws Exception
   {
View Full Code Here

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

   public void testPortalConfigMapping() throws Exception
   {
      IBindingFactory bfact = BindingDirectory.getFactory(PortalConfig.class);
      IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
      Object obj =
         uctx.unmarshalDocument(new FileInputStream("src/test/resources/portal/portal/classic/portal.xml"), null);
      assertEquals(PortalConfig.class, obj.getClass());
   }

   public void testNavigationMapping() throws Exception
   {
View Full Code Here

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

   public void testNavigationMapping() throws Exception
   {
      IBindingFactory bfact = BindingDirectory.getFactory(PageNavigation.class);
      IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
      Object obj =
         uctx.unmarshalDocument(new FileInputStream("src/test/resources/portal/portal/classic/navigation.xml"), null);
      assertEquals(PageNavigation.class, obj.getClass());

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

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

      IMarshallingContext mctx = bfact.createMarshallingContext();
      mctx.setIndent(2);
      mctx.marshalDocument(obj, "UTF-8", null, new FileOutputStream("target/navigation.xml"));

      obj = uctx.unmarshalDocument(new FileInputStream("target/navigation.xml"), null);
      assertEquals(PageNavigation.class, obj.getClass());
   }

   public void testPortletPreferencesMapping() throws Exception
   {
View Full Code Here

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

   public void testPortletPreferencesMapping() throws Exception
   {
      IBindingFactory bfact = BindingDirectory.getFactory(PortalConfig.class);
      IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
      Object obj =
         uctx.unmarshalDocument(
            new FileInputStream("src/test/resources/portal/portal/classic/portlet-preferences.xml"), null);
      assertEquals(PortletPreferencesSet.class, obj.getClass());

      IMarshallingContext mctx = bfact.createMarshallingContext();
      mctx.setIndent(2);
View Full Code Here

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

   public void testPortletApplicationMapping() throws Exception
   {
      IBindingFactory bfact = BindingDirectory.getFactory(PortalConfig.class);
      IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
      Application<Portlet> app =
         (Application<Portlet>)uctx.unmarshalDocument(new FileInputStream(
            "src/test/resources/jibx/portlet-application.xml"), null);
      TransientApplicationState portletState = (TransientApplicationState)app.getState();
      assertNotNull(portletState);
      assertEquals("web/BannerPortlet", portletState.getContentId());
      Portlet preferences = (Portlet)portletState.getContentState();
View Full Code Here

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

   private Container toContainer(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);
   }

   static public class SelectCategoryActionListener extends EventListener<UIContainerList>
   {
      public void execute(Event<UIContainerList> event) throws Exception
View Full Code Here

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

        }
        IBindingFactory bfact = BindingDirectory.getFactory(mclas);
       
        // unmarshal document to construct objects
        IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
        Object obj = uctx.unmarshalDocument(new FileInputStream(fin), null);
        if (!mclas.isInstance(obj)) {
            System.err.println("Unmarshalled result not expected type");
            return false;
        }
       
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.