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

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


               TypeInfo attributeTypeInfo = property.getType();
               if (jbossXmlAttribute != null && jbossXmlAttribute.type() != Object.class)
                  attributeTypeInfo = attributeTypeInfo.getTypeInfoFactory().getTypeInfo(jbossXmlAttribute.type());
               TypeBinding attributeType = resolveTypeBinding(attributeTypeInfo);
               // Create the attribute handler
               AttributeHandler attributeHandler = new PropertyHandler(property, attributeTypeInfo);
               // Create the attributre and bind it to the type
               AttributeBinding attribute = new AttributeBinding(schemaBinding, qName, attributeType, attributeHandler);
               attribute.setRequired(xmlAttribute.required());
               typeBinding.addAttribute(attribute);
               JBossXmlPreserveWhitespace preserveSpace = property.getUnderlyingAnnotation(JBossXmlPreserveWhitespace.class);
View Full Code Here


            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);
            }

            if(valueAttribute != null)
            {
               TypeBinding attributeType = resolveTypeBinding(valueType);
               AttributeHandler attributeHandler = new PropertyHandler(entryInfo.getProperty("value"), valueType);
               QName attrQName = generateXmlName(valueType, attributeForm, valueAttribute.namespace(), valueAttribute.name());
               AttributeBinding valueBinding = new AttributeBinding(schemaBinding, attrQName, attributeType, attributeHandler);
               valueBinding.setRequired(true);
               entryType.addAttribute(valueBinding);
            }
View Full Code Here

               TypeInfo attributeTypeInfo = property.getType();
               if (jbossXmlAttribute != null && jbossXmlAttribute.type() != Object.class)
                  attributeTypeInfo = attributeTypeInfo.getTypeInfoFactory().getTypeInfo(jbossXmlAttribute.type());
               TypeBinding attributeType = resolveTypeBinding(attributeTypeInfo);
               // Create the attribute handler
               AttributeHandler attributeHandler = new PropertyHandler(property, attributeTypeInfo);
               // Create the attributre and bind it to the type
               AttributeBinding attribute = new AttributeBinding(schemaBinding, qName, attributeType, attributeHandler);
               attribute.setRequired(xmlAttribute.required());
               typeBinding.addAttribute(attribute);
               if (trace)
View Full Code Here

                     }
                  }
                  else if(binding instanceof AttributeBinding)
                  {
                     AttributeBinding attr = (AttributeBinding)binding;
                     AttributeHandler handler = attr.getHandler();
                     if(handler != null)
                     {
                        if(parentValueList != null)
                        {
                           parentValueList.setAttributeValue(attr.getQName(), attr, valueEntry.value);
                        }
                        else
                        {
                           handler.attribute(valueEntry.qName, attr.getQName(), attr, parent, valueEntry.value);
                        }
                     }
                     else
                     {
                        throw new JBossXBRuntimeException("Attribute binding present but has no handler: element=" +
View Full Code Here

      {
         QName attrName = new QName(attrs.getURI(i), attrs.getLocalName(i));
         AttributeBinding binding = type.getAttribute(attrName);
         if(binding != null)
         {
            AttributeHandler handler = binding.getHandler();
            if(handler != null)
            {
               Object value = handler.unmarshal(elementName, attrName, binding, nsCtx, attrs.getValue(i));
               handler.attribute(elementName, attrName, binding, o, value);
            }
            else
            {
               throw new JBossXBRuntimeException(
                  "Attribute binding present but has no handler: element=" + elementName + ", attrinute=" + attrName
View Full Code Here

/*  842 */           TypeInfo attributeTypeInfo = property.getType();
/*  843 */           if ((jbossXmlAttribute != null) && (jbossXmlAttribute.type() != Object.class))
/*  844 */             attributeTypeInfo = attributeTypeInfo.getTypeInfoFactory().getTypeInfo(jbossXmlAttribute.type());
/*  845 */           TypeBinding attributeType = resolveTypeBinding(attributeTypeInfo);
/*      */
/*  847 */           AttributeHandler attributeHandler = new PropertyHandler(property, attributeTypeInfo);
/*      */
/*  849 */           AttributeBinding attribute = new AttributeBinding(this.schemaBinding, qName, attributeType, attributeHandler);
/*  850 */           attribute.setRequired(xmlAttribute.required());
/*  851 */           typeBinding.addAttribute(attribute);
/*  852 */           if (this.trace) {
View Full Code Here

/*     */               }
/*     */             }
/* 436 */             else if ((binding instanceof AttributeBinding))
/*     */             {
/* 438 */               AttributeBinding attr = (AttributeBinding)binding;
/* 439 */               AttributeHandler handler = attr.getHandler();
/* 440 */               if (handler != null)
/*     */               {
/* 442 */                 if (this.parentValueList != null)
/*     */                 {
/* 444 */                   this.parentValueList.setAttributeValue(attr.getQName(), attr, valueEntry.value);
/*     */                 }
/*     */                 else
/*     */                 {
/* 448 */                   handler.attribute(valueEntry.qName, attr.getQName(), attr, this.val$parent, valueEntry.value);
/*     */                 }
/*     */               }
/*     */               else
/*     */               {
/* 453 */                 throw new JBossXBRuntimeException("Attribute binding present but has no handler: element=" + valueEntry.qName + ", attrinute=" + attr.getQName());
View Full Code Here

/*      */     {
/*  744 */       QName attrName = new QName(attrs.getURI(i), attrs.getLocalName(i));
/*  745 */       AttributeBinding binding = type.getAttribute(attrName);
/*  746 */       if (binding != null)
/*      */       {
/*  748 */         AttributeHandler handler = binding.getHandler();
/*  749 */         if (handler != null)
/*      */         {
/*  751 */           Object value = handler.unmarshal(elementName, attrName, binding, nsCtx, attrs.getValue(i));
/*  752 */           handler.attribute(elementName, attrName, binding, o, value);
/*      */         }
/*      */         else
/*      */         {
/*  756 */           throw new JBossXBRuntimeException("Attribute binding present but has no handler: element=" + elementName + ", attrinute=" + attrName);
/*      */         }
View Full Code Here

               TypeInfo attributeTypeInfo = property.getType();
               if (jbossXmlAttribute != null && jbossXmlAttribute.type() != Object.class)
                  attributeTypeInfo = attributeTypeInfo.getTypeInfoFactory().getTypeInfo(jbossXmlAttribute.type());
               TypeBinding attributeType = resolveTypeBinding(attributeTypeInfo);
               // Create the attribute handler
               AttributeHandler attributeHandler = new PropertyHandler(property, attributeTypeInfo);
               // Create the attributre and bind it to the type
               AttributeBinding attribute = new AttributeBinding(schemaBinding, qName, attributeType, attributeHandler);
               attribute.setRequired(xmlAttribute.required());
               typeBinding.addAttribute(attribute);
               JBossXmlPreserveWhitespace preserveSpace = property.getUnderlyingAnnotation(JBossXmlPreserveWhitespace.class);
View Full Code Here

            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);
            }

            if(valueAttribute != null)
            {
               TypeBinding attributeType = resolveTypeBinding(valueType);
               AttributeHandler attributeHandler = new PropertyHandler(entryInfo.getProperty("value"), valueType);
               QName attrQName = generateXmlName(valueType, attributeForm, valueAttribute.namespace(), valueAttribute.name());
               AttributeBinding valueBinding = new AttributeBinding(schemaBinding, attrQName, attributeType, attributeHandler);
               valueBinding.setRequired(true);
               entryType.addAttribute(valueBinding);
            }
View Full Code Here

TOP

Related Classes of org.jboss.xb.binding.sunday.unmarshalling.AttributeHandler

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.