Implement to provide binding definitions using the exposed binding
methods.
543849
@Override
    protected void configure() {
        bind(SwaggerServletContext.class).to(ServletContext.class).in(Singleton.class);
        bind(SwaggerServletConfig.class).to(ServletConfig.class).in(Singleton.class);
    }
293402
public void assignMutableBinding(ExecutionContext context, String name, Object value, boolean configurable, boolean strict) {
        final boolean exists = hasBinding(context, name);
        if (!exists) {
            PropertyDescriptor desc = new PropertyDescriptor();
            desc.setValue(value);
            desc.setConfigurable(configurable);
            this.mutableBindings.put(name, desc);
        } else {
            PropertyDescriptor desc = this.mutableBindings.get(name);
            desc.setValue(value);
            return;
        }
    }
467042
public void bind(ExposedPort exposedPort, Binding binding) {
        if (ports.containsKey(exposedPort)) {
            Binding[] bindings = ports.get(exposedPort);
            ports.put(exposedPort, (Binding[]) ArrayUtils.add(bindings, binding));
        } else {
            if (binding == null) {
                ports.put(exposedPort, null);
            } else {
                ports.put(exposedPort, new Binding[] {binding});
            }
        }
    }
88711
def expose!(klass)
      attribute = self

      klass.instance_eval do
        define_method attribute.getter_method_name do
          Context.new(self, attribute).get
        end

        define_method attribute.setter_method_name do |value|
          Context.new(self, attribute).set(value)
        end
      end
    end
492386
private void processTemplateExpressions(ComponentExposedTypeGenerator exposedTypeGenerator,
      TemplateParserResult templateParserResult) {
    for (TemplateExpression expression : templateParserResult.getExpressions()) {
      generateTemplateExpressionMethod(exposedTypeGenerator,
          expression,
          templateParserResult.getTemplateName());
    }

    // Declare methods in the component
    String templateMethods = templateParserResult.getExpressions()
        .stream()
        .map(expression -> "p." + expression.getId())
        .collect(Collectors.joining(", "));

    exposedTypeGenerator.getOptionsBuilder()
        .addStatement("options.registerTemplateMethods($L)", templateMethods);
  }
34076
private function applyBindings()
    {
        foreach ($this->bindings as $abstract => $binding) {
            list($concrete, $shared) = $binding;

            $this->app->bind($abstract, $concrete, $shared);
        }
    }
341789
private void collectBindings(List<SitebricksModule.LinkingBinder> bindings,
                               Set<PageBook.Page> pagesToCompile) {

    // Reverse the method map for easy lookup of HTTP method annotations.
    Map<Class<? extends Annotation>, String> methodSet = null;

    //go thru bindings and obtain pages from them.
    for (SitebricksModule.LinkingBinder binding : bindings) {

      if (EMBEDDED == binding.bindingKind) {
        if (null == binding.embedAs) {
          // This can happen if embed() is not followed by an .as(..)
          throw new IllegalStateException("embed() missing .as() clause: " + binding.pageClass);
        }
        registry.addEmbed(binding.embedAs);
        pagesToCompile.add(pageBook.embedAs(binding.pageClass, binding.embedAs));

      } else if (PAGE == binding.bindingKind) {
        pagesToCompile.add(pageBook.at(binding.uri, binding.pageClass));

      } else if (STATIC_RESOURCE == binding.bindingKind) {
        //localize the resource to the SitebricksModule's package.
        resourcesService.add(SitebricksModule.class, binding.getResource());
      } else if (SERVICE == binding.bindingKind) {
        pagesToCompile.add(pageBook.serviceAt(binding.uri, binding.pageClass));
      } else if (ACTION == binding.bindingKind) {
        // Lazy create this inverse lookup map, once.
        if (null == methodSet) {
          methodSet = HashBiMap.create(methodMap).inverse();
        }
        pageBook.at(binding.uri, binding.actionDescriptors, methodSet);
      }
    }
  }
245842
function addPreset(name, definition) {
      definition = definition || {};
      definition.methods = definition.methods || [];
      definition.options = definition.options || function() { return {}; };

      if (/^cancel|hide|show$/.test(name)) {
        throw new Error("Preset '" + name + "' in " + interimFactoryName + " is reserved!");
      }
      if (definition.methods.indexOf('_options') > -1) {
        throw new Error("Method '_options' in " + interimFactoryName + " is reserved!");
      }
      providerConfig.presets[name] = {
        methods: definition.methods.concat(EXPOSED_METHODS),
        optionsFactory: definition.options,
        argOption: definition.argOption
      };
      return provider;
    }
20210
def do_resolve(self, definitions):
        
        filtered = []
        for p in self.ports:
            ref = qualify(p.binding, self.root, definitions.tns)
            binding = definitions.bindings.get(ref)
            if binding is None:
                raise Exception("binding '%s', not-found" % (p.binding,))
            if binding.soap is None:
                log.debug("binding '%s' - not a SOAP binding, discarded",
                    binding.name)
                continue
            # After we have been resolved, our caller will expect that the
            # binding we are referencing has been fully constructed, i.e.
            # resolved, as well. The only scenario where the operations binding
            # might possibly not have already resolved its references, and
            # where this explicit resolve() call is required, is if we are
            # dealing with a recursive WSDL import chain.
            binding.resolve(definitions)
            p.binding = binding
            filtered.append(p)
        self.ports = filtered
242388
function expose(){

    // TODO test this
    // if(!isDefined(defaultValue)){
    //  throw new Error("model.addPublicProperty() is being " +
    //    "invoked with an undefined default value. Default values for exposed properties " +
    //    "must be defined, to guarantee predictable behavior. For exposed properties that " +
    //    "are optional and should have the semantics of an undefined value, " +
    //    "use null as the default value.");
    //}

    // TODO test this
    if(!lastPropertyAdded){
      throw Error("Expose() was called without first adding a property.");
    }

    var propertyName = lastPropertyAdded;

    if(!exposedProperties){
      exposedProperties = [];
    }
    exposedProperties.push(propertyName);

    // Destroy the previous reactive function that was listening for changes
    // in all exposed properties except the newly added one.
    // TODO think about how this might be done only once, at the same time isFinalized is set.
    if(configurationReactiveFunction){
      configurationReactiveFunction.destroy();
    }

    // Set up the new reactive function that will listen for changes
    // in all exposed properties including the newly added one.
    var inputPropertyNames = exposedProperties;

    //console.log(inputPropertyNames);
    configurationReactiveFunction = ReactiveFunction({
      inputs: inputPropertyNames.map(getProperty),
      output: configurationProperty,
      callback: function (){
        var configuration = {};
        inputPropertyNames.forEach(function (propertyName){
          var property = getProperty(propertyName);

          // Omit default values from the returned configuration object.
          if(property() !== property.default()){
            configuration[propertyName] = property();
          }
        });
        return configuration;
      }
    });

    // Support method chaining.
    return model;
  }
837941
function () {
            this.$BindableWidget.initWidget.call(this);

            var bindings = this._cfg.bind;
            var isBound = false;

            if (bindings.visible) {
                var visible = this._transform(bindings.visible.transform, bindings.visible.inside[bindings.visible.to], "toWidget");
                if (visible === true) {
                    this.show();
                }
                isBound = true;
            }
            if (!isBound) {
                this.$logWarn(this.BINDING_NEEDED, [this.$class, "visible"]);
            }
        }
1155812
function defineOneWayBinding (key, handler) {
    var attr = $attrs.$normalize('md-' + key);
    if (handler) defineProperty(key, handler);
    $attrs.$observe(attr, function (newValue) { ctrl[ key ] = newValue; });
  }
462519
private void bindAttribute(Annotation annotation)
    {
        String fieldname = ((AttributeOverride) annotation).name();
        Column column = ((AttributeOverride) annotation).column();
        ((AbstractManagedType) this.superClazzType).columnBindings.put(fieldname, column);
    }
127163
private void bindTypeAnnotations()
    {
        // TODO:: need to check @Embeddable attributes as well!

        // TODO:: need to Handle association override in
        // RelationMetadataProcessor.

        for (Class<? extends Annotation> ann : validJPAAnnotations)
        {
            if (getJavaType().isAnnotationPresent(ann))
            {
                checkForValid();

                Annotation annotation = getJavaType().getAnnotation(ann);

                if (ann.isAssignableFrom(AttributeOverride.class))
                {
                    bindAttribute(annotation);
                }
                else if (ann.isAssignableFrom(AttributeOverrides.class))
                {

                    AttributeOverride[] attribAnns = ((AttributeOverrides) annotation).value();

                    for (AttributeOverride attribOverann : attribAnns)
                    {
                        bindAttribute(attribOverann);
                    }

                }

            }
        }
    }
90217
public void installBindings(DependencyExplorerOutput output) {
    positions.position(output);
    
    // Install each implicit binding in the correct position
    for (Map.Entry<Key<?>, Binding> entry : output.getImplicitBindings()) {
      installBinding(output.getGraph(), entry.getKey(), entry.getValue());
    }
    
    // Make sure that each of the dependencies needed directly from the origin are available
    GinjectorBindings origin = output.getGraph().getOrigin();
    inheritBindingsForDeps(origin, origin.getDependencies());
  }
854435
public DefinitionBinder bind(String beanName, Class<?> clazz) {
    return new DefinitionBinder(this).bind(beanName, clazz);
  }
450331
function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) {
      var removeWatchCollection = [];
      var changes;
      forEach(bindings, function initializeBinding(definition, scopeName) {
        var attrName = definition.attrName,
        optional = definition.optional,
        mode = definition.mode, // @, =, or &
        lastValue,
        parentGet, parentSet, compare, removeWatch;

        switch (mode) {

          case '@':
            if (!optional && !hasOwnProperty.call(attrs, attrName)) {
              destination[scopeName] = attrs[attrName] = void 0;
            }
            attrs.$observe(attrName, function(value) {
              if (isString(value)) {
                var oldValue = destination[scopeName];
                recordChanges(scopeName, value, oldValue);
                destination[scopeName] = value;
              }
            });
            attrs.$$observers[attrName].$$scope = scope;
            lastValue = attrs[attrName];
            if (isString(lastValue)) {
              // If the attribute has been provided then we trigger an interpolation to ensure
              // the value is there for use in the link fn
              destination[scopeName] = $interpolate(lastValue)(scope);
            } else if (isBoolean(lastValue)) {
              // If the attributes is one of the BOOLEAN_ATTR then Angular will have converted
              // the value to boolean rather than a string, so we special case this situation
              destination[scopeName] = lastValue;
            }
            break;

          case '=':
            if (!hasOwnProperty.call(attrs, attrName)) {
              if (optional) break;
              attrs[attrName] = void 0;
            }
            if (optional && !attrs[attrName]) break;

            parentGet = $parse(attrs[attrName]);
            if (parentGet.literal) {
              compare = equals;
            } else {
              compare = function simpleCompare(a, b) { return a === b || (a !== a && b !== b); };
            }
            parentSet = parentGet.assign || function() {
              // reset the change, or we will throw this exception on every $digest
              lastValue = destination[scopeName] = parentGet(scope);
              throw $compileMinErr('nonassign',
                  "Expression '{0}' in attribute '{1}' used with directive '{2}' is non-assignable!",
                  attrs[attrName], attrName, directive.name);
            };
            lastValue = destination[scopeName] = parentGet(scope);
            var parentValueWatch = function parentValueWatch(parentValue) {
              if (!compare(parentValue, destination[scopeName])) {
                // we are out of sync and need to copy
                if (!compare(parentValue, lastValue)) {
                  // parent changed and it has precedence
                  destination[scopeName] = parentValue;
                } else {
                  // if the parent can be assigned then do so
                  parentSet(scope, parentValue = destination[scopeName]);
                }
              }
              return lastValue = parentValue;
            };
            parentValueWatch.$stateful = true;
            if (definition.collection) {
              removeWatch = scope.$watchCollection(attrs[attrName], parentValueWatch);
            } else {
              removeWatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);
            }
            removeWatchCollection.push(removeWatch);
            break;

          case '<':
            if (!hasOwnProperty.call(attrs, attrName)) {
              if (optional) break;
              attrs[attrName] = void 0;
            }
            if (optional && !attrs[attrName]) break;

            parentGet = $parse(attrs[attrName]);

            destination[scopeName] = parentGet(scope);

            removeWatch = scope.$watch(parentGet, function parentValueWatchAction(newParentValue) {
              var oldValue = destination[scopeName];
              recordChanges(scopeName, newParentValue, oldValue);
              destination[scopeName] = newParentValue;
            }, parentGet.literal);

            removeWatchCollection.push(removeWatch);
            break;

          case '&':
            // Don't assign Object.prototype method to scope
            parentGet = attrs.hasOwnProperty(attrName) ? $parse(attrs[attrName]) : noop;

            // Don't assign noop to destination if expression is not valid
            if (parentGet === noop && optional) break;

            destination[scopeName] = function(locals) {
              return parentGet(scope, locals);
            };
            break;
        }
      });

      function recordChanges(key, currentValue, previousValue) {
        if (isFunction(destination.$onChanges) && currentValue !== previousValue) {
          // If we have not already scheduled the top level onChangesQueue handler then do so now
          if (!onChangesQueue) {
            scope.$$postDigest(flushOnChangesQueue);
            onChangesQueue = [];
          }
          // If we have not already queued a trigger of onChanges for this controller then do so now
          if (!changes) {
            changes = {};
            onChangesQueue.push(triggerOnChangesHook);
          }
          // If the has been a change on this property already then we need to reuse the previous value
          if (changes[key]) {
            previousValue = changes[key].previousValue;
          }
          // Store this change
          changes[key] = {previousValue: previousValue, currentValue: currentValue};
        }
      }

      function triggerOnChangesHook() {
        destination.$onChanges(changes);
        // Now clear the changes so that we schedule onChanges when more changes arrive
        changes = undefined;
      }

      return removeWatchCollection.length && function removeWatches() {
        for (var i = 0, ii = removeWatchCollection.length; i < ii; ++i) {
          removeWatchCollection[i]();
        }
      };
    }