Package org.jboss.xb.binding.metadata

Examples of org.jboss.xb.binding.metadata.ClassMetaData


      SchemaBinding schema = XsdBinder.bind(new StringReader(XSD), null);

      schema.setIgnoreUnresolvedFieldOrClass(false);
      schema.setIgnoreWhitespacesInMixedContent(false);

      ClassMetaData classMetaData = new ClassMetaData();
      classMetaData.setImpl(Top.class.getName());
      ElementBinding element = schema.getElement(new QName(NS, "top"));
      assertNotNull(element);
      element.setClassMetaData(classMetaData);
     
      Top top = (Top) unmarshal("IgnorableWhitespaceContent.xml", schema, Top.class);
View Full Code Here


      SchemaBinding schema = XsdBinder.bind(new StringReader(XSD), null);

      schema.setIgnoreUnresolvedFieldOrClass(false);
      schema.setIgnoreWhitespacesInMixedContent(false);

      ClassMetaData classMetaData = new ClassMetaData();
      classMetaData.setImpl(Top.class.getName());
      ElementBinding element = schema.getElement(new QName(NS, "top"));
      assertNotNull(element);
      element.setClassMetaData(classMetaData);
     
      Top top = new Top();
View Full Code Here

      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()
      {
View Full Code Here

   private static final ContainerWildcardHandler wildcardHandler = new ContainerWildcardHandler();
  
   public SchemaBinding init(SchemaBinding schema)
   {
      ClassMetaData classMetaData = new ClassMetaData();
      classMetaData.setImpl(Container.class.getName());

      PropertyMetaData property = new PropertyMetaData();
      property.setName("value");
     
      ElementBinding containerStrict = schema.getElement(containerStrictQName);
View Full Code Here

   private static final QName testQName = new QName(NS, "test");

   public SchemaBinding init(SchemaBinding schema)
   {
      ElementBinding test = schema.getElement(testQName);
      ClassMetaData classMetaData = new ClassMetaData();
      classMetaData.setImpl(Simple.class.getName());
      test.setClassMetaData(classMetaData);

      PropertyMetaData propMetaData = new PropertyMetaData();
      propMetaData.setName("value");
      test.setPropertyMetaData(propMetaData);
View Full Code Here

               XSAnnotation an = (XSAnnotation)annotations.item(i);
               XsdAnnotation xsdAn = XsdAnnotation.unmarshal(an.getAnnotationString());
               XsdAppInfo appInfo = xsdAn.getAppInfo();
               if(appInfo != null)
               {
                  ClassMetaData classMetaData = appInfo.getClassMetaData();
                  if(classMetaData != null)
                  {
                     if(log.isTraceEnabled())
                     {
                        log.trace("simple type " +
                           type.getName() +
                           ": impl=" +
                           classMetaData.getImpl()
                        );
                     }
                     binding.setClassMetaData(classMetaData);
                  }
View Full Code Here

               XSAnnotation an = (XSAnnotation)annotations.item(i);
               XsdAnnotation xsdAn = XsdAnnotation.unmarshal(an.getAnnotationString());
               XsdAppInfo appInfo = xsdAn.getAppInfo();
               if(appInfo != null)
               {
                  ClassMetaData classMetaData = appInfo.getClassMetaData();
                  if(classMetaData != null)
                  {
                     if(log.isTraceEnabled())
                     {
                        log.trace("complex type " +
                           type.getName() +
                           ": impl=" +
                           classMetaData.getImpl()
                        );
                     }
                     binding.setClassMetaData(classMetaData);
                  }
View Full Code Here

            {
               XsdAnnotation xsdAn = XsdAnnotation.unmarshal(an.getAnnotationString());
               XsdAppInfo appInfo = xsdAn.getAppInfo();
               if(appInfo != null)
               {
                  ClassMetaData classMetaData = appInfo.getClassMetaData();
                  if(classMetaData != null)
                  {
                     log.trace("element: name=" +
                        new QName(element.getNamespace(), element.getName()) +
                        ", class=" +
                        classMetaData.getImpl()
                     );
                     binding.setClassMetaData(classMetaData);
                  }

                  PropertyMetaData propertyMetaData = appInfo.getPropertyMetaData();
View Full Code Here

      }
   }

   public ClassMetaData getClassMetaData()
   {
      ClassMetaData result = classMetaData;
      if(result == null && mapEntryMetaData == null)
      {
            result = typeBinding.getClassMetaData();
      }
      return result;
View Full Code Here

      Object o = null;
      TypeBinding type = element.getType();
      if(!type.isSimple())
      {
         ClassMetaData classMetaData = element.getClassMetaData();
         MapEntryMetaData mapEntryMetaData = element.getMapEntryMetaData();

         // todo: if addMethod is specified, it's probably some collection field
         // but should not be set as a property. Instead, items are added to it using the addMethod
         if(classMetaData == null && type.isArrayWrapper() && element.getAddMethodMetaData() == null)
         {
            if(parent == null)
            {
               ElementBinding item = type.getArrayItem();
               TypeBinding itemType = item.getType();

               Class itemCls;
               QName itemTypeQName = itemType.getQName();
               if(itemTypeQName != null && Constants.NS_XML_SCHEMA.equals(itemTypeQName.getNamespaceURI()))
               {
                  itemCls = SimpleTypeBindings.classForType(itemType.getQName().getLocalPart());
               }
               else
               {
                  ClassMetaData itemClsMetaData = itemType.getClassMetaData();
                  String itemClsName = itemClsMetaData == null ? null : itemClsMetaData.getImpl();
                  itemCls = getClass(itemClsName, item, type.getArrayItemQName());
               }

               if(itemCls != null)
               {
View Full Code Here

TOP

Related Classes of org.jboss.xb.binding.metadata.ClassMetaData

Copyright © 2018 www.massapicom. 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.