lib/maven-archetype-metadata.js
function _getModule (moduleElement) {
    var id = moduleElement.getAttribute('id');
    var dir = moduleElement.getAttribute('dir');
    var name = moduleElement.getAttribute('name');
    var fileSets = domutils.getChild(moduleElement, 'desc', 'fileSets');
    var modules = domutils.getChild(moduleElement, 'desc', 'modules');
    var module = { id: id, dir: dir, name: name, fileSets: [], modules: [] };
    if (fileSets !== undefined) {
      var fileSetElements = domutils.selectMatchingXPath('desc:fileSet', fileSets);
      var numFileSets = fileSetElements.length;
      for (var fsIdx = 0; fsIdx < numFileSets; fsIdx++) {
        module.fileSets.push(_getFileSet(fileSetElements[fsIdx]));
      }
    }
    if (modules !== undefined) {
      var moduleElements = domutils.selectMatchingXPath('desc:module', modules);
      var numModules = moduleElements.length;
      for (var mIdx = 0; mIdx < numModules; mIdx++) {
        module.modules.push(_getModule(moduleElements[mIdx]));
      }
    }
    return module;
  }
function _getModule (moduleElement) {
    var id = moduleElement.getAttribute('id');
    var dir = moduleElement.getAttribute('dir');
    var name = moduleElement.getAttribute('name');
    var fileSets = domutils.getChild(moduleElement, 'desc', 'fileSets');
    var modules = domutils.getChild(moduleElement, 'desc', 'modules');
    var module = { id: id, dir: dir, name: name, fileSets: [], modules: [] };
    if (fileSets !== undefined) {
      var fileSetElements = domutils.selectMatchingXPath('desc:fileSet', fileSets);
      var numFileSets = fileSetElements.length;
      for (var fsIdx = 0; fsIdx < numFileSets; fsIdx++) {
        module.fileSets.push(_getFileSet(fileSetElements[fsIdx]));
      }
    }
    if (modules !== undefined) {
      var moduleElements = domutils.selectMatchingXPath('desc:module', modules);
      var numModules = moduleElements.length;
      for (var mIdx = 0; mIdx < numModules; mIdx++) {
        module.modules.push(_getModule(moduleElements[mIdx]));
      }
    }
    return module;
  }
function _getModule ( moduleElement ) { var id = moduleElement . getAttribute ( 'id' ) ; var dir = moduleElement . getAttribute ( 'dir' ) ; var name = moduleElement . getAttribute ( 'name' ) ; var fileSets = domutils . getChild ( moduleElement , 'desc' , 'fileSets' ) ; var modules = domutils . getChild ( moduleElement , 'desc' , 'modules' ) ; var module = { id : id , dir : dir , name : name , fileSets : [ ] , modules : [ ] } ; if ( fileSets !== undefined ) { var fileSetElements = domutils . selectMatchingXPath ( 'desc:fileSet' , fileSets ) ; var numFileSets = fileSetElements . length ; for ( var fsIdx = 0 ; fsIdx < numFileSets ; fsIdx ++ ) { module . fileSets . push ( _getFileSet ( fileSetElements [ fsIdx ] ) ) ; } } if ( modules !== undefined ) { var moduleElements = domutils . selectMatchingXPath ( 'desc:module' , modules ) ; var numModules = moduleElements . length ; for ( var mIdx = 0 ; mIdx < numModules ; mIdx ++ ) { module . modules . push ( _getModule ( moduleElements [ mIdx ] ) ) ; } } return module ; }
Produces a JavaScript object representing a module.

@param {!Element} moduleElement
@returns {{id: (string|*), dir: (string|*), name: (string|*), fileSets: Array, modules: Array}}
@private
Produces a JavaScript object representing a module .