Package org.jboss.xb.binding

Examples of org.jboss.xb.binding.Unmarshaller.unmarshal()


      // create an instance of ObjectModelFactory
      ObjectModelFactory factory = new ConfigInfoBinding();

      // let the object model factory to create an instance of Book and populate it with data from XML
      ConfigInfo ci = (ConfigInfo)unmarshaller.unmarshal(is, factory, null);

      // close the XML stream
      is.close();

      return ci;
View Full Code Here


      InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("security/login-config2.xml");
      InputStreamReader xmlReader = new InputStreamReader(is);
      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      unmarshaller.mapFactoryToNamespace(uomf, "http://www.jboss.org/j2ee/schemas/XMLLoginModule");
      PolicyConfig config = (PolicyConfig) unmarshaller.unmarshal(xmlReader, lcomf, null);
      ApplicationPolicy aPolicy = (ApplicationPolicy)config.get("testXMLLoginModule");
      AuthenticationInfo info = (AuthenticationInfo)aPolicy.getAuthenticationInfo();
      assertTrue("test-xml-config != null", info != null);
      AppConfigurationEntry[] entries = info.getAppConfigurationEntry();
      assertTrue("entries.length == 1", entries.length == 1);
View Full Code Here

         // create unmarshaller
         Unmarshaller unmarshaller = UnmarshallerFactory.newInstance()
               .newUnmarshaller();
        
         // let JBossXB do it's magic using the MappingObjectModelFactory
         managerList = (ArrayList)unmarshaller.unmarshal(is, momf, null);        
      }
      catch (Exception e)
      {
         log.error("Accessing resource '" + managersResName + "'");
         throw e;
View Full Code Here

        
         // create unmarshaller
         Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();

         // let JBossXB do it's magic using the MappingObjectModelFactory
         this.notificationMapList = (ArrayList)unmarshaller.unmarshal(is, omf, null);        
      }
      catch (Exception e)
      {
         log.error("Accessing resource '" + notificationMapResName + "'");
         throw e;
View Full Code Here

        
         // create unmarshaller
         Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();

         // let JBossXB do it's magic using the AttributeMappingsBinding
         mappings = (AttributeMappings)unmarshaller.unmarshal(is, omf, null);        
      }
      catch (Exception e)
      {
         log.error("Accessing resource '" + resourceName + "'");
         throw e;
View Full Code Here

      // Parse the attribute element content
      SchemaBindingResolver resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver();
      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      StringReader reader = new StringReader(buffer.toString());
      Object bean = unmarshaller.unmarshal(reader, resolver);
      return bean;
   }

   private ObjectName processDependency(ObjectName container, ObjectName loaderName,
      Element element, List<ObjectName> mbeans, boolean replace)
View Full Code Here

            String namespaceURI = root.getNamespaceURI();
            if (namespaceURI.equals("http://java.sun.com/xml/ns/j2ee"))
            {
               Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
               ObjectModelFactory factory = new WebservicesFactory(wsURL);
               wsMetaData = (WebservicesMetaData)unmarshaller.unmarshal(wsURL.openStream(), factory, null);
               unit.addAttachment(WebservicesMetaData.class, wsMetaData);
            }
         }
         catch (Exception ex)
         {
View Full Code Here

      resolver.addSchemaLocation("urn:jboss-test:xmbean:2.0", "xml/mbeanserver/jboss_xmbean_2_0.xsd");
      resolver.addSchemaLocation("urn:jboss:simplejavabean:1.0", "xml/mbeanserver/simplejavabean_1_0.xsd");

      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      String xmlPath = getResourcePath("xml/mbeanserver/testXMBean2.xml");
      Object root = unmarshaller.unmarshal(xmlPath, resolver);

      assertTrue("", root instanceof ModelMBeanInfoSupportWrapper);
      ModelMBeanInfoSupportWrapper mbean = (ModelMBeanInfoSupportWrapper) root;
      Descriptor descriptor = mbean.getDescriptors();
      Object i = descriptor.getFieldValue("interceptors");
View Full Code Here

         }
      });

      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      InputStream is2 = getResource("xml/mbeanserver/testObjFactory.xml");
      Services services = (Services)unmarshaller.unmarshal(is2, schemaBinding);
      List mbeans = services.getMBeans();
      assertEquals("There is 1 mbean", 1, mbeans.size());

      MBeanData mbean = (MBeanData) mbeans.get(0);
      assertTrue("ClassName == org.jboss.security.auth.login.DynamicLoginConfig",
View Full Code Here

               return super.resolveEntity(publicId, systemId);
            }
         }
      });

      JNDIBindings bindings = (JNDIBindings) unmarshaller.unmarshal(is2,
         new SchemaBindingResolver(){
            public String getBaseURI()
            {
               throw new UnsupportedOperationException("getBaseURI is not implemented.");
            }
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.