Package org.jboss.xb.annotations

Examples of org.jboss.xb.annotations.JBossXmlMapKeyAttribute


      if(prop != null)
         keyElement = prop.getUnderlyingAnnotation(JBossXmlMapKeyElement.class);
      if(keyElement == null)
         keyElement = propType.getUnderlyingAnnotation(JBossXmlMapKeyElement.class);
     
      JBossXmlMapKeyAttribute keyAttribute = null;
      if(prop != null)
         keyAttribute = prop.getUnderlyingAnnotation(JBossXmlMapKeyAttribute.class);
      if(keyAttribute == null)
         keyAttribute = propType.getUnderlyingAnnotation(JBossXmlMapKeyAttribute.class);
     
      if(keyElement != null || keyAttribute != null)
      {
         // further assuming the map is bound

         JBossXmlMapValueElement valueElement = null;
         if(prop != null)
            valueElement = prop.getUnderlyingAnnotation(JBossXmlMapValueElement.class);
         if(valueElement == null)
            valueElement = propType.getUnderlyingAnnotation(JBossXmlMapValueElement.class);
        
         JBossXmlMapValueAttribute valueAttribute = null;
         if(prop != null)
            valueAttribute = prop.getUnderlyingAnnotation(JBossXmlMapValueAttribute.class);
         if(valueAttribute == null)
            valueAttribute = propType.getUnderlyingAnnotation(JBossXmlMapValueAttribute.class);

         TypeInfo keyType = propType.getKeyType();
         TypeInfo valueType = propType.getValueType();

         // entry handler
         BeanAdapterFactory entryAdapterFactory = null;
         BeanInfo entryInfo = JBossXBBuilder.configuration.getBeanInfo(DefaultMapEntry.class);
         entryAdapterFactory = createAdapterFactory(DefaultBeanAdapterBuilder.class, entryInfo, null);
         BeanHandler entryHandler = new BeanHandler(entryInfo.getName(), entryAdapterFactory);

         TypeBinding entryType = null;
         TypeInfo entryTypeInfo = null;

         // bind the entry element if present
         if(entryElement != null && !JBossXmlConstants.DEFAULT.equals(entryElement.name()))
         {
            String ns = entryElement.namespace();
            if(JBossXmlConstants.DEFAULT.equals(ns))
               ns = defaultNamespace;                 
            QName entryName = new QName(ns, entryElement.name());

            entryType = new TypeBinding();
            entryType.setSchemaBinding(schemaBinding);
            entryType.setHandler(entryHandler);

            entryTypeInfo = JBossXBBuilder.configuration.getTypeInfo(DefaultMapEntry.class);                    
            ElementBinding entryElementBinding = createElementBinding(entryTypeInfo, entryType, entryName, false);
            ParticleBinding entryParticle = new ParticleBinding(entryElementBinding, 0, -1, true);
            targetGroup.addParticle(entryParticle);
              
            propertyQName = entryName;
              
            if(keyAttribute != null)
            {
               TypeBinding attributeType = resolveTypeBinding(keyType);
               AttributeHandler attributeHandler = new PropertyHandler(entryInfo.getProperty("key"), keyType);
               String attrNs = keyAttribute.namespace();
               if(JBossXmlConstants.DEFAULT.equals(attrNs))
                  attrNs = defaultNamespace;
               AttributeBinding keyBinding = new AttributeBinding(schemaBinding, new QName(attrNs, keyAttribute.name()), attributeType, attributeHandler);
               keyBinding.setRequired(true);
               entryType.addAttribute(keyBinding);
            }

            if(valueAttribute != null)
View Full Code Here


      if(prop != null)
         keyElement = prop.getUnderlyingAnnotation(JBossXmlMapKeyElement.class);
      if(keyElement == null)
         keyElement = propType.getUnderlyingAnnotation(JBossXmlMapKeyElement.class);
     
      JBossXmlMapKeyAttribute keyAttribute = null;
      if(prop != null)
         keyAttribute = prop.getUnderlyingAnnotation(JBossXmlMapKeyAttribute.class);
      if(keyAttribute == null)
         keyAttribute = propType.getUnderlyingAnnotation(JBossXmlMapKeyAttribute.class);
     
      if(keyElement != null || keyAttribute != null)
      {
         // further assuming the map is bound

         JBossXmlMapValueElement valueElement = null;
         if(prop != null)
            valueElement = prop.getUnderlyingAnnotation(JBossXmlMapValueElement.class);
         if(valueElement == null)
            valueElement = propType.getUnderlyingAnnotation(JBossXmlMapValueElement.class);
        
         JBossXmlMapValueAttribute valueAttribute = null;
         if(prop != null)
            valueAttribute = prop.getUnderlyingAnnotation(JBossXmlMapValueAttribute.class);
         if(valueAttribute == null)
            valueAttribute = propType.getUnderlyingAnnotation(JBossXmlMapValueAttribute.class);

         TypeInfo keyType = propType.getKeyType();
         TypeInfo valueType = propType.getValueType();

         // entry handler
         BeanAdapterFactory entryAdapterFactory = null;
         BeanInfo entryInfo = JBossXBBuilder.configuration.getBeanInfo(DefaultMapEntry.class);
         entryAdapterFactory = createAdapterFactory(DefaultBeanAdapterBuilder.class, entryInfo, null);
         BeanHandler entryHandler = new BeanHandler(entryInfo.getName(), entryAdapterFactory);

         TypeBinding entryType = null;
         TypeInfo entryTypeInfo = null;

         // bind the entry element if present
         if(entryElement != null && !JBossXmlConstants.DEFAULT.equals(entryElement.name()))
         {
            String ns = entryElement.namespace();
            if(JBossXmlConstants.DEFAULT.equals(ns))
               ns = defaultNamespace;                 
            QName entryName = new QName(ns, entryElement.name());

            entryType = new TypeBinding();
            entryType.setSchemaBinding(schemaBinding);
            entryType.setHandler(entryHandler);

            entryTypeInfo = JBossXBBuilder.configuration.getTypeInfo(DefaultMapEntry.class);                    
            ElementBinding entryElementBinding = createElementBinding(entryTypeInfo, entryType, entryName, false);
            ParticleBinding entryParticle = new ParticleBinding(entryElementBinding, 0, -1, true);
            targetGroup.addParticle(entryParticle);
              
            propertyQName = entryName;
              
            if(keyAttribute != null)
            {
               TypeBinding attributeType = resolveTypeBinding(keyType);
               AttributeHandler attributeHandler = new PropertyHandler(entryInfo.getProperty("key"), keyType);
               QName attrQName = generateXmlName(keyType, attributeForm, keyAttribute.namespace(), keyAttribute.name());
               AttributeBinding keyBinding = new AttributeBinding(schemaBinding, attrQName, attributeType, attributeHandler);
               keyBinding.setRequired(true);
               entryType.addAttribute(keyBinding);
            }
View Full Code Here

      if(prop != null)
         keyElement = prop.getUnderlyingAnnotation(JBossXmlMapKeyElement.class);
      if(keyElement == null)
         keyElement = propType.getUnderlyingAnnotation(JBossXmlMapKeyElement.class);
     
      JBossXmlMapKeyAttribute keyAttribute = null;
      if(prop != null)
         keyAttribute = prop.getUnderlyingAnnotation(JBossXmlMapKeyAttribute.class);
      if(keyAttribute == null)
         keyAttribute = propType.getUnderlyingAnnotation(JBossXmlMapKeyAttribute.class);
     
      if(keyElement != null || keyAttribute != null)
      {
         // further assuming the map is bound

         JBossXmlMapValueElement valueElement = null;
         if(prop != null)
            valueElement = prop.getUnderlyingAnnotation(JBossXmlMapValueElement.class);
         if(valueElement == null)
            valueElement = propType.getUnderlyingAnnotation(JBossXmlMapValueElement.class);
        
         JBossXmlMapValueAttribute valueAttribute = null;
         if(prop != null)
            valueAttribute = prop.getUnderlyingAnnotation(JBossXmlMapValueAttribute.class);
         if(valueAttribute == null)
            valueAttribute = propType.getUnderlyingAnnotation(JBossXmlMapValueAttribute.class);

         TypeInfo keyType = propType.getKeyType();
         TypeInfo valueType = propType.getValueType();

         // entry handler
         BeanAdapterFactory entryAdapterFactory = null;
         BeanInfo entryInfo = JBossXBBuilder.configuration.getBeanInfo(DefaultMapEntry.class);
         entryAdapterFactory = createAdapterFactory(DefaultBeanAdapterBuilder.class, entryInfo, null);
         BeanHandler entryHandler = new BeanHandler(entryInfo.getName(), entryAdapterFactory);

         TypeBinding entryType = null;
         TypeInfo entryTypeInfo = null;

         // bind the entry element if present
         if(entryElement != null && !JBossXmlConstants.DEFAULT.equals(entryElement.name()))
         {
            String ns = entryElement.namespace();
            if(JBossXmlConstants.DEFAULT.equals(ns))
               ns = defaultNamespace;                 
            QName entryName = new QName(ns, entryElement.name());

            entryType = new TypeBinding();
            entryType.setSchemaBinding(schemaBinding);
            entryType.setHandler(entryHandler);

            entryTypeInfo = JBossXBBuilder.configuration.getTypeInfo(DefaultMapEntry.class);                    
            ElementBinding entryElementBinding = createElementBinding(entryTypeInfo, entryType, entryName, false);
            ParticleBinding entryParticle = new ParticleBinding(entryElementBinding, 0, -1, true);
            targetGroup.addParticle(entryParticle);
              
            propertyQName = entryName;
              
            if(keyAttribute != null)
            {
               TypeBinding attributeType = resolveTypeBinding(keyType);
               AttributeHandler attributeHandler = new PropertyHandler(entryInfo.getProperty("key"), keyType);
               String attrNs = keyAttribute.namespace();
               if(JBossXmlConstants.DEFAULT.equals(attrNs))
                  attrNs = defaultNamespace;
               AttributeBinding keyBinding = new AttributeBinding(schemaBinding, new QName(attrNs, keyAttribute.name()), attributeType, attributeHandler);
               keyBinding.setRequired(true);
               entryType.addAttribute(keyBinding);
            }

            if(valueAttribute != null)
View Full Code Here

      if(prop != null)
         keyElement = prop.getUnderlyingAnnotation(JBossXmlMapKeyElement.class);
      if(keyElement == null)
         keyElement = propType.getUnderlyingAnnotation(JBossXmlMapKeyElement.class);
     
      JBossXmlMapKeyAttribute keyAttribute = null;
      if(prop != null)
         keyAttribute = prop.getUnderlyingAnnotation(JBossXmlMapKeyAttribute.class);
      if(keyAttribute == null)
         keyAttribute = propType.getUnderlyingAnnotation(JBossXmlMapKeyAttribute.class);
     
      if(keyElement != null || keyAttribute != null)
      {
         // further assuming the map is bound

         JBossXmlMapValueElement valueElement = null;
         if(prop != null)
            valueElement = prop.getUnderlyingAnnotation(JBossXmlMapValueElement.class);
         if(valueElement == null)
            valueElement = propType.getUnderlyingAnnotation(JBossXmlMapValueElement.class);
        
         JBossXmlMapValueAttribute valueAttribute = null;
         if(prop != null)
            valueAttribute = prop.getUnderlyingAnnotation(JBossXmlMapValueAttribute.class);
         if(valueAttribute == null)
            valueAttribute = propType.getUnderlyingAnnotation(JBossXmlMapValueAttribute.class);

         TypeInfo keyType = propType.getKeyType();
         TypeInfo valueType = propType.getValueType();

         // entry handler
         BeanAdapterFactory entryAdapterFactory = null;
         BeanInfo entryInfo = JBossXBBuilder.configuration.getBeanInfo(DefaultMapEntry.class);
         entryAdapterFactory = createAdapterFactory(DefaultBeanAdapterBuilder.class, entryInfo, null);
         BeanHandler entryHandler = new BeanHandler(entryInfo.getName(), entryAdapterFactory);

         TypeBinding entryType = null;
         TypeInfo entryTypeInfo = null;

         // bind the entry element if present
         if(entryElement != null && !JBossXmlConstants.DEFAULT.equals(entryElement.name()))
         {
            String ns = entryElement.namespace();
            if(JBossXmlConstants.DEFAULT.equals(ns))
               ns = defaultNamespace;                 
            QName entryName = new QName(ns, entryElement.name());

            entryType = new TypeBinding();
            entryType.setSchemaBinding(schemaBinding);
            entryType.setHandler(entryHandler);

            entryTypeInfo = JBossXBBuilder.configuration.getTypeInfo(DefaultMapEntry.class);                    
            ElementBinding entryElementBinding = createElementBinding(entryTypeInfo, entryType, entryName, false);
            ParticleBinding entryParticle = new ParticleBinding(entryElementBinding, 0, -1, true);
            targetGroup.addParticle(entryParticle);
              
            propertyQName = entryName;
              
            if(keyAttribute != null)
            {
               TypeBinding attributeType = resolveTypeBinding(keyType);
               AttributeHandler attributeHandler = new PropertyHandler(entryInfo.getProperty("key"), keyType);
               QName attrQName = generateXmlName(keyType, attributeForm, keyAttribute.namespace(), keyAttribute.name());
               AttributeBinding keyBinding = new AttributeBinding(schemaBinding, attrQName, attributeType, attributeHandler);
               keyBinding.setRequired(true);
               entryType.addAttribute(keyBinding);
            }
View Full Code Here

      if(prop != null)
         keyElement = prop.getUnderlyingAnnotation(JBossXmlMapKeyElement.class);
      if(keyElement == null)
         keyElement = propType.getUnderlyingAnnotation(JBossXmlMapKeyElement.class);
     
      JBossXmlMapKeyAttribute keyAttribute = null;
      if(prop != null)
         keyAttribute = prop.getUnderlyingAnnotation(JBossXmlMapKeyAttribute.class);
      if(keyAttribute == null)
         keyAttribute = propType.getUnderlyingAnnotation(JBossXmlMapKeyAttribute.class);
     
      if(keyElement != null || keyAttribute != null)
      {
         // further assuming the map is bound

         JBossXmlMapValueElement valueElement = null;
         if(prop != null)
            valueElement = prop.getUnderlyingAnnotation(JBossXmlMapValueElement.class);
         if(valueElement == null)
            valueElement = propType.getUnderlyingAnnotation(JBossXmlMapValueElement.class);
        
         JBossXmlMapValueAttribute valueAttribute = null;
         if(prop != null)
            valueAttribute = prop.getUnderlyingAnnotation(JBossXmlMapValueAttribute.class);
         if(valueAttribute == null)
            valueAttribute = propType.getUnderlyingAnnotation(JBossXmlMapValueAttribute.class);

         TypeInfo keyType = propType.getKeyType();
         TypeInfo valueType = propType.getValueType();

         // entry handler
         BeanAdapterFactory entryAdapterFactory = null;
         BeanInfo entryInfo = JBossXBBuilder.configuration.getBeanInfo(DefaultMapEntry.class);
         entryAdapterFactory = createAdapterFactory(DefaultBeanAdapterBuilder.class, entryInfo, null);
         BeanHandler entryHandler = new BeanHandler(entryInfo.getName(), entryAdapterFactory);

         TypeBinding entryType = null;
         TypeInfo entryTypeInfo = null;

         // bind the entry element if present
         if(entryElement != null && !JBossXmlConstants.DEFAULT.equals(entryElement.name()))
         {
            String ns = entryElement.namespace();
            if(JBossXmlConstants.DEFAULT.equals(ns))
               ns = defaultNamespace;                 
            QName entryName = new QName(ns, entryElement.name());

            entryType = new TypeBinding();
            entryType.setSchemaBinding(schemaBinding);
            entryType.setHandler(entryHandler);

            entryTypeInfo = JBossXBBuilder.configuration.getTypeInfo(DefaultMapEntry.class);                    
            ElementBinding entryElementBinding = createElementBinding(entryTypeInfo, entryType, entryName, false);
            ParticleBinding entryParticle = new ParticleBinding(entryElementBinding, 0, -1, true);
            targetGroup.addParticle(entryParticle);
              
            propertyQName = entryName;
              
            if(keyAttribute != null)
            {
               TypeBinding attributeType = resolveTypeBinding(keyType);
               AttributeHandler attributeHandler = new PropertyHandler(entryInfo.getProperty("key"), keyType);
               QName attrQName = generateXmlName(keyType, attributeForm, keyAttribute.namespace(), keyAttribute.name());
               AttributeBinding keyBinding = new AttributeBinding(schemaBinding, attrQName, attributeType, attributeHandler);
               keyBinding.setRequired(true);
               entryType.addAttribute(keyBinding);
            }
View Full Code Here

TOP

Related Classes of org.jboss.xb.annotations.JBossXmlMapKeyAttribute

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.