Package org.jboss.metatype.api.values

Examples of org.jboss.metatype.api.values.TableValueSupport


   public TableValue createTableValue(TableMetaType type, Map value, Map<Object, MetaValue> mapping)
   {
      if (value == null)
         return null;
     
      TableValueSupport table = new TableValueSupport(type);
      mapping.put(value, table);
     
      CompositeMetaType entryType = type.getRowType();
      MetaType keyType = entryType.getType(DefaultMetaTypeFactory.MAP_KEY);
      MetaType valType = entryType.getType(DefaultMetaTypeFactory.MAP_VALUE);

      for (Iterator<Map.Entry> i = value.entrySet().iterator(); i.hasNext();)
      {
         Map.Entry entry = i.next();
         MetaValue key = internalCreate(entry.getKey(), null, keyType);
         MetaValue val = internalCreate(entry.getValue(), null, valType);
         CompositeValueSupport data = new CompositeValueSupport(entryType, DefaultMetaTypeFactory.MAP_ITEM_NAMES, new MetaValue[] { key, val });
         table.put(data);
      }

      return table;
   }
View Full Code Here


    * @param type the table meta type
    * @return the table value
    */
   protected TableValue createTableValue(PersistedTableValue table, TableMetaType type)
   {
      TableValueSupport support = new TableValueSupport(type);
      if(table.getEntries() != null && table.getEntries().isEmpty() == false)
      {
         for(PersistedCompositeValue entry : table.getEntries())
         {
            support.put(createCompositeValue(entry, type.getRowType()));
         }        
      }
      return support;
   }
View Full Code Here

   public TableValue createTableValue(TableMetaType type, Map value, Map<Object, MetaValue> mapping)
   {
      if (value == null)
         return null;
     
      TableValueSupport table = new TableValueSupport(type);
      mapping.put(value, table);
     
      CompositeMetaType entryType = type.getRowType();
      MetaType keyType = entryType.getType(DefaultMetaTypeFactory.MAP_KEY);
      MetaType valType = entryType.getType(DefaultMetaTypeFactory.MAP_VALUE);

      for (Iterator<Map.Entry> i = value.entrySet().iterator(); i.hasNext();)
      {
         Map.Entry entry = i.next();
         MetaValue key = internalCreate(entry.getKey(), null, keyType);
         MetaValue val = internalCreate(entry.getValue(), null, valType);
         CompositeValueSupport data = new CompositeValueSupport(entryType, DefaultMetaTypeFactory.MAP_ITEM_NAMES, new MetaValue[] { key, val });
         table.put(data);
      }

      return table;
   }
View Full Code Here

/*      */   public TableValue createTableValue(TableMetaType type, Map value, Map<Object, MetaValue> mapping)
/*      */   {
/*  453 */     if (value == null) {
/*  454 */       return null;
/*      */     }
/*  456 */     TableValueSupport table = new TableValueSupport(type);
/*  457 */     mapping.put(value, table);
/*      */
/*  459 */     CompositeMetaType entryType = type.getRowType();
/*  460 */     MetaType keyType = entryType.getType("key");
/*  461 */     MetaType valType = entryType.getType("value");
/*      */
/*  463 */     for (Iterator i = value.entrySet().iterator(); i.hasNext(); )
/*      */     {
/*  465 */       Map.Entry entry = (Map.Entry)i.next();
/*  466 */       MetaValue key = internalCreate(entry.getKey(), null, keyType);
/*  467 */       MetaValue val = internalCreate(entry.getValue(), null, valType);
/*  468 */       CompositeValueSupport data = new CompositeValueSupport(entryType, DefaultMetaTypeFactory.MAP_ITEM_NAMES, new MetaValue[] { key, val });
/*  469 */       table.put(data);
/*      */     }
/*      */
/*  472 */     return table;
/*      */   }
View Full Code Here

   public TableValue createTableValue(TableMetaType type, Map value, Map<Object, MetaValue> mapping)
   {
      if (value == null)
         return null;
     
      TableValueSupport table = new TableValueSupport(type);
      mapping.put(value, table);
     
      CompositeMetaType entryType = type.getRowType();
      MetaType keyType = entryType.getType(DefaultMetaTypeFactory.MAP_KEY);
      MetaType valType = entryType.getType(DefaultMetaTypeFactory.MAP_VALUE);

      for (Iterator<Map.Entry> i = value.entrySet().iterator(); i.hasNext();)
      {
         Map.Entry entry = i.next();
         MetaValue key = internalCreate(entry.getKey(), null, keyType);
         MetaValue val = internalCreate(entry.getValue(), null, valType);
         CompositeValueSupport data = new CompositeValueSupport(entryType, DefaultMetaTypeFactory.MAP_ITEM_NAMES, new MetaValue[] { key, val });
         table.put(data);
      }

      return table;
   }
View Full Code Here

TOP

Related Classes of org.jboss.metatype.api.values.TableValueSupport

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.