Examples of MappingFileReader


Examples of org.apache.uima.lucas.indexer.mapping.MappingFileReader

  private void createFieldDescriptions()
      throws ResourceInitializationException {
    String mappingFilePath = (String) getContext().getConfigParameterValue(PARAM_MAPPINGFILE);

    try {
      MappingFileReader indexMappingFileReader = createMappingFileReader();
      File mappingFile = new File(mappingFilePath);
      fieldDescriptions = indexMappingFileReader
          .readFieldDescriptionsFromFile(mappingFile);
    } catch (IOException e) {
      throw new ResourceInitializationException(e);
    } catch (ParserConfigurationException e) {
                  throw new ResourceInitializationException(e);
View Full Code Here

Examples of org.apache.uima.lucas.indexer.mapping.MappingFileReader

      Map<String, ElementMapper<?>> elementMappers = new HashMap<String, ElementMapper<?>>();
      elementMappers.put(MappingFileReader.ANNOTATION, new AnnotationMapper());
      elementMappers.put(MappingFileReader.FILTER, new FilterMapper());
      elementMappers.put(MappingFileReader.FIELD, new FieldMapper());
      elementMappers.put(MappingFileReader.FEATURE, new FeatureMapper());     
      return new MappingFileReader(parser, elementMappers);
  }
View Full Code Here

Examples of org.dozer.loader.xml.MappingFileReader

    assertTrue(MappingUtils.isBlankOrNull(" "));
  }

  @Test
  public void testOverridenFields() throws Exception {
    MappingFileReader fileReader = new MappingFileReader(XMLParserFactory.getInstance());
    MappingFileData mappingFileData = fileReader.read("overridemapping.xml");
    MappingsParser mappingsParser = MappingsParser.getInstance();
    mappingsParser.processMappings(mappingFileData.getClassMaps(), mappingFileData.getConfiguration());
    // validate class mappings
    for (ClassMap classMap : mappingFileData.getClassMaps()) {
      if (classMap.getSrcClassToMap().getName().equals("org.dozer.util.mapping.vo.FurtherTestObject")) {
View Full Code Here

Examples of org.dozer.loader.xml.MappingFileReader

    parser = MappingsParser.getInstance();
  }

  @Test(expected=IllegalArgumentException.class)
  public void testDuplicateMapIds() throws Exception {
    MappingFileReader fileReader = new MappingFileReader(XMLParserFactory.getInstance());
    MappingFileData mappingFileData = fileReader.read("duplicateMapIdsMapping.xml");

    parser.processMappings(mappingFileData.getClassMaps(), new Configuration());
    fail("should have thrown exception");
  }
View Full Code Here

Examples of org.dozer.loader.xml.MappingFileReader

    fail("should have thrown exception");
  }

  @Test(expected=IllegalArgumentException.class)
  public void testDetectDuplicateMapping() throws Exception {
    MappingFileReader fileReader = new MappingFileReader(XMLParserFactory.getInstance());
    MappingFileData mappingFileData = fileReader.read("duplicateMapping.xml");
    parser.processMappings(mappingFileData.getClassMaps(), new Configuration());
    fail("should have thrown exception");
  }
View Full Code Here

Examples of org.dozer.loader.xml.MappingFileReader

    private List<ClassMap> loadMappings(CamelContext camelContext, DozerBeanMapper mapper) {
        List<ClassMap> answer = new ArrayList<ClassMap>();

        // load the class map using the class resolver so we can load from classpath in OSGi
        MappingFileReader reader = new MappingFileReader(XMLParserFactory.getInstance());
        List<String> mappingFiles = mapper.getMappingFiles();
        if (mappingFiles == null) {
            return Collections.emptyList();
        }

        for (String name : mappingFiles) {
            URL url = camelContext.getClassResolver().loadResourceAsURL(name);
            MappingFileData data = reader.read(url);
            answer.addAll(data.getClassMaps());
        }

        return answer;
    }
View Full Code Here

Examples of org.dozer.loader.xml.MappingFileReader

    private List<ClassMap> loadMappings(CamelContext camelContext, DozerBeanMapper mapper) {
        List<ClassMap> answer = new ArrayList<ClassMap>();

        // load the class map using the class resolver so we can load from classpath in OSGi
        MappingFileReader reader = new MappingFileReader(XMLParserFactory.getInstance());
        List<String> mappingFiles = mapper.getMappingFiles();
        if (mappingFiles == null) {
            return Collections.emptyList();
        }

        for (String name : mappingFiles) {
            URL url = camelContext.getClassResolver().loadResourceAsURL(name);
            MappingFileData data = reader.read(url);
            answer.addAll(data.getClassMaps());
        }

        return answer;
    }
View Full Code Here

Examples of org.dozer.loader.xml.MappingFileReader

    private List<ClassMap> loadMappings(CamelContext camelContext, DozerBeanMapper mapper) {
        List<ClassMap> answer = new ArrayList<ClassMap>();

        // load the class map using the class resolver so we can load from classpath in OSGi
        MappingFileReader reader = new MappingFileReader(XMLParserFactory.getInstance());
        List<String> mappingFiles = mapper.getMappingFiles();
        if (mappingFiles == null) {
            return Collections.emptyList();
        }

        for (String name : mappingFiles) {
            URL url = camelContext.getClassResolver().loadResourceAsURL(name);
            MappingFileData data = reader.read(url);
            answer.addAll(data.getClassMaps());
        }

        return answer;
    }
View Full Code Here

Examples of org.dozer.loader.xml.MappingFileReader

    private List<ClassMap> loadMappings(CamelContext camelContext, String mapperId, DozerBeanMapper mapper) {
        List<ClassMap> answer = new ArrayList<ClassMap>();

        // load the class map using the class resolver so we can load from classpath in OSGi
        MappingFileReader reader = new MappingFileReader(XMLParserFactory.getInstance());
        List<String> mappingFiles = mapper.getMappingFiles();
        if (mappingFiles == null) {
            return Collections.emptyList();
        }

        for (String name : mappingFiles) {
            URL url = loadMappingFile(camelContext.getClassResolver(), name);
            if (url != null) {
                MappingFileData data = reader.read(url);
                answer.addAll(data.getClassMaps());
            }
        }

        return answer;
View Full Code Here

Examples of org.dozer.loader.xml.MappingFileReader

    private List<ClassMap> loadMappings(CamelContext camelContext, String mapperId, DozerBeanMapper mapper) {
        List<ClassMap> answer = new ArrayList<ClassMap>();

        // load the class map using the class resolver so we can load from classpath in OSGi
        MappingFileReader reader = new MappingFileReader(XMLParserFactory.getInstance());
        List<String> mappingFiles = mapper.getMappingFiles();
        if (mappingFiles == null) {
            return Collections.emptyList();
        }

        for (String name : mappingFiles) {
            URL url = loadMappingFile(camelContext.getClassResolver(), name);
            if (url != null) {
                MappingFileData data = reader.read(url);
                answer.addAll(data.getClassMaps());
            }
        }

        return answer;
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.