Examples of AbstractMapMetaData


Examples of org.jboss.beans.metadata.plugins.AbstractMapMetaData

      AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName());
     
      ArrayList constructorParams = new ArrayList();
      AbstractParameterMetaData pmd = new AbstractParameterMetaData();
      pmd.setType("java.util.Map");
      AbstractMapMetaData collection = new AbstractMapMetaData();
      collection.setConfigurator(configurator);
      collection.setKeyType("java.lang.String");
      collection.setValueType("java.lang.String");
      collection.put(new StringValueMetaData("1"), new StringValueMetaData("2"));
      pmd.setValue(collection);
      constructorParams.add(pmd);
      AbstractConstructorMetaData cmd = new AbstractConstructorMetaData();
      bmd.setConstructor(cmd);
      cmd.setParameters(constructorParams);
View Full Code Here

Examples of org.jboss.beans.metadata.plugins.AbstractMapMetaData

      AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName());
     
      ArrayList constructorParams = new ArrayList();
      AbstractParameterMetaData pmd = new AbstractParameterMetaData();
      pmd.setType("java.util.Hashtable");
      AbstractMapMetaData collection = new AbstractMapMetaData();
      collection.setConfigurator(configurator);
      collection.setType("java.util.Properties");
      collection.setKeyType("java.lang.String");
      collection.setValueType("java.lang.String");
      collection.put(new StringValueMetaData("1"), new StringValueMetaData("2"));
      pmd.setValue(collection);
      constructorParams.add(pmd);
      AbstractConstructorMetaData cmd = new AbstractConstructorMetaData();
      bmd.setConstructor(cmd);
      cmd.setParameters(constructorParams);
View Full Code Here

Examples of org.jboss.beans.metadata.plugins.AbstractMapMetaData

    */
   public void addBeanProperty(PropertyMetaData property)
   {
      PropertyMetaData properties = getProperty("properties");

      AbstractMapMetaData map = null;
      if (properties == null)
      {
         map = new AbstractMapMetaData();
         properties = new AbstractPropertyMetaData("properties", map);
         addProperty(properties);
      }
      else
      {
         map = (AbstractMapMetaData) properties.getValue();
      }
     
      ValueMetaData valueMetaData = property.getValue();
      valueMetaData = new AbstractValueMetaData(valueMetaData);
      map.put(new AbstractValueMetaData(property.getName()), valueMetaData);
   }
View Full Code Here

Examples of org.jboss.beans.metadata.plugins.AbstractMapMetaData

      super(MapValue.class);
   }

   public ValueMetaData createValueMetaData(MapValue annotation)
   {
      AbstractMapMetaData map = new AbstractMapMetaData();
      if (isAttributePresent(annotation.clazz()))
         map.setType(annotation.clazz().getName());
      if (isAttributePresent(annotation.keyClass()))
         map.setKeyType(annotation.keyClass().getName());
      if (isAttributePresent(annotation.valueClass()))
         map.setValueType(annotation.valueClass().getName());
      for(EntryValue entry : annotation.value())
      {
         map.put(createValueMetaData(entry.key()), createValueMetaData(entry.value()));
      }
      return map;
   }
View Full Code Here

Examples of org.jboss.beans.metadata.plugins.AbstractMapMetaData

   }
  
   @SuppressWarnings("unchecked")
   public Map<ValueMetaData, ValueMetaData> createMap(String mapType, String keyType, String valueType)
   {
      AbstractMapMetaData map = new AbstractMapMetaData();
      if (mapType != null)
         map.setType(mapType);
      if (keyType != null)
         map.setKeyType(keyType);
      if (valueType != null)
         map.setValue(valueType);
      return (Map) map;
   }
View Full Code Here

Examples of org.jboss.beans.metadata.plugins.AbstractMapMetaData

      if (name == null)
         throw new IllegalArgumentException("Null name");
      PropertyMetaData properties = getProperty("properties");
      if (properties == null)
         return null;
      AbstractMapMetaData map = (AbstractMapMetaData) properties.getValue();
      for (Iterator<Map.Entry<MetaDataVisitorNode, MetaDataVisitorNode>> i = map.entrySet().iterator(); i.hasNext();)
      {
         Map.Entry<MetaDataVisitorNode, MetaDataVisitorNode> entry = i.next();
         ValueMetaData key = (ValueMetaData) entry.getKey();
         if (key.getUnderlyingValue().equals(name))
         {
View Full Code Here

Examples of org.jboss.beans.metadata.plugins.AbstractMapMetaData

    */
   public void addBeanProperty(PropertyMetaData property)
   {
      PropertyMetaData properties = getProperty("properties");

      AbstractMapMetaData map;
      if (properties == null)
      {
         map = new AbstractMapMetaData();
         properties = new AbstractPropertyMetaData("properties", map);
         addProperty(properties);
      }
      else
      {
         map = (AbstractMapMetaData) properties.getValue();
      }
     
      ValueMetaData valueMetaData = property.getValue();
      valueMetaData = new AbstractValueMetaData(valueMetaData);
      map.put(new AbstractValueMetaData(property.getName()), valueMetaData);
   }
View Full Code Here

Examples of org.jboss.beans.metadata.plugins.AbstractMapMetaData

      return (AbstractMapMetaData) value;
   }
  
   public void testMap() throws Exception
   {
      AbstractMapMetaData map = getMap();
      assertNull(map.getType());
      assertNull(map.getKeyType());
      assertNull(map.getValueType());
   }
View Full Code Here

Examples of org.jboss.beans.metadata.plugins.AbstractMapMetaData

      assertNull(map.getValueType());
   }
  
   public void testMapWithClass() throws Exception
   {
      AbstractMapMetaData map = getMap();
      assertEquals("MapClass", map.getType());
      assertNull(map.getKeyType());
      assertNull(map.getValueType());
   }
View Full Code Here

Examples of org.jboss.beans.metadata.plugins.AbstractMapMetaData

      assertNull(map.getValueType());
   }
  
   public void testMapWithKeyClass() throws Exception
   {
      AbstractMapMetaData map = getMap();
      assertNull(map.getType());
      assertEquals("KeyClass", map.getKeyType());
      assertNull(map.getValueType());
   }
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.