Ejemplo n.º 1
0
 /**
  * Create a NodeFileParser given the project and the source file, using the predetermined format
  *
  * @param file the nodes resource file
  * @param format the file format
  * @return a new parser based on the determined format
  * @throws ResourceModelSourceException if the format is not supported
  */
 protected ResourceFormatParser createParser(final File file, final String format)
     throws ResourceModelSourceException {
   try {
     if (null != format) {
       return framework.getResourceFormatParserService().getParserForFormat(format);
     } else {
       return framework.getResourceFormatParserService().getParserForFileExtension(file);
     }
   } catch (UnsupportedFormatException e) {
     throw new ResourceModelSourceException(e);
   }
 }