Package org.jboss.metatype.plugins.types

Examples of org.jboss.metatype.plugins.types.MutableCompositeMetaType.freeze()


      TableValue expected = new TableValueSupport(tableType);
      String[] itemNames = DefaultMetaTypeFactory.MAP_ITEM_NAMES;
     
      MutableCompositeMetaType compositeType = new MutableCompositeMetaType(TestSimpleComposite.class.getName(), TestSimpleComposite.class.getName());
      compositeType.addItem("something", "something", SimpleMetaType.STRING);
      compositeType.freeze();

      String[] compositeNames = { "something" };
      CompositeValue compositeValue = new CompositeValueSupport(compositeType, compositeNames, new MetaValue[] { SimpleValueSupport.wrap("Hello") });
     
      MetaValue[] itemValues = new MetaValue[] { compositeValue, SimpleValueSupport.wrap(new Integer(1)) };
View Full Code Here


      TableValue expected = new TableValueSupport(tableType);
      String[] itemNames = DefaultMetaTypeFactory.MAP_ITEM_NAMES;
     
      MutableCompositeMetaType compositeType = new MutableCompositeMetaType(TestSimpleComposite.class.getName(), TestSimpleComposite.class.getName());
      compositeType.addItem("something", "something", SimpleMetaType.STRING);
      compositeType.freeze();

      String[] compositeNames = { "something" };
      CompositeValue compositeValue = new CompositeValueSupport(compositeType, compositeNames, new MetaValue[] { SimpleValueSupport.wrap("Hello") });
     
      MetaValue[] keyValues1 = {SimpleValueSupport.wrap("Hello")};
View Full Code Here

{
   public MetaType buildMetaType()
   {
      MutableCompositeMetaType result = new MutableCompositeMetaType(TestOverrideComposite.class.getName(), TestOverrideComposite.class.getName());
      result.addItem("somethingElse", "somethingElse", SimpleMetaType.STRING);
      result.freeze();
      return result;
   }

   public MetaValue buildMetaValue(MetaType metaType, TestOverrideComposite object)
   {
View Full Code Here

    */
   public void testSimpleAnnotation() throws Exception
   {
      MutableCompositeMetaType compositeType = new MutableCompositeMetaType(TestAnnotation.class.getName(), TestAnnotation.class.getName());
      compositeType.addItem("something", "something", SimpleMetaType.STRING);
      compositeType.freeze();

      String[] compositeNames = { "something" };
      CompositeValue expected = new CompositeValueSupport(compositeType, compositeNames, new MetaValue[] { SimpleValueSupport.wrap("Hello") });
     
      TestAnnotation annotation = getClass().getAnnotation(TestAnnotation.class);
View Full Code Here

    */
   public void testSimpleComposite() throws Exception
   {
      MutableCompositeMetaType compositeType = new MutableCompositeMetaType(TestSimpleComposite.class.getName(), TestSimpleComposite.class.getName());
      compositeType.addItem("something", "something", SimpleMetaType.STRING);
      compositeType.freeze();

      String[] compositeNames = { "something" };
      CompositeValue expected = new CompositeValueSupport(compositeType, compositeNames, new MetaValue[] { SimpleValueSupport.wrap("Hello") });
     
      MetaValue result = createMetaValue(new TestSimpleComposite("Hello"));
View Full Code Here

      MutableCompositeMetaType compositeType = new MutableCompositeMetaType(TestRecursiveComposite.class.getName(), TestRecursiveComposite.class.getName());
      compositeType.addItem("id", "id", SimpleMetaType.STRING);
      compositeType.addItem("other", "other", compositeType);
      Set<String> keys = Collections.singleton("id");
      compositeType.setKeys(keys);
      compositeType.freeze();

      CompositeValueSupport expected = new CompositeValueSupport(compositeType);
      expected.set("id", SimpleValueSupport.wrap("Hello"));
      expected.set("other", expected);
     
View Full Code Here

   {
      MutableCompositeMetaType compositeType = new MutableCompositeMetaType(TestIgnoredCompositeItem.class.getName(), TestIgnoredCompositeItem.class.getName());
      compositeType.addItem("id", "id", SimpleMetaType.STRING);
      Set<String> keys = Collections.singleton("id");
      compositeType.setKeys(keys);
      compositeType.freeze();

      CompositeValueSupport expected = new CompositeValueSupport(compositeType);
      expected.set("id", SimpleValueSupport.wrap("Hello"));
     
      TestIgnoredCompositeItem object = new TestIgnoredCompositeItem();
View Full Code Here

      MutableCompositeMetaType compositeType = new MutableCompositeMetaType(TestRenamedCompositeItem.class.getName(), TestRenamedCompositeItem.class.getName());
      compositeType.addItem("id", "id", SimpleMetaType.STRING);
      compositeType.addItem("renamed", "renamed", SimpleMetaType.STRING);
      Set<String> keys = Collections.singleton("id");
      compositeType.setKeys(keys);
      compositeType.freeze();

      CompositeValueSupport expected = new CompositeValueSupport(compositeType);
      expected.set("id", SimpleValueSupport.wrap("Hello"));
      expected.set("renamed", SimpleValueSupport.wrap("Renamed"));
     
View Full Code Here

{
   public MetaType buildMetaType()
   {
      MutableCompositeMetaType result = new MutableCompositeMetaType(TestOverrideComposite.class.getName(), TestOverrideComposite.class.getName());
      result.addItem("somethingElse", "somethingElse", SimpleMetaType.STRING);
      result.freeze();
      return result;
   }
}
View Full Code Here

      MetaType result = resolve(TestSimpleComposite.class);
      CompositeMetaType actual = assertInstanceOf(result, CompositeMetaType.class);
     
      MutableCompositeMetaType expected = new MutableCompositeMetaType(TestSimpleComposite.class.getName(), TestSimpleComposite.class.getName());
      expected.addItem("something", "something", SimpleMetaType.STRING);
      expected.freeze();
     
      testComposite(expected, actual);
   }

   /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.