Package org.jboss.metatype.api.types

Examples of org.jboss.metatype.api.types.TableMetaType


   {
      String[] itemNames = new String[] { "name1", "name2" };
      String[] itemDescriptions = new String[] { "desc1", "desc2" };
      MetaType[] itemTypes = new MetaType[] { SimpleMetaType.STRING, SimpleMetaType.INTEGER };
      CompositeMetaType compositeType = new ImmutableCompositeMetaType("typeName", "description", itemNames, itemDescriptions, itemTypes);
      TableMetaType tableType = new ImmutableTableMetaType("typeName", "description", compositeType, new String[] { "name1" });
      TableValue tv = new MockTableValue(tableType);
      TableValue[][] tabData1 = new TableValue[][]
      {
         { tv, null }, { tv, tv }
      };

      ArrayMetaType tabArrayType1 = new ArrayMetaType(2, tableType);
      assertTrue("tabData1 should be a value of array type", tabArrayType1.isValue(tabData1));

      ArrayMetaType tabArrayType2 = new ArrayMetaType(1, tableType);
      assertFalse("tabData1 should not be a value of array type, wrong number of dimensions", tabArrayType2.isValue(tabData1));

      TableMetaType tableType2 = new ImmutableTableMetaType("typeName2", "description", compositeType, new String[] { "name1" });
      ArrayMetaType tabArrayType3 = new ArrayMetaType(2, tableType2);
      assertFalse("tabData1 should not be a value of array type, wrong element type", tabArrayType3.isValue(tabData1));
   }
View Full Code Here


      CompositeMetaType keyType = (CompositeMetaType) resolve(StringKey.class);
      MetaType valueType = resolve(Integer.class);
      MetaType[] itemTypes = { keyType, valueType };
      String entryName = Map.Entry.class.getName();
      CompositeMetaType entryType = new ImmutableCompositeMetaType(entryName, entryName, DefaultMetaTypeFactory.MAP_ITEM_NAMES, DefaultMetaTypeFactory.MAP_ITEM_NAMES, itemTypes);
      TableMetaType tableType = new ImmutableTableMetaType(Map.class.getName(), Map.class.getName(), entryType, DefaultMetaTypeFactory.MAP_INDEX_NAMES);
     
      TableValue expected = new TableValueSupport(tableType);
      String[] itemNames = DefaultMetaTypeFactory.MAP_ITEM_NAMES;
     
      MetaValue[] keyValues1 = {SimpleValueSupport.wrap("Hello")};
View Full Code Here

      MetaType keyType = resolve(TestSimpleComposite.class);
      MetaType valueType = resolve(Integer.class);
      MetaType[] itemTypes = { keyType, valueType };
      String entryName = Map.Entry.class.getName();
      CompositeMetaType entryType = new ImmutableCompositeMetaType(entryName, entryName, DefaultMetaTypeFactory.MAP_ITEM_NAMES, DefaultMetaTypeFactory.MAP_ITEM_NAMES, itemTypes);
      TableMetaType tableType = new ImmutableTableMetaType(Map.class.getName(), Map.class.getName(), entryType, DefaultMetaTypeFactory.MAP_INDEX_NAMES);
     
      TableValue expected = new TableValueSupport(tableType);
      String[] itemNames = DefaultMetaTypeFactory.MAP_ITEM_NAMES;
     
      MutableCompositeMetaType compositeType = new MutableCompositeMetaType(TestSimpleComposite.class.getName(), TestSimpleComposite.class.getName());
View Full Code Here

      CompositeMetaType keyType = (CompositeMetaType) resolve(StringKey.class);
      MetaType valueType = resolve(TestSimpleComposite.class);
      MetaType[] itemTypes = { keyType, valueType };
      String entryName = Map.Entry.class.getName();
      CompositeMetaType entryType = new ImmutableCompositeMetaType(entryName, entryName, DefaultMetaTypeFactory.MAP_ITEM_NAMES, DefaultMetaTypeFactory.MAP_ITEM_NAMES, itemTypes);
      TableMetaType tableType = new ImmutableTableMetaType(Map.class.getName(), Map.class.getName(), entryType, DefaultMetaTypeFactory.MAP_INDEX_NAMES);
     
      TableValue expected = new TableValueSupport(tableType);
      String[] itemNames = DefaultMetaTypeFactory.MAP_ITEM_NAMES;
     
      MutableCompositeMetaType compositeType = new MutableCompositeMetaType(TestSimpleComposite.class.getName(), TestSimpleComposite.class.getName());
View Full Code Here

    *
    * @throws Exception for any problem
    */
   public void testTableValueSupport() throws Exception
   {
      TableMetaType tableType = initTableType();

      new TableValueSupport(tableType);
      new TableValueSupport(tableType, 100, .5f);
   }
View Full Code Here

    *
    * @throws Exception for any problem
    */
   public void testGetTableType() throws Exception
   {
      TableMetaType tableType = initTableType();

      TableValueSupport data = new TableValueSupport(tableType);
      assertTrue("Expected the same table type", data.getMetaType().equals(tableType));
   }
View Full Code Here

    *
    * @throws Exception for any problem
    */
   public void testCalculateIndex() throws Exception
   {
      TableMetaType tableType = initTableType();

      TableValueSupport data = new TableValueSupport(tableType);

      CompositeValue compData = initCompositeValue(data);
      Object[] index = data.calculateIndex(compData);
View Full Code Here

    *
    * @throws Exception for any problem
    */
   public void testContainsKey() throws Exception
   {
      TableMetaType tableType = initTableType();

      TableValueSupport data = new TableValueSupport(tableType);

      assertFalse("Didn't expect containsKey null", data.containsKey(null));

View Full Code Here

    *
    * @throws Exception for any problem
    */
   public void testContainsValue() throws Exception
   {
      TableMetaType tableType = initTableType();

      TableValueSupport data = new TableValueSupport(tableType);

      assertFalse("Didn't expect containsValue null", data.containsValue(null));

View Full Code Here

    *
    * @throws Exception for any problem
    */
   public void testGet() throws Exception
   {
      TableMetaType tableType = initTableType();

      TableValueSupport data = new TableValueSupport(tableType);

      MetaValue[] index = initValues2();
      assertNull("Expected null for get on data not present", data.get(index));
View Full Code Here

TOP

Related Classes of org.jboss.metatype.api.types.TableMetaType

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.