Examples of Mapper


Examples of org.apache.stratum.xo.Mapper

    public void testPersonMapping()
    {
        try
        {
            Mapper m = new Mapper();
            m.setDebug(true);
            Container c = (Container) m.map(new File(TEST_DOCUMENT), TEST_CLASS);
           
            assertEquals("item1",c.getItem(0).getName());
            assertEquals("item2",c.getItem(1).getName());
        }           
        catch (Exception e)
View Full Code Here

Examples of org.apache.tomcat.util.http.mapper.Mapper

      }
   }
  
   public void registerOnDemandContext(String serviceName, String hostName, String contextName)
   {
      Mapper mapper = mappers.get(serviceName);
      if (mapper != null)
      {
         // ensure the path starts w/ slash or Mapper won't match it correctly
         if (contextName.length() > 0 && ('/' != contextName.charAt(0)))
         {
            contextName = "/" + contextName;
         }
         mapper.addOnDemandContext(hostName, contextName);
      }
      else
      {
         log.warn("Cannot register on-demand context for unknown engine " + serviceName);
      }
View Full Code Here

Examples of org.apache.tomcat.util.http.mapper.Mapper

      }
   }
  
   public void removeOnDemandContext(String serviceName, String hostName, String contextName)
   {
      Mapper mapper = mappers.get(serviceName);
      if (mapper != null)
      {
         mapper.removeContext(hostName, contextName);
      }
      else
      {
         log.warn("Cannot remove on-demand context for unknown engine " + serviceName);
      }
View Full Code Here

Examples of org.apache.tools.ant.types.Mapper

  public Mapper createMapper() throws BuildException
  {
    if (mapper!=null)
      throw new BuildException("Cannot define more than one mapper", location);

    mapper = new Mapper(project);
    return mapper;
  }
View Full Code Here

Examples of org.apache.turbine.services.template.mapper.Mapper

            String mapperClass =
                    conf.getString(mapperProperty.toString(), mapperClasses[i]);

            log.info("Using " + mapperClass + " to map " + mapperNames[i] + " elements");

            Mapper tm = null;

            try
            {
                tm = (Mapper) TurbineFactory.getInstance(mapperClass);
            }
            catch (TurbineException te)
            {
                throw new InitializationException("", te);
            }

            tm.setUseCache(useCache);
            tm.setCacheSize(mapperCacheSize[i]);
            tm.setDefaultProperty(mapperDefaultProperty[i]);
            tm.setSeparator(mapperSeparator[i]);

            if ((mapperLoader[i] != null) && (tm instanceof ClassMapper))
            {
                ((ClassMapper) tm).setLoader(mapperLoader[i]);
            }
View Full Code Here

Examples of org.docx4j.fonts.Mapper

      System.out.println("Loading file from " + inputfilepath);
      wordMLPackage = WordprocessingMLPackage.load(new java.io.File(inputfilepath));
    }
   
    // Set up font mapper (optional)
    Mapper fontMapper = new IdentityPlusMapper();
    wordMLPackage.setFontMapper(fontMapper);
   
    // .. example of mapping font Times New Roman which doesn't have certain Arabic glyphs
    // eg Glyph "ي" (0x64a, afii57450) not available in font "TimesNewRomanPS-ItalicMT".
    // eg Glyph "ج" (0x62c, afii57420) not available in font "TimesNewRomanPS-ItalicMT".
    // to a font which does
    PhysicalFont font
        = PhysicalFonts.get("Arial Unicode MS");
      // make sure this is in your regex (if any)!!!
    if (font!=null) {
      fontMapper.put("Times New Roman", font);
      fontMapper.put("Arial", font);
    }
    fontMapper.put("Libian SC Regular", PhysicalFonts.get("SimSun"));

    // FO exporter setup (required)
    // .. the FOSettings object
      FOSettings foSettings = Docx4J.createFOSettings();
    if (saveFO) {
View Full Code Here

Examples of org.dozer.Mapper

    // assert 2 users in collection
    assertEquals("Two users in source usergroup expected.", 2, userGroup.getUsers().size());

    // get mapper
    Mapper mapper = getMapper(new String[] { "mapping-interface.xml" });

    // do mapping
    UserGroupPrime userGroupPrime = mapper.map(userGroup, UserGroupPrime.class);

    // check mapped group
    assertNotNull(userGroupPrime);
    assertEquals(userGroup.getName(), userGroupPrime.getName());
View Full Code Here

Examples of org.dozer.Mapper

    // assert 2 users in collection
    assertEquals("Two users in source usergroup expected.", 2, userGroup.getUsers().size());

    // get mapper
    Mapper mapper = getMapper(new String[] { "mapping-concrete.xml" });

    // do mapping
    UserGroupPrime userGroupPrime = mapper.map(userGroup, UserGroupPrime.class);

    // check mapped group
    assertNotNull(userGroupPrime);
    assertEquals(userGroup.getName(), userGroupPrime.getName());
View Full Code Here

Examples of org.dozer.Mapper

  public void testRecursiveSelfMapping_Iterate() {
    testMapping(c1, "selfreference_recursive_iterate.xml");
  }

  private void testMapping(ContainerBean c1, String mappingFile) {
    Mapper mapper = getMapper(mappingFile);

    try {
      ContainerBean2 c2 = mapper.map(c1, ContainerBean2.class);
      SelfReferencingBean mb1 = c2.getBeans().get(0);
      SelfReferencingBean mb2 = c2.getBeans().get(1);
      assertEquals(mb1.getId().longValue(), 1L);
      assertEquals(mb2.getId().longValue(), 2L);
      assertEquals(mb1.getOneToOne(), mb2);
View Full Code Here

Examples of org.dozer.Mapper

   * test mapping of a generic field
   */
  @Test
  public void testSimpleGenerics() {

    Mapper mapper = new DozerBeanMapper();

    A a = new A();
    a.setId(15L);

    B b = mapper.map(a, B.class);
    Assert.assertEquals((Integer) a.getId().intValue(), b.getId());

    A a2 = mapper.map(a, A.class);
    Assert.assertEquals(a.getId(), a2.getId());

  }
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.