Package org.dozer.util

Examples of org.dozer.util.ResourceLoader


  private MappingsSource parser;

  @Test
  public void testParse() throws Exception {
    ResourceLoader loader = new ResourceLoader();
    URL url = loader.getResource("dozerBeanMapping.xml");

    Document document = XMLParserFactory.getInstance().createParser().parse(url.openStream());
    parser = new XMLParser(document);

    MappingFileData mappings = parser.load();
View Full Code Here


   * This tests checks that the customconverterparam reaches the
   * fieldmapping.     
   */
  @Test
  public void testParseCustomConverterParam() throws Exception {
    ResourceLoader loader = new ResourceLoader();
    URL url = loader.getResource("fieldCustomConverterParam.xml");

    Document document = XMLParserFactory.getInstance().createParser().parse(url.openStream());
    parser = new XMLParser(document);
   
    MappingFileData mappings = parser.load();
View Full Code Here

      propFileName = DozerConstants.DEFAULT_CONFIG_FILE;
    }

    InitLogger.log(log, "Trying to find Dozer configuration file: " + propFileName);
    // Load prop file. Prop file is optional, so if it's not found just use defaults
    ResourceLoader loader = new ResourceLoader();
    URL url = loader.getResource(propFileName);
    if (url == null) {
      InitLogger.log(log, "Dozer configuration file not found: " + propFileName
          + ".  Using defaults for all Dozer global properties.");
      return;
    } else {
View Full Code Here

    log.debug("Trying to resolve XML entity with public ID [" + publicId + "] and system ID [" + systemId + "]");
    if (systemId != null && systemId.indexOf(DozerConstants.XSD_NAME) > systemId.lastIndexOf("/")) {
      String fileName = systemId.substring(systemId.indexOf(DozerConstants.XSD_NAME));
      log.debug("Trying to locate [" + fileName + "] in classpath");
      try {
        ResourceLoader resourceLoader = new ResourceLoader();
        InputStream stream = resourceLoader.getResource(fileName).openStream();
        InputSource source = new InputSource(stream);
        source.setPublicId(publicId);
        source.setSystemId(systemId);
        log.debug("Found beanmapping XML Schema [" + systemId + "] in classpath");
        return source;
View Full Code Here

  public MappingFileReader(XMLParserFactory parserFactory) {
    documentBuilder = parserFactory.createParser();
  }

  public MappingFileData read(String fileName) {
    ResourceLoader loader = new ResourceLoader();
    URL url = loader.getResource(fileName);
    return read(url);
  }
View Full Code Here

  MappingsSource<Document> parser;
  ResourceLoader loader;

  @Before
  public void setUp() {
    loader = new ResourceLoader(getClass().getClassLoader());
  }
View Full Code Here

TOP

Related Classes of org.dozer.util.ResourceLoader

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.