/*
Helpers for manipulating the Component/Context maps.
503570
private Map<Contextual<?>, Object> getComponentInstanceMap()
   {
      ConcurrentHashMap<Contextual<?>, Object> map = (ConcurrentHashMap<Contextual<?>, Object>) getCurrentContext()
               .getAttributeMap().get(COMPONENT_MAP_NAME);
      if (map == null)
      {
         map = new ConcurrentHashMap<Contextual<?>, Object>();
         getCurrentContext().getAttributeMap().put(COMPONENT_MAP_NAME, map);
      }
      return map;
   }
687262
@SuppressWarnings("unchecked")
    public static void configureModules(final ConfigurationContext context) {
        final Options options = new Options(context.options());
        for (Module mod : context.getEnabledModules()) {
            if (mod instanceof BootstrapAwareModule) {
                ((BootstrapAwareModule) mod).setBootstrap(context.getBootstrap());
            }
            if (mod instanceof ConfigurationAwareModule) {
                ((ConfigurationAwareModule) mod).setConfiguration(context.getConfiguration());
            }
            if (mod instanceof ConfigurationTreeAwareModule) {
                ((ConfigurationTreeAwareModule) mod).setConfigurationTree(context.getConfigurationTree());
            }
            if (mod instanceof EnvironmentAwareModule) {
                ((EnvironmentAwareModule) mod).setEnvironment(context.getEnvironment());
            }
            if (mod instanceof OptionsAwareModule) {
                ((OptionsAwareModule) mod).setOptions(options);
            }
        }
    }
913622
def _buildElementNsmap(using_elements):
    '''
    
    '''
    thisMap = {}
    for e in using_elements:
        thisMap[e.attrib['prefix']] = e.attrib['namespace']
    return thisMap
9221
function Component(parent, context, id, scope) {
    this.parent = parent;
    this.context = context;
    this.id = id;
    this._scope = scope;
  }
1261686
function parseMap(map, context) {
    const parsed = { default: {} };
    const primaryName = 'primary';

    if (map === null) {
        parsed.default[primaryName] = context.subAttrPath.join('.');
    } else {
        map.split(';').forEach(part => {
            const parts = part.split(':', 2);
            const dataSource = parts.length < 2 ? primaryName : parts.shift();
            parsed.default[dataSource] = parts[0];
        });
    }
    return parsed;
}
851175
@SuppressWarnings("unchecked")
    public <T> T get(final Contextual<T> component) {
        assertActive();
        return (T) getComponentInstanceMap().get(component);
    }
690447
function attachExtensions(root, parent, maps)
  {
    this.root = root;
    this.pointers = [];
    this.parent = parent;
    this.maps = maps;
    Object.defineProperties(this, {
      localmaps: setDescriptorLocalMaps(parent),
      subnodes: setDescriptorSubNodes(parent)
    })
  }
865064
@Override
  public StringMap injectContextData(@Nullable List<Property> properties, StringMap reusable) {
    return ContextDataUtils.injectContextData(properties, reusable);
  }
299738
function ComponentContext(zuixInstance, options, eventCallback) {
    zuix = zuixInstance;
    this._options = null;
    this.contextId = (options == null || options.contextId == null) ? null : options.contextId;
    this.componentId = null;
    this.trigger = function(context, eventPath, eventValue) {
        if (typeof eventCallback === 'function') {
            eventCallback(context, eventPath, eventValue);
        }
    };

    /** @protected */
    this._container = null;

    /** @protected */
    this._model = null;
    /** @protected */
    this._view = null;
    /** @protected */
    this._css = null;
    /** @protected */
    this._style = null;
    /**
     * @protected
     * @type {ContextControllerHandler}
     */
    this._controller = null;

    /**
     * Define the local behavior handler for this context instance only.
     * Any global behavior matching the same `componentId` will be overridden.
     *
     * @function behavior
     * @param handler_fn {function}
     */
    this.behavior = null;

    /** @package */
    this._eventMap = [];
    /** @package */
    this._behaviorMap = [];

    /**
     * @package
     * @type {ContextController}
     */
    this._c = null;

    this.options(options);

    return this;
}
237396
function generateSourceMappings(removedNodes) {
  var mappings = '';
  if (!removedNodes || removedNodes.length === '') {
    return mappings;
  }

  var end = {line: 1, column: 0};

  for (var i = 0; i < removedNodes.length; i++) {
    var start = removedNodes[i].loc.start;
    var lineDiff = start.line - end.line;
    var columnDiff = start.column - end.column;
    if (lineDiff) {
      for (var l = 0; l !== lineDiff; l++) {
        mappings += ';';
      }
      mappings += vlq.encode([start.column, 0, lineDiff, columnDiff]);
    } else if (columnDiff) {
      if (i) {
        mappings += ',';
      }
      mappings += vlq.encode([columnDiff, 0, lineDiff, columnDiff]);
    }

    end = removedNodes[i].loc.end;
    mappings += ',';
    mappings += vlq.encode([
      0,
      0,
      end.line - start.line,
      end.column - start.column,
    ]);
  }

  return mappings;
}
168234
private void processComponents(MAPDialogImpl mapDialogImpl, Component[] components) {

        // Now let us decode the Components
        for (Component c : components) {

            doProcessComponent(mapDialogImpl, c);
        }
    }
1071541
@Trivial
    @Modified
    protected void modified(ComponentContext context) {
        Dictionary<String, ?> props = context.getProperties();
        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(this, tc, "modified", props);

        String contextSvcName = (String) props.get(JNDI_NAME);
        if (contextSvcName == null)
            contextSvcName = (String) props.get(CONFIG_ID);

        ContextServiceImpl[] listeners;

        lock.writeLock().lock();
        try {
            listeners = modificationListeners.toArray(new ContextServiceImpl[modificationListeners.size()]);
            modificationListeners.clear();

            componentContext = context;
            properties = props;
            name = contextSvcName;
            threadContextConfigurations = null;
        } finally {
            lock.writeLock().unlock();
        }

        for (ContextServiceImpl listener : listeners)
            listener.baseInstanceModified();

        if (trace && tc.isEntryEnabled())
            Tr.exit(this, tc, "modified");
    }
793138
function noRef(ContextAPIs, mapContextToProps) {
  return ComposedComponent => {
    const Component = withContext(ContextAPIs, mapContextToProps)(ComposedComponent)
    return props => (<Component {...props} />)
  }
}
613785
function Mapping() {
    this.generatedLine = 0;
    this.generatedColumn = 0;
    this.source = null;
    this.originalLine = null;
    this.originalColumn = null;
    this.name = null;
  }
513761
private ContextUsersPanel getContextPanel(int contextId) {
		ContextUsersPanel panel = this.userPanelsMap.get(contextId);
		if (panel == null) {
			panel = new ContextUsersPanel(this, contextId);
			this.userPanelsMap.put(contextId, panel);
		}
		return panel;
	}
1273007
function getContext (el, binding, vnode) {
  const ctx = { el, binding, vnode }
  ctx.props = getOptions(ctx)

  if (!ctx.props) {
    binding.def.unbind(el, binding)
    return
  }

  return ctx
}
920249
function RenderContext() {
		this._aBuffer = [];
		var that = this;
		this.add = function() {
			that._aBuffer.push.apply(that._aBuffer, arguments);
		};
		this.addWithParam = function(s, o) {
			for (var n in o) {
				var reg = new RegExp("\{" + n + "\}","g");
				s = s.replace(reg,o[n]);
			}
			that.add(s);
		};
		this.toString = function() {
			return that._aBuffer.join("");
		};
	}