lib/qx/tool/compiler/ClassFile.js
function() {
      var t = this;
      var dbClassInfo = this.__dbClassInfo = {};

      // Collect the dependencies on other classes
      var deps = this.getRequiredClasses();
      for (var name in deps) {
        var dep = deps[name];
        if (!dep.ignore) {
          if (!dbClassInfo.dependsOn) {
            dbClassInfo.dependsOn = {};
          }
          dbClassInfo.dependsOn[name] = dep;
        }
      }
      
      function fixAnnos(section) {
        if (!section) {
          return;
        }
        Object.keys(section).forEach(name => {
          if (name[0] == "@") {
            var value = section[name];
            delete section[name];
            name = name.substring(1);
            var meta = section[name];
            if (meta) {
              if (!meta.annotations) {
                meta.annotations = []; 
              }
              meta.annotations.push(value);
            }
          }
        });
      }
      
      var meta = this.getOuterClassMeta();
      if (meta) {
        fixAnnos(meta.events);
        fixAnnos(meta.members);
        fixAnnos(meta.statics);
        
        if (meta.properties && meta.members) {
          Object.keys(meta.properties).forEach(name => {
            let pm = meta.properties[name];
            if (pm.apply) {
              let fm = meta.members[pm.apply];
              if (fm) {
                if (!fm.applyFor) {
                  fm.applyFor = [];
                }
                fm.applyFor.push(name);
              }
            }
          });
        }
  
        // Class heirararchy
        dbClassInfo.extends = meta.superClass;
        dbClassInfo.include = meta.mixins.slice(0);
        dbClassInfo.implement = meta.interfaces.slice(0);
      }
      
      // Environment Checks
      if (Object.keys(this.__environmentChecks.provided).length || Object.keys(this.__environmentChecks.required).length) {
        dbClassInfo.environment = { provided: [], required: {} };
        for (let key in this.__environmentChecks.provided) {
          dbClassInfo.environment.provided.push(key); 
        }
        for (let key in this.__environmentChecks.required) {
          dbClassInfo.environment.required[key] = this.__environmentChecks.required[key]; 
        }
      }

      // Save whether the class has a defer method
      dbClassInfo.hasDefer = this.hasDefer();

      // Unresolved symbols
      dbClassInfo.unresolved = [];
      for (let name in this.__scope.unresolved) {
        let item = this.__scope.unresolved[name];
        // item is undefined if it has already been removed from the list
        if (item === undefined) {
          continue;
        }
        var info = t.__analyser.getSymbolType(name);
        if (info && info.className) {
          t._requireClass(info.className, { load: item.load, defer: item.defer }); 
        } else if (info && info.symbolType == "package") {
          t.deleteReference(name);
        } else {
          dbClassInfo.unresolved.push(item);
          for (var j = 0; j < item.locations.length; j++) {
            t.addMarker("symbol.unresolved", item.locations[j].start, name);
          }
        }
      }
      if (!dbClassInfo.unresolved.length) {
        delete dbClassInfo.unresolved; 
      }
      
      // Assets
      var assets = this.getAssets();
      if (assets.length) {
        dbClassInfo.assets = assets; 
      }
      if (meta) {
        if (meta.aliases) {
          dbClassInfo.aliases = {};
          for (let name in meta.aliases.aliasMap) {
            dbClassInfo.aliases[name] = meta.aliases.aliasMap[name]; 
          }
        }
        if (meta.themeMeta) {
          dbClassInfo.themeMeta = {};
          for (let name in meta.themeMeta.themeMetaMap) {
            dbClassInfo.themeMeta[name] = meta.themeMeta.themeMetaMap[name];
          }
        }
      }

      // Translation
      if (this.__translations.length) {
        dbClassInfo.translations = this.__translations.slice(0); 
      }
      
      // Markers
      if (this.__markers.length) {
        dbClassInfo.markers = qx.lang.Array.clone(this.__markers); 
      }

      // Errors
      if (this.__fatalCompileError) {
        dbClassInfo.fatalCompileError = true;
      }

      return dbClassInfo;
    }
function() {
      var t = this;
      var dbClassInfo = this.__dbClassInfo = {};

      // Collect the dependencies on other classes
      var deps = this.getRequiredClasses();
      for (var name in deps) {
        var dep = deps[name];
        if (!dep.ignore) {
          if (!dbClassInfo.dependsOn) {
            dbClassInfo.dependsOn = {};
          }
          dbClassInfo.dependsOn[name] = dep;
        }
      }
      
      function fixAnnos(section) {
        if (!section) {
          return;
        }
        Object.keys(section).forEach(name => {
          if (name[0] == "@") {
            var value = section[name];
            delete section[name];
            name = name.substring(1);
            var meta = section[name];
            if (meta) {
              if (!meta.annotations) {
                meta.annotations = []; 
              }
              meta.annotations.push(value);
            }
          }
        });
      }
      
      var meta = this.getOuterClassMeta();
      if (meta) {
        fixAnnos(meta.events);
        fixAnnos(meta.members);
        fixAnnos(meta.statics);
        
        if (meta.properties && meta.members) {
          Object.keys(meta.properties).forEach(name => {
            let pm = meta.properties[name];
            if (pm.apply) {
              let fm = meta.members[pm.apply];
              if (fm) {
                if (!fm.applyFor) {
                  fm.applyFor = [];
                }
                fm.applyFor.push(name);
              }
            }
          });
        }
  
        // Class heirararchy
        dbClassInfo.extends = meta.superClass;
        dbClassInfo.include = meta.mixins.slice(0);
        dbClassInfo.implement = meta.interfaces.slice(0);
      }
      
      // Environment Checks
      if (Object.keys(this.__environmentChecks.provided).length || Object.keys(this.__environmentChecks.required).length) {
        dbClassInfo.environment = { provided: [], required: {} };
        for (let key in this.__environmentChecks.provided) {
          dbClassInfo.environment.provided.push(key); 
        }
        for (let key in this.__environmentChecks.required) {
          dbClassInfo.environment.required[key] = this.__environmentChecks.required[key]; 
        }
      }

      // Save whether the class has a defer method
      dbClassInfo.hasDefer = this.hasDefer();

      // Unresolved symbols
      dbClassInfo.unresolved = [];
      for (let name in this.__scope.unresolved) {
        let item = this.__scope.unresolved[name];
        // item is undefined if it has already been removed from the list
        if (item === undefined) {
          continue;
        }
        var info = t.__analyser.getSymbolType(name);
        if (info && info.className) {
          t._requireClass(info.className, { load: item.load, defer: item.defer }); 
        } else if (info && info.symbolType == "package") {
          t.deleteReference(name);
        } else {
          dbClassInfo.unresolved.push(item);
          for (var j = 0; j < item.locations.length; j++) {
            t.addMarker("symbol.unresolved", item.locations[j].start, name);
          }
        }
      }
      if (!dbClassInfo.unresolved.length) {
        delete dbClassInfo.unresolved; 
      }
      
      // Assets
      var assets = this.getAssets();
      if (assets.length) {
        dbClassInfo.assets = assets; 
      }
      if (meta) {
        if (meta.aliases) {
          dbClassInfo.aliases = {};
          for (let name in meta.aliases.aliasMap) {
            dbClassInfo.aliases[name] = meta.aliases.aliasMap[name]; 
          }
        }
        if (meta.themeMeta) {
          dbClassInfo.themeMeta = {};
          for (let name in meta.themeMeta.themeMetaMap) {
            dbClassInfo.themeMeta[name] = meta.themeMeta.themeMetaMap[name];
          }
        }
      }

      // Translation
      if (this.__translations.length) {
        dbClassInfo.translations = this.__translations.slice(0); 
      }
      
      // Markers
      if (this.__markers.length) {
        dbClassInfo.markers = qx.lang.Array.clone(this.__markers); 
      }

      // Errors
      if (this.__fatalCompileError) {
        dbClassInfo.fatalCompileError = true;
      }

      return dbClassInfo;
    }
function ( ) { var t = this ; var dbClassInfo = this . __dbClassInfo = { } ; // Collect the dependencies on other classes var deps = this . getRequiredClasses ( ) ; for ( var name in deps ) { var dep = deps [ name ] ; if ( ! dep . ignore ) { if ( ! dbClassInfo . dependsOn ) { dbClassInfo . dependsOn = { } ; } dbClassInfo . dependsOn [ name ] = dep ; } } function fixAnnos ( section ) { if ( ! section ) { return ; } Object . keys ( section ) . forEach ( name => { if ( name [ 0 ] == "@" ) { var value = section [ name ] ; delete section [ name ] ; name = name . substring ( 1 ) ; var meta = section [ name ] ; if ( meta ) { if ( ! meta . annotations ) { meta . annotations = [ ] ; } meta . annotations . push ( value ) ; } } } ) ; } var meta = this . getOuterClassMeta ( ) ; if ( meta ) { fixAnnos ( meta . events ) ; fixAnnos ( meta . members ) ; fixAnnos ( meta . statics ) ; if ( meta . properties && meta . members ) { Object . keys ( meta . properties ) . forEach ( name => { let pm = meta . properties [ name ] ; if ( pm . apply ) { let fm = meta . members [ pm . apply ] ; if ( fm ) { if ( ! fm . applyFor ) { fm . applyFor = [ ] ; } fm . applyFor . push ( name ) ; } } } ) ; } // Class heirararchy dbClassInfo . extends = meta . superClass ; dbClassInfo . include = meta . mixins . slice ( 0 ) ; dbClassInfo . implement = meta . interfaces . slice ( 0 ) ; } // Environment Checks if ( Object . keys ( this . __environmentChecks . provided ) . length || Object . keys ( this . __environmentChecks . required ) . length ) { dbClassInfo . environment = { provided : [ ] , required : { } } ; for ( let key in this . __environmentChecks . provided ) { dbClassInfo . environment . provided . push ( key ) ; } for ( let key in this . __environmentChecks . required ) { dbClassInfo . environment . required [ key ] = this . __environmentChecks . required [ key ] ; } } // Save whether the class has a defer method dbClassInfo . hasDefer = this . hasDefer ( ) ; // Unresolved symbols dbClassInfo . unresolved = [ ] ; for ( let name in this . __scope . unresolved ) { let item = this . __scope . unresolved [ name ] ; // item is undefined if it has already been removed from the list if ( item === undefined ) { continue ; } var info = t . __analyser . getSymbolType ( name ) ; if ( info && info . className ) { t . _requireClass ( info . className , { load : item . load , defer : item . defer } ) ; } else if ( info && info . symbolType == "package" ) { t . deleteReference ( name ) ; } else { dbClassInfo . unresolved . push ( item ) ; for ( var j = 0 ; j < item . locations . length ; j ++ ) { t . addMarker ( "symbol.unresolved" , item . locations [ j ] . start , name ) ; } } } if ( ! dbClassInfo . unresolved . length ) { delete dbClassInfo . unresolved ; } // Assets var assets = this . getAssets ( ) ; if ( assets . length ) { dbClassInfo . assets = assets ; } if ( meta ) { if ( meta . aliases ) { dbClassInfo . aliases = { } ; for ( let name in meta . aliases . aliasMap ) { dbClassInfo . aliases [ name ] = meta . aliases . aliasMap [ name ] ; } } if ( meta . themeMeta ) { dbClassInfo . themeMeta = { } ; for ( let name in meta . themeMeta . themeMetaMap ) { dbClassInfo . themeMeta [ name ] = meta . themeMeta . themeMetaMap [ name ] ; } } } // Translation if ( this . __translations . length ) { dbClassInfo . translations = this . __translations . slice ( 0 ) ; } // Markers if ( this . __markers . length ) { dbClassInfo . markers = qx . lang . Array . clone ( this . __markers ) ; } // Errors if ( this . __fatalCompileError ) { dbClassInfo . fatalCompileError = true ; } return dbClassInfo ; }
Compiles the DbInfo POJO to be stored in the database about this class
Compiles the DbInfo POJO to be stored in the database about this class