Package org.jboss.xb.binding.metadata

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


/*      */       {
/*  656 */         marshalled = marshalModelGroup(modelGroup, declareNs);
/*      */       }
/*      */       else
/*      */       {
/*  660 */         PropertyMetaData propertyMetaData = modelGroup.getPropertyMetaData();
/*  661 */         if (propertyMetaData == null)
/*      */         {
/*  663 */           throw new JBossXBRuntimeException("Currently, property binding metadata must be available for a model group to be marshalled!");
/*      */         }
/*      */
/*  668 */         Object o = getChildren(this.stack.peek(), propertyMetaData.getName(), modelGroup.getSchema().isIgnoreUnresolvedFieldOrClass());
/*      */
/*  672 */         TermBeforeMarshallingCallback marshallingHandler = modelGroup.getBeforeMarshallingCallback();
/*      */
/*  674 */         Iterator i = (o != null) && (isRepeatable(particle)) ? getIterator(o) : null;
/*  675 */         if (i != null)
View Full Code Here


/* 1171 */         value = peeked;
/*      */       }
/*      */       else
/*      */       {
/* 1175 */         String fieldName = null;
/* 1176 */         PropertyMetaData propertyMetaData = element.getPropertyMetaData();
/* 1177 */         if (propertyMetaData != null)
/*      */         {
/* 1179 */           fieldName = propertyMetaData.getName();
/*      */         }
/*      */
/* 1182 */         if (fieldName == null)
/*      */         {
/* 1184 */           fieldName = Util.xmlNameToFieldName(element.getQName().getLocalPart(), ignoreLowLine);
View Full Code Here

/*  730 */           CharactersMetaData charactersMetaData = appInfo.getCharactersMetaData();
/*  731 */           if (charactersMetaData != null)
/*      */           {
/*  733 */             if (this.trace)
/*      */             {
/*  735 */               PropertyMetaData propertyMetaData = charactersMetaData.getProperty();
/*  736 */               if (propertyMetaData != null)
/*      */               {
/*  738 */                 log.trace("complex type " + type.getName() + ": characters bound to " + propertyMetaData.getName());
/*      */               }
/*      */
/*  744 */               ValueMetaData valueMetaData = charactersMetaData.getValue();
/*  745 */               if (valueMetaData != null)
/*      */               {
/*  747 */                 log.trace("complex type " + type.getName() + ": characters unmarshalMethod=" + valueMetaData.getUnmarshalMethod() + ", marshalMethod=" + valueMetaData.getMarshalMethod());
/*      */               }
/*      */
/*  755 */               boolean mapEntryKey = appInfo.isMapEntryKey();
/*  756 */               if (mapEntryKey)
/*      */               {
/*  758 */                 log.trace("complex type " + type.getName() + ": characters are bound as a key in a map entry");
/*      */               }
/*      */
/*  764 */               boolean mapEntryValue = appInfo.isMapEntryValue();
/*  765 */               if (mapEntryValue)
/*      */               {
/*  767 */                 log.trace("complex type " + type.getName() + ": characters are bound as a value in a map entry");
/*      */               }
/*      */
/*      */             }
/*      */
/*  773 */             binding.setCharactersMetaData(charactersMetaData);
/*      */           }
/*      */
/*  776 */           MapEntryMetaData mapEntryMetaData = appInfo.getMapEntryMetaData();
/*  777 */           if (mapEntryMetaData != null)
/*      */           {
/*  779 */             if (this.trace)
/*      */             {
/*  781 */               log.trace("complex type " + type.getName() + " is bound to a map entry: impl=" + mapEntryMetaData.getImpl() + ", getKeyMethod=" + mapEntryMetaData.getGetKeyMethod() + ", setKeyMethod=" + mapEntryMetaData.getSetKeyMethod() + ", getValueMethod=" + mapEntryMetaData.getGetValueMethod() + ", setValueMethod=" + mapEntryMetaData.getSetValueMethod() + ", valueType=" + mapEntryMetaData.getValueType() + ", nonNullValue=" + mapEntryMetaData.isNonNullValue());
/*      */             }
/*      */
/*  799 */             if (classMetaData != null)
/*      */             {
/*  801 */               throw new JBossXBRuntimeException("Illegal binding: both jbxb:class and jbxb:mapEntry are specified for complex type " + type.getName());
/*      */             }
/*      */
/*  805 */             binding.setMapEntryMetaData(mapEntryMetaData);
/*      */           }
/*      */
/*  808 */           boolean skip = appInfo.isSkip();
/*  809 */           if (skip)
/*      */           {
/*  811 */             if (this.trace)
/*      */             {
/*  813 */               log.trace("complex type " + type.getName() + ": elements of this type will be skipped; their attrs, character content " + "and elements will be set the parent.");
/*      */             }
/*      */
/*  819 */             binding.setSkip(skip);
/*      */           }
/*      */
/*  822 */           PropertyMetaData propertyMetaData = appInfo.getPropertyMetaData();
/*  823 */           if (propertyMetaData != null)
/*      */           {
/*  825 */             if (this.trace)
/*      */             {
/*  827 */               log.trace("complex type " + type.getName() + ": the content of elements of this type is bound to property " + propertyMetaData.getName());
/*      */             }
/*      */
/*  832 */             binding.setPropertyMetaData(propertyMetaData);
/*      */           }
/*      */
View Full Code Here

/*      */
/*  916 */         XsdAnnotation xsdAn = XsdAnnotation.unmarshal(an.getAnnotationString());
/*  917 */         XsdAppInfo appInfo = xsdAn.getAppInfo();
/*  918 */         if (appInfo != null)
/*      */         {
/*  920 */           PropertyMetaData propertyMetaData = appInfo.getPropertyMetaData();
/*  921 */           if (propertyMetaData != null)
/*      */           {
/*  923 */             binding.setPropertyMetaData(propertyMetaData);
/*      */           }
/*      */
View Full Code Here

/*      */         }
/* 1273 */         term.setClassMetaData(classMetaData);
/* 1274 */         skip = Boolean.FALSE;
/*      */       }
/*      */
/* 1277 */       PropertyMetaData propertyMetaData = appInfo.getPropertyMetaData();
/* 1278 */       if (propertyMetaData != null)
/*      */       {
/* 1280 */         if (trace)
/*      */         {
/* 1282 */           String msg = "element: name=" + ((ElementBinding)term).getQName() + ", ";
/*      */
/* 1284 */           msg = msg + " property=" + propertyMetaData.getName() + ", collectionType=" + propertyMetaData.getCollectionType();
/*      */
/* 1287 */           log.trace(msg);
/*      */         }
/* 1289 */         term.setPropertyMetaData(propertyMetaData);
/*      */       }
View Full Code Here

/*  50 */     SchemaBinding schema = ctx.getSchemaBinding();
/*  51 */     AttributeBinding binding = ctx.getAttributeBinding();
/*  52 */     QName qName = binding.getQName();
/*     */
/*  54 */     String fieldName = null;
/*  55 */     PropertyMetaData propertyMetaData = binding.getPropertyMetaData();
/*  56 */     if (propertyMetaData != null)
/*     */     {
/*  58 */       fieldName = propertyMetaData.getName();
/*     */     }
/*     */
/*  61 */     if (fieldName == null)
/*     */     {
/*  63 */       fieldName = Util.xmlNameToFieldName(qName.getLocalPart(), schema.isIgnoreLowLine());
View Full Code Here

/* 73 */       valueList.getInitializer().addAttributeValue(attrName, binding, valueList, value);
/*    */     }
/*    */     else
/*    */     {
/* 77 */       String property = null;
/* 78 */       PropertyMetaData propertyMetaData = binding.getPropertyMetaData();
/* 79 */       if (propertyMetaData != null)
/*    */       {
/* 81 */         property = propertyMetaData.getName();
/*    */       }
/*    */
/* 84 */       if (property == null)
/*    */       {
/* 86 */         property = Util.xmlNameToFieldName(attrName.getLocalPart(), binding.getSchema().isIgnoreLowLine());
View Full Code Here

/*      */     }
/*      */
/*      */     public String resolvePropertyName()
/*      */     {
/* 1463 */       TermBinding term = this.particle.getTerm();
/* 1464 */       PropertyMetaData propertyMetaData = term.getPropertyMetaData();
/* 1465 */       String prop = propertyMetaData == null ? null : propertyMetaData.getName();
/*      */
/* 1467 */       if (prop != null)
/*      */       {
/* 1469 */         return prop;
/*      */       }
View Full Code Here

/* 162 */       String propName = null;
/* 163 */       String colType = null;
/* 164 */       TypeBinding type = element.getType();
/* 165 */       if ((type != null) && (!type.isSimple()))
/*     */       {
/* 167 */         PropertyMetaData propertyMetaData = type.getPropertyMetaData();
/* 168 */         if (propertyMetaData == null)
/*     */         {
/* 170 */           CharactersMetaData charactersMetaData = type.getCharactersMetaData();
/* 171 */           propertyMetaData = charactersMetaData == null ? null : charactersMetaData.getProperty();
/*     */         }
/*     */
/* 174 */         if (propertyMetaData != null)
/*     */         {
/* 176 */           propName = propertyMetaData.getName();
/* 177 */           colType = propertyMetaData.getCollectionType();
/*     */         }
/*     */
/* 180 */         if (propName == null)
/*     */         {
/* 182 */           propName = type.getSchemaBinding().getSimpleContentProperty();
/*     */         }
/*     */       }
/*     */       else
/*     */       {
/* 187 */         PropertyMetaData PropertyMetaData = element.getPropertyMetaData();
/* 188 */         if (PropertyMetaData != null)
/*     */         {
/* 190 */           propName = PropertyMetaData.getName();
/* 191 */           colType = PropertyMetaData.getCollectionType();
/*     */         }
/*     */
/* 194 */         if (propName == null)
/*     */         {
/* 196 */           propName = Util.xmlNameToFieldName(qName.getLocalPart(), element.getSchema().isIgnoreLowLine());
View Full Code Here

/*     */   void addRepeatableTermValue(QName qName, ParticleBinding binding, Object handler, Object value, ParticleBinding parentParticle)
/*     */   {
/* 116 */     NonRequiredValue last = (NonRequiredValue)(this.nonRequiredValues.isEmpty() ? null : this.nonRequiredValues.get(this.nonRequiredValues.size() - 1));
/* 117 */     if ((last == null) || (last.binding != binding))
/*     */     {
/* 120 */       PropertyMetaData propMetaData = binding.getTerm().getPropertyMetaData();
/*     */       Collection col;
/* 121 */       if ((propMetaData != null) && (propMetaData.getCollectionType() != null))
/*     */       {
/* 123 */         Class colCls = RtUtil.loadClass(propMetaData.getCollectionType(), true);
/*     */         try
/*     */         {
/* 126 */           col = (Collection)colCls.newInstance();
/*     */         }
/*     */         catch (Exception e)
/*     */         {
/*     */           Collection col;
/* 130 */           throw new JBossXBRuntimeException("Failed to create an instance of " + colCls.getName() + " for property " + propMetaData.getName());
/*     */         }
/*     */       }
/*     */       else
/*     */       {
/* 135 */         col = new ArrayList();
View Full Code Here

TOP

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

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.