Package org.jboss.metatype.plugins.types

Examples of org.jboss.metatype.plugins.types.MutableCompositeMetaType


{
   CompositeMetaType type;

   public ObjectNameMetaMapper()
   {
      type = new MutableCompositeMetaType(ObjectName.class.getName(), "JMX ObjectName");
   }
View Full Code Here


   {
      type = new MutableCompositeMetaType(ObjectName.class.getName(), "JMX ObjectName");
   }
   public ObjectNameMetaMapper(String... args)
   {
      MutableCompositeMetaType mcmt = new MutableCompositeMetaType(ObjectName.class.getName(), "JMX ObjectName");
      if(((args.length %2) == 0) == false)
         throw new IllegalStateException("args counts must be 2*n for n key,key-description pairs");
      mcmt.addItem("domain", "the object name domain", SimpleMetaType.STRING);
      for(int n = 0; n < args.length; n += 2)
      {
         String key = args[n];
         String description = args[n+1];
         mcmt.addItem(key, description, SimpleMetaType.STRING);
      }
      mcmt.freeze();
      type = mcmt;
   }
View Full Code Here

      TestGeneric test = new TestGeneric("Hello");
      TestGenericComposite composite = new TestGenericComposite();
      composite.setGeneric(test);
      GenericMetaType generic = new GenericMetaType(TestGeneric.class.getName(), TestGeneric.class.getName());
      GenericValue genericValue = new GenericValueSupport(generic, test);
      MutableCompositeMetaType compositeType = new MutableCompositeMetaType(TestGenericComposite.class.getName(), TestGenericComposite.class.getName());
      compositeType.addItem("generic", "generic", generic);
      compositeType.freeze();
      CompositeValueSupport expected = new CompositeValueSupport(compositeType);
      expected.set("generic", genericValue);
     
      MetaValue result = createMetaValue(composite);
      CompositeValue actual = assertInstanceOf(result, CompositeValue.class);
View Full Code Here

    */
   public void testGenericComposite() throws Exception
   {
      MetaType actual = resolve(TestGenericComposite.class);
      printComposite("GenericComposite MetaType: ", assertInstanceOf(actual, CompositeMetaType.class));
      MutableCompositeMetaType expected = new MutableCompositeMetaType(TestGenericComposite.class.getName(), TestGenericComposite.class.getName());
      GenericMetaType generic = new GenericMetaType(TestGeneric.class.getName(), TestGeneric.class.getName());
      expected.addItem("generic", "generic", generic);
      expected.freeze();
      assertEquals(expected, actual);
   }
View Full Code Here

TOP

Related Classes of org.jboss.metatype.plugins.types.MutableCompositeMetaType

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.