Examples of MultiMap


Examples of org.apache.commons.collections.MultiMap

      TableIdentifier tableIdentifier = TableIdentifier.create(table);
      if(table.getColumn(column)!=null) {
        throw new MappingException("Column " + column.getName() + " already exists in table " + tableIdentifier );
      }
     
      MultiMap map = MetaAttributeBinder.loadAndMergeMetaMap( element, new MultiHashMap());
      if(map!=null && !map.isEmpty()) {
        repository.addMetaAttributeInfo( tableIdentifier, column.getName(), map);
      }
     
      table.addColumn(column);
      columnNames.add(column.getName());
View Full Code Here

Examples of org.apache.commons.collections.MultiMap

      filter.setMatchSchema(element.attributeValue("match-schema") );
      filter.setMatchName(element.attributeValue("match-name") );
      filter.setExclude(Boolean.valueOf(element.attributeValue("exclude") ) );
      filter.setPackage(element.attributeValue("package") );
     
      MultiMap map = MetaAttributeBinder.loadAndMergeMetaMap( element, new MultiHashMap());
      if(map!=null && !map.isEmpty()) {
        filter.setMetaAttributes( map );
      } else {
        filter.setMetaAttributes( null );       
      }
      respository.addTableFilter(filter);
View Full Code Here

Examples of org.apache.commons.collections.MultiMap

   *
   * @param element
   * @return MultiMap
   */
   protected static MultiMap loadMetaMap(Element element) {
    MultiMap result = new MultiHashMap();
    List metaAttributeList = new ArrayList();
    metaAttributeList.addAll(element.elements("meta") );

    for (Iterator iter = metaAttributeList.iterator(); iter.hasNext();) {
      Element metaAttrib = (Element) iter.next();
      // does not use getTextNormalize() or getTextTrim() as that would remove the formatting in new lines in items like description for javadocs.
      String attribute = metaAttrib.attributeValue("attribute");
      String value = metaAttrib.getText();
      String inheritStr= metaAttrib.attributeValue("inherit");
      boolean inherit = true;
      if(inheritStr!=null) {
        inherit = Boolean.valueOf(inheritStr).booleanValue();
      }     
     
      MetaAttributeBinder.SimpleMetaAttribute ma = new MetaAttributeBinder.SimpleMetaAttribute(value, inherit);
      result.put(attribute, ma);
    }
    return result;

  }
View Full Code Here

Examples of org.apache.commons.collections.MultiMap

        assertEquals(true, map.containsValue("A", "AA"));
        assertEquals(false, map.containsValue("A", "AB"));
    }

    public void testPutAll_Map1() {
        MultiMap original = new MultiValueMap();
        original.put("key", "object1");
        original.put("key", "object2");

        MultiValueMap test = new MultiValueMap();
        test.put("keyA", "objectA");
        test.put("key", "object0");
        test.putAll(original);
View Full Code Here

Examples of org.apache.commons.collections.MultiMap

{

    public void testOverridePreferred() throws Exception
    {
        DefaultAppBloodhound bh = new DefaultAppBloodhound();
        MultiMap overrides = new MultiValueMap();
        overrides.put("properties", new TestDescriptorParserDefault());

        // test with default annotation values
        bh.mergeParserOverrides(overrides);
        assertEquals(1, bh.parserRegistry.size());
        DescriptorParser result = bh.parserRegistry.get("properties");
View Full Code Here

Examples of org.apache.commons.collections.MultiMap

    }

    public void testBothPreferredWithWeight() throws Exception
    {
        DefaultAppBloodhound bh = new DefaultAppBloodhound();
        MultiMap overrides = new MultiValueMap();
        overrides.put("properties", new TestDescriptorParserDefault());
        overrides.put("properties", new TestDescriptorParserPreferred());

        // test with weigh attribute (we have 3 candidates now)
        bh.mergeParserOverrides(overrides);
        assertEquals(1, bh.parserRegistry.size());
        DescriptorParser result = bh.parserRegistry.get("properties");
View Full Code Here

Examples of org.apache.commons.collections.MultiMap

    }

    public void testOverrideWithoutPreferred() throws Exception
    {
        DefaultAppBloodhound bh = new DefaultAppBloodhound();
        MultiMap overrides = new MultiValueMap();
        overrides.put("properties", new TestDescriptorParserNoAnnotation());

        // test with weigh attribute (we have 3 candidates now)
        bh.mergeParserOverrides(overrides);
        assertEquals(1, bh.parserRegistry.size());
        DescriptorParser result = bh.parserRegistry.get("properties");
View Full Code Here

Examples of org.apache.commons.collections.MultiMap

    }

    public void testMixedOverrides() throws Exception
    {
        DefaultAppBloodhound bh = new DefaultAppBloodhound();
        MultiMap overrides = new MultiValueMap();
        overrides.put("properties", new TestDescriptorParserNoAnnotation());
        overrides.put("properties", new TestDescriptorParserDefault());

        // test with weigh attribute (we have 3 candidates now)
        bh.mergeParserOverrides(overrides);
        assertEquals(1, bh.parserRegistry.size());
        DescriptorParser result = bh.parserRegistry.get("properties");
View Full Code Here

Examples of org.apache.commons.collections.MultiMap

        // defaults first
        parserRegistry.put("properties", new PropertiesDescriptorParser());

        final Iterator<DescriptorParser> it = ServiceRegistry.lookupProviders(DescriptorParser.class);

        MultiMap overrides = new MultiValueMap();
        while (it.hasNext())
        {
            final DescriptorParser parser = it.next();
            overrides.put(parser.getSupportedFormat(), parser);
        }
        mergeParserOverrides(overrides);
    }
View Full Code Here

Examples of org.apache.commons.collections15.MultiMap

     * map.
     *
     * @return the map to be tested
     */
    public MultiMap makeFullMap() {
        MultiMap m = makeEmptyMap();
        addSampleMappings(m);
        return m;
    }
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.