system/src/sc/lang/js/JSRuntimeProcessor.java
private void registerPrefixAlias(Object type) {
      // This prefix alias attribute does not work for inner classes.
      if (ModelUtil.getEnclosingType(type) == null) {
         String typeName = ModelUtil.getTypeName(type);
         String prefixStr = (String) ModelUtil.getTypeOrLayerAnnotationValue(system, type, "sc.js.JSSettings", "prefixAlias");
         if (prefixStr != null && prefixStr.length() > 0) {
            String pkgName = CTypeUtil.getPackageName(ModelUtil.getTypeName(type));
            String oldPrefix = jsBuildInfo.prefixAliases.put(pkgName, prefixStr);
            if (oldPrefix != null && !oldPrefix.equals(prefixStr)) {
               System.err.println("*** JSSettings.prefixAlias value on type: " + type + " set to: " + prefixStr + " which conflicts with the old prefixAlias for pkg: " + pkgName + " of: " + oldPrefix);
            }
            HashSet<String> pkgs = jsBuildInfo.aliasedPackages.get(prefixStr);
            if (pkgs == null) {
               pkgs = new HashSet<String>();
               jsBuildInfo.aliasedPackages.put(prefixStr, pkgs);
            }
            pkgs.add(pkgName);
         }
      }
   }
/**
    * This must be called on the type before we try to use the js type name.
    * TODO - performance: we are calling this more often than necessary... need to check each type in each layer but maybe we can remove one or two of the calls to it?
    */
This must be called on the type before we try to use the js type name.
TODO - performance: we are calling this more often than necessary...
This must be called on the type before we try to use the js type name . TODO - performance : we are calling this more often than necessary ...
private void registerPrefixAlias(Object type) {
      if (ModelUtil.getEnclosingType(type) == null) {
         String typeName = ModelUtil.getTypeName(type);
         String prefixStr = (String) ModelUtil.getTypeOrLayerAnnotationValue(system, type, "sc.js.JSSettings", "prefixAlias");
         if (prefixStr != null && prefixStr.length() > 0) {
            String pkgName = CTypeUtil.getPackageName(ModelUtil.getTypeName(type));
            String oldPrefix = jsBuildInfo.prefixAliases.put(pkgName, prefixStr);
            if (oldPrefix != null && !oldPrefix.equals(prefixStr)) {
               System.err.println("*** JSSettings.prefixAlias value on type: " + type + " set to: " + prefixStr + " which conflicts with the old prefixAlias for pkg: " + pkgName + " of: " + oldPrefix);
            }
            HashSet<String> pkgs = jsBuildInfo.aliasedPackages.get(prefixStr);
            if (pkgs == null) {
               pkgs = new HashSet<String>();
               jsBuildInfo.aliasedPackages.put(prefixStr, pkgs);
            }
            pkgs.add(pkgName);
         }
      }
   }
private void registerPrefixAlias ( Object type ) { if ( ModelUtil . getEnclosingType ( type ) == null ) { String typeName = ModelUtil . getTypeName ( type ) ; String prefixStr = ( String ) ModelUtil . getTypeOrLayerAnnotationValue ( system , type , "sc.js.JSSettings" , "prefixAlias" ) ; if ( prefixStr != null && prefixStr . length ( ) > 0 ) { String pkgName = CTypeUtil . getPackageName ( ModelUtil . getTypeName ( type ) ) ; String oldPrefix = jsBuildInfo . prefixAliases . put ( pkgName , prefixStr ) ; if ( oldPrefix != null && ! oldPrefix . equals ( prefixStr ) ) { System . err . println ( "*** JSSettings.prefixAlias value on type: " + type + " set to: " + prefixStr + " which conflicts with the old prefixAlias for pkg: " + pkgName + " of: " + oldPrefix ) ; } HashSet < String > pkgs = jsBuildInfo . aliasedPackages . get ( prefixStr ) ; if ( pkgs == null ) { pkgs = new HashSet < String > ( ) ; jsBuildInfo . aliasedPackages . put ( prefixStr , pkgs ) ; } pkgs . add ( pkgName ) ; } } }
This must be called on the type before we try to use the js type name.
This must be called on the type before we try to use the js type name .
// This prefix alias attribute does not work for inner classes.