lib/editors/editor_detector.js
function detect(root) {
  if (!root) {
    throw new BuildException(
      exceptions.NullPointer, 'The root element can not be null.');
  }
  if (root.eAnnotations && root.eAnnotations[0].$.source === 'Objing') {
    winston.info('Parser detected: MODELIO.\n');
    return modelio;
  } else if (root.eAnnotations
    && root.eAnnotations[0].$.source === 'genmymodel') {
    winston.info('Parser detected: GENMYMODEL.\n');
    return genmymodel;
  }

  if (UndetectedEditors.length === 0) {
    // this should not be happening
    throw new BuildException(exceptions.UndetectedEditor,
      'Your editor has not been detected, and this should not be happening.'
      + '\nPlease report this issue by mentioning what your editor is.');
  }
  return askForEditor();
}
function detect(root) {
  if (!root) {
    throw new BuildException(
      exceptions.NullPointer, 'The root element can not be null.');
  }
  if (root.eAnnotations && root.eAnnotations[0].$.source === 'Objing') {
    winston.info('Parser detected: MODELIO.\n');
    return modelio;
  } else if (root.eAnnotations
    && root.eAnnotations[0].$.source === 'genmymodel') {
    winston.info('Parser detected: GENMYMODEL.\n');
    return genmymodel;
  }

  if (UndetectedEditors.length === 0) {
    // this should not be happening
    throw new BuildException(exceptions.UndetectedEditor,
      'Your editor has not been detected, and this should not be happening.'
      + '\nPlease report this issue by mentioning what your editor is.');
  }
  return askForEditor();
}
function detect ( root ) { if ( ! root ) { throw new BuildException ( exceptions . NullPointer , 'The root element can not be null.' ) ; } if ( root . eAnnotations && root . eAnnotations [ 0 ] . $ . source === 'Objing' ) { winston . info ( 'Parser detected: MODELIO.\n' ) ; return modelio ; } else if ( root . eAnnotations && root . eAnnotations [ 0 ] . $ . source === 'genmymodel' ) { winston . info ( 'Parser detected: GENMYMODEL.\n' ) ; return genmymodel ; } if ( UndetectedEditors . length === 0 ) { // this should not be happening throw new BuildException ( exceptions . UndetectedEditor , 'Your editor has not been detected, and this should not be happening.' + '\nPlease report this issue by mentioning what your editor is.' ) ; } return askForEditor ( ) ; }
Detects the editor that made the document represented by its passed root.
@param root {Object} the document's root.
@return {string} the editor's name.
Detects the editor that made the document represented by its passed root .