Examples of SchemaBinding


Examples of org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding

      assertArrayOfAnyGenericElement(o);
   }

   public void testUnmarshallingDom() throws Exception
   {
      SchemaBinding schema = getSchemaBinding(false);

      // unmarshal
      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      Object o = unmarshaller.unmarshal(new StringReader(XML), schema);
View Full Code Here

Examples of org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding

   }

   private SchemaBinding getSchemaBinding(boolean genericElement)
   {
      // bind
      SchemaBinding schema = XsdBinder.bind(new StringReader(XSD), null);

      // get bound components
      TypeBinding type = schema.getType(new QName("http://org.jboss.ws/jbws434/types", "ArrayOfAny"));
      WildcardBinding wildcard = type.getWildcard();
      ElementBinding e = schema.getElement(new QName("http://org.jboss.ws/jbws434/types", "e"));

      // adjust binding
      ParticleHandler unresolvedElementHandler;
      CharactersHandler unresolvedCharactersHandler;
      if(genericElement)
      {
         unresolvedElementHandler = new GenericElementHandler();
         unresolvedCharactersHandler = new GenericCharactersHandler();
      }
      else
      {
         unresolvedElementHandler = new DomElementHandler();
         unresolvedCharactersHandler = new DomCharactersHandler();
      }

      wildcard.setUnresolvedElementHandler(unresolvedElementHandler);
      wildcard.setUnresolvedCharactersHandler(unresolvedCharactersHandler);
      PropertyMetaData property = new PropertyMetaData();
      property.setName("_any");
      wildcard.setPropertyMetaData(property);

      ClassMetaData clsBinding = new ClassMetaData();
      clsBinding.setImpl(ArrayOfAny.class.getName());
      e.setClassMetaData(clsBinding);

      // to fail the resolution quickly
      schema.setSchemaResolver(new SchemaBindingResolver()
      {
         public String getBaseURI()
         {
            return null;
         }
View Full Code Here

Examples of org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding

      super(localName);
   }

   public void testXsdBinder() throws Exception
   {
      SchemaBinding doc = readXsd();
      /* TODO assertSchemaBinding(doc); */
   }
View Full Code Here

Examples of org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding

      /* TODO assertSchemaBinding(doc); */
   }

   public void testManualBinding() throws Exception
   {
      SchemaBinding doc = createBinding();
      /* TODO assertSchemaBinding(doc); */
   }
View Full Code Here

Examples of org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding

   // Private

   private static SchemaBinding createBinding()
   {
      SchemaBinding cursor = new SchemaBinding();

      //
      // Declare all the types
      //
/* TODO
 
View Full Code Here

Examples of org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding

      super(name);
   }

   public void testUnmarshalling() throws Exception
   {
      SchemaBinding schema = XsdBinder.bind(new StringReader(XSD), null, SCHEMA_RESOLVER);

      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      Object o = unmarshaller.unmarshal(new StringReader(XML), schema);
      assertNotNull(o);
      assertTrue(o instanceof List);
View Full Code Here

Examples of org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding

            arr[1] = submap;
         }
      }
      );

      SchemaBinding cursor = new SchemaBinding();
      cursor.addElement(new QName("config"), configType);

      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      Object config = unmarshaller.unmarshal(getXmlUrl("xml/newmetadata.xml"), cursor);

      //log.debug("unmarshalled: " + config);
View Full Code Here

Examples of org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding

      super(name);
   }

   public void testSimpleUnmarshalling() throws Exception
   {
      SchemaBinding schema = XsdBinder.bind(new StringReader(XSD), null);
      schema.setIgnoreUnresolvedFieldOrClass(false);
      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      Object o = unmarshaller.unmarshal(new StringReader(XML_SIMPLE), schema);

      assertEquals(GLOBAL_SIMPLE, o);
   }
View Full Code Here

Examples of org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding

      assertEquals(GLOBAL_SIMPLE, o);
   }

   public void testSimpleMarshallingSunday() throws Exception
   {
      SchemaBinding schema = XsdBinder.bind(new StringReader(XSD), null);
      MarshallerImpl marshaller = new MarshallerImpl();
      marshaller.setProperty(Marshaller.PROP_OUTPUT_INDENTATION, "false");
      StringWriter writer = new StringWriter();
      marshaller.marshal(schema, null, GLOBAL_SIMPLE, writer);
      String marshalled = writer.getBuffer().toString();
View Full Code Here

Examples of org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding

      assertXmlEqual(XML_SIMPLE, marshalled);
   }

   public void testAllUnmarshalling() throws Exception
   {
      SchemaBinding schema = XsdBinder.bind(new StringReader(XSD), null);
      schema.setIgnoreUnresolvedFieldOrClass(false);
      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      Object o = unmarshaller.unmarshal(new StringReader(XML_ALL), schema);

      assertEquals(GLOBAL_ALL, o);
   }
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.