Examples of Mapper


Examples of org.dozer.Mapper

    SomeVo request = newInstance(SomeVo.class);
    request.setUserName("yo");
    request.setAge("2");
    request.setColor("blue");

    Mapper mapper = getMapper(new String[] { "kmmapping.xml" });

    Super afterMapping = mapper.map(request, Super.class);

    assertNotNull("login name should not be null", afterMapping.getLoginName());
    assertNotNull("age should not be null", afterMapping.getAge());
    assertEquals("should map SuperClass.name to SubClassPrime userName.", request.getUserName(), afterMapping.getLoginName());
    assertEquals(request.getAge(), afterMapping.getAge());
View Full Code Here

Examples of org.dozer.Mapper

    nestedProperty.setTestProperty("boo");
    property.setTestProperty("testProperty");
    property.setMapMe(nestedProperty);
    request.setProperty(property);

    Mapper mapper = getMapper(new String[] { "kmmapping.xml" });

    SomeVo afterMapping = mapper.map(request, SomeVo.class);

    assertNotNull("un should not be null", afterMapping.getUserName());
    assertNotNull("color should not be null", afterMapping.getColor());
    assertNotNull("age should not be null", afterMapping.getAge());
    assertEquals("should map SuperClass.name to SubClassPrime userName.", request.getLoginName(), afterMapping.getUserName());
View Full Code Here

Examples of org.elasticsearch.index.mapper.Mapper

                    }
                }

                // merge all the other mappers
                for (Mapper mergeWithMapper : mergeWithMultiField.mappers.values()) {
                    Mapper mergeIntoMapper = mappers.get(mergeWithMapper.name());
                    if (mergeIntoMapper == null) {
                        // no mapping, simply add it if not simulating
                        if (!mergeContext.mergeFlags().simulate()) {
                            // disable the mapper from being in all, only the default mapper is in all
                            if (mergeWithMapper instanceof AllFieldMapper.IncludeInAll) {
                                ((AllFieldMapper.IncludeInAll) mergeWithMapper).includeInAll(false);
                            }
                            mappers = newMapBuilder(mappers).put(mergeWithMapper.name(), mergeWithMapper).immutableMap();
                            if (mergeWithMapper instanceof AbstractFieldMapper) {
                                mappersToAddToDocMapper.add((FieldMapper) mergeWithMapper);
                            }
                        }
                    } else {
                        mergeIntoMapper.merge(mergeWithMapper, mergeContext);
                    }
                }
            }
        }
        // call it outside of the mutex
View Full Code Here

Examples of org.exoplatform.portal.pom.data.Mapper

        POMSession session = pomMgr.getSession();
        WorkspaceObject workspaceObject = session.findObjectById(applicationStorageId);

        if (workspaceObject instanceof UIWindow) {
            UIWindow application = (UIWindow) workspaceObject;
            Mapper mapper = new Mapper(session);

            ApplicationData data = mapper.load(application);
            return data;
        }
        throw new NoSuchDataException("Could not load the application data specified by the ID: " + applicationStorageId);
    }
View Full Code Here

Examples of org.gatein.web.redirect.Mapper

    DataStorage dataStorage;

    public SiteRedirectServiceImpl(DataStorage dataStorage, NavigationService navService) throws IOException {
        this.dataStorage = dataStorage;
        this.redirector = new Redirector();
        this.mapper = new Mapper(navService);
    }
View Full Code Here

Examples of org.glassfish.grizzly.http.server.util.Mapper

        for (Connector connector : connectors) {
            PECoyoteConnector conn = (PECoyoteConnector) connector;
            String name = conn.getName();
            for (String listenerName : listenerNames) {
                if (name.equals(listenerName)) {
                    Mapper mapper = conn.getMapper();
                    try {
                        mapper.setDefaultContextPath(virtualServer.getName(),
                                defaultContextPath);
                        for (String alias : virtualServer.findAliases()) {
                            mapper.setDefaultContextPath(alias,
                                    defaultContextPath);
                        }
                        virtualServer.setDefaultContextPath(defaultContextPath);
                    } catch (Exception e) {
                        throw new LifecycleException(e);
View Full Code Here

Examples of org.jongo.Mapper

    @Test
    //https://github.com/bguerout/jongo/issues/226
    public void canSetAFieldToNullDuringAnUpdate() throws Exception {

        Mapper mapper = new JacksonMapper.Builder().addModifier(new MapperModifier() {
            public void modify(ObjectMapper mapper) {
                mapper.setSerializationInclusion(JsonInclude.Include.ALWAYS);
            }
        }).build();
        Jongo jongo = new Jongo(getDatabase(), mapper);
        MongoCollection friends = jongo.getCollection("friends");
        Friend friend = new Friend("Peter", "31 rue des Lilas");
View Full Code Here

Examples of org.jzy3d.plot3d.builder.Mapper

        initChart();
    }

    public void initChart(){
        // Define a function to plot
        Mapper mapper = new Mapper(){
            public double f(double x, double y) {
                double sigma = 10;
                return Math.exp( -(x*x+y*y) / sigma  *  Math.abs( Math.cos( 2 * Math.PI * ( x*x + y*y ) ) );
            }
        };
View Full Code Here

Examples of org.mapstruct.ap.model.Mapper

        List<MapperReference> mapperReferences = mappingContext.getMapperReferences();
        List<MappingMethod> mappingMethods = getMappingMethods( methods );
        mappingMethods.addAll( mappingContext.getUsedVirtualMappings() );
        mappingMethods.addAll( mappingContext.getMappingsToGenerate() );

        Mapper mapper = new Mapper.Builder()
            .element( element )
            .mappingMethods( mappingMethods )
            .mapperReferences( mapperReferences )
            .suppressGeneratorTimestamp( options.isSuppressGeneratorTimestamp() )
            .decorator( getDecorator( element, methods ) )
View Full Code Here

Examples of org.mongodb.morphia.mapping.Mapper

    public JenkinsRule j = new JenkinsRule();

    @Before
    public void setupFongo() throws Exception {
        Morphia morphia = new Morphia();
        Mapper mapper = morphia.getMapper();
        mapper.getConverters().addConverter(new CopyOnWriteListConverter());
        mapper.getConverters().addConverter(new DescribableListConverter());
        mapper.getConverters().addConverter(new ParametersDefinitionPropertyCoverter());
        mapper.getConverters().addConverter(new CombinationConverter());
        mapper.getConverters().addConverter(new AxisListConverter());
        mapper.getConverters().addConverter(new ResultConverter());
        mapper.getOptions().setActLikeSerializer(true);
        mapper.getOptions().objectFactory = new CustomMorphiaObjectFactory(MongoRepository.class.getClassLoader());

        Datastore datastore = morphia.createDatastore(new Fongo(SetupConfig.get().getDbName()).getMongo(), SetupConfig.get().getDbName());

        Whitebox.setInternalState(MongoRepository.class, "datastore", datastore);
    }
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.