Package org.apache.stanbol.entityhub.servicesapi.mapping

Examples of org.apache.stanbol.entityhub.servicesapi.mapping.FieldMapping

Note that a Filter with the pattern '*' no constraint and only an null value as mapping would create a 1:1 copy of the source. TODO: Is it OK to keep an actual implementation in the Service API package? @author Rupert Westenthaler

                 *   be always the last.
                 *   So we need to parse backwards because than more prominent
                 *   things will overwrite and win!
                 */
                for(int i=activeMappings.size()-1;i>=0;i--){
                    FieldMapping mapping = activeMappings.get(i);
                    if(mapping.usesWildcard() //if wildcard
                            && !mapping.ignoreField() && //and not ignore
                            mapping.getFilter() != null && //and a filter is present
                            mapping.getFilter().getType() == ConstraintType.text){ //and of type text
                        //set the global text filter.
                        //NOTE: the active mappings are sorted in that way, that
                        //      the most specific one is set last
                        globalFilter = (TextConstraint)mapping.getFilter();
                    }
                    for(String targetField : mapping.getMappings()){
                        if(mapping.ignoreField()){
                            targetFields.remove(targetField);
                        } else {
                            targetFields.add(targetField);
                        }
                    }
                }
//                log.info("    o targets: "+targetFields);
//                log.info("    o global text filter: "+globalFilter);
                if(globalFilter != null){
                    globalFiltered = new HashSet<Object>(values);
                    //parse false ass third argument, because we need not to filter
                    //non-Text values for wildcard filter!
                    processFilter(globalFilter, globalFiltered,false);
                }
                //now process the mappings
                for(FieldMapping mapping : activeMappings){
                    if(!mapping.ignoreField() &&
                            !Collections.disjoint(targetFields, mapping.getMappings())){
                        processMapping(mapping, valueFactory, field,  values,globalFiltered, targetFields, target);
//                    } else if(!mapping.ignoreField()) {
//                        log.info(String.format("  << ignore mapping %s ",mapping));
//                    } else {
//                        log.info(String.format("  << %s ",mapping));
View Full Code Here

TOP

Related Classes of org.apache.stanbol.entityhub.servicesapi.mapping.FieldMapping

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.