Package org.jboss.xb.binding.sunday.unmarshalling

Examples of org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver.addSchemaLocation()


  
   public static SchemaBindingResolver initResolverJavaEE(Class<?> clazz, String xsd)
   {
      DefaultSchemaResolver resolver = initResolverJavaEE(clazz);
      String xsdPath = findXSD(xsd);
      resolver.addSchemaLocation(JavaEEMetaDataConstants.JAVAEE_NS, xsdPath);
      return resolver;
   }

   public static DefaultSchemaResolver initResolverJavaEE(Class<?> clazz)
   {
View Full Code Here


   public void testJavaBeanSchemaInitializerInterceptor() throws Exception
   {
      DefaultSchemaResolver resolver = new DefaultSchemaResolver();
      JavaBeanSchemaInitializer si = new JavaBeanSchemaInitializer();
      resolver.addSchemaInitializer("urn:jboss:simplejavabean:1.0", si);
      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);
View Full Code Here

   {
      DefaultSchemaResolver resolver = new DefaultSchemaResolver();
      JavaBeanSchemaInitializer si = new JavaBeanSchemaInitializer();
      resolver.addSchemaInitializer("urn:jboss:simplejavabean:1.0", si);
      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);
View Full Code Here

   public void testComplexInclude() throws Exception
   {
      DefaultSchemaResolver resolver = new DefaultSchemaResolver();
      URL url = getClass().getResource("/xml/SchemaIncludeUnitTestCase.xsd");
      assertNotNull(url);
      resolver.addSchemaLocation("urn:jbosstest:schemainclude", url.toString());
      Util.loadSchema(url.toString(), resolver);
   }

   public SchemaIncludeUnitTestCase(String name)
   {
View Full Code Here

   {
      Class clazz = SchemaBindingInitializerUnitTestCase.class;
      DefaultSchemaResolver resolver = new DefaultSchemaResolver();
      resolver.addSchemaInitializer(SimpleInitializer.NS, SimpleInitializer.class.getName());
      String location = getSchemaLocation(clazz, "SchemaBindingInitializerUnitTestCaseSimple.xsd");
      resolver.addSchemaLocation(SimpleInitializer.NS, location);
      resolver.addSchemaInitializer(ContainerInitializer.NS, ContainerInitializer.class.getName());
      location = getSchemaLocation(clazz, "SchemaBindingInitializerUnitTestCaseContainer.xsd");
      resolver.addSchemaLocation(ContainerInitializer.NS, location);
      return resolver;
   }
View Full Code Here

      resolver.addSchemaInitializer(SimpleInitializer.NS, SimpleInitializer.class.getName());
      String location = getSchemaLocation(clazz, "SchemaBindingInitializerUnitTestCaseSimple.xsd");
      resolver.addSchemaLocation(SimpleInitializer.NS, location);
      resolver.addSchemaInitializer(ContainerInitializer.NS, ContainerInitializer.class.getName());
      location = getSchemaLocation(clazz, "SchemaBindingInitializerUnitTestCaseContainer.xsd");
      resolver.addSchemaLocation(ContainerInitializer.NS, location);
      return resolver;
   }

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

   public void testSchema1() throws Exception
   {
      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      DefaultSchemaResolver resolver = new DefaultSchemaResolver();
      resolver.addSchemaLocation("urn:jboss:jbxb-minOccurs-schema1", "xml/jbxb/minOccurs/schema1.xsd");

      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      URL testSchema1 = loader.getResource("xml/jbxb/minOccurs/testSchema1.xml");
      Object root = unmarshaller.unmarshal(testSchema1.toString(), resolver);
   }
View Full Code Here

   public void testSchema1v2() throws Exception
   {
      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      DefaultSchemaResolver resolver = new DefaultSchemaResolver();
      resolver.addSchemaLocation("urn:jboss:jbxb-minOccurs-schema1", "xml/jbxb/minOccurs/schema1v2.xsd");

      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      URL testSchema1 = loader.getResource("xml/jbxb/minOccurs/testSchema1.xml");
      Object root = unmarshaller.unmarshal(testSchema1.toString(), resolver);
   }
View Full Code Here

              "  <element name='applxml' xmime:expectedContentTypes='application/xml' type='xmime:base64Binary'/>" +
              "</schema>";

      DefaultSchemaResolver resolver = new DefaultSchemaResolver();
      String xmimeXsd = getSchemaLocation(getClass(), "xmlmime.xsd");
      resolver.addSchemaLocation("http://www.w3.org/2005/05/xmlmime", xmimeXsd);

      SchemaBinding schema = XsdBinder.bind(new StringReader(xsd), null, resolver);
      schema.setIgnoreUnresolvedFieldOrClass(false);
      schema.setXopUnmarshaller(XOP_ENABLED_UNMARSH);
View Full Code Here

   {
      Class clazz = WildcardWrapperUnitTestCase.class;
      DefaultSchemaResolver resolver = new DefaultSchemaResolver();
      resolver.addSchemaInitializer(PropertyInitializer.NS, PropertyInitializer.class.getName());
      String location = getSchemaLocation(clazz, "WildcardWrapperUnitTestCase.xsd");
      resolver.addSchemaLocation(PropertyInitializer.NS, location);
      resolver.addSchemaInitializer(SimpleInitializer.NS, SimpleInitializer.class.getName());
      location = getSchemaLocation(clazz, "SchemaBindingInitializerUnitTestCaseSimple.xsd");
      resolver.addSchemaLocation(SimpleInitializer.NS, location);
      return resolver;
   }
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.