/*
(non-Javadoc)
@see javax.naming.Context#rebind(javax.naming.Name, java.lang.Object)
501924
@Override
	public void rebind(Name name, Object obj) throws NamingException
    {
        if (name.isEmpty())
            throw new InvalidNameException("Cannot bind empty name");

        // Extract components that belong to this namespace
        String nm = name.toString();

        // Add object to internal hash table
        bindings.put(nm, obj);
    }
670384
public void setName(String name)
    {
        super.setName(name);
        m_tf.setName(name);
        if (m_button != null)
            m_button.setName(name);
        if (m_buttonTime != null)
            m_buttonTime.setName(name);
    }
897564
public Response bind(String name, Object model) {
        getLocals().put(name, model);

        return this;
    }
309499
protected PropertyValueBindingBuilder bindProperty( final String name )
    {
        checkNotNull( name, "Property name cannot be null." );

        return new PropertyValueBindingBuilder()
        {

            public void toValue( final String value )
            {
                checkNotNull( value, "Null value not admitted for property '%s's", name );

                bindConstant().annotatedWith( named( name ) ).to( value );
            }

        };
    }
261565
@Deprecated
	public void bind(String name, Object value)
	{
		if (name2Index == null)
		{
			throw new RuntimeException("申明的绑定和代码里实际绑定不一致");
		}
		Integer index = name2Index.get(name);
		if (index == null)
		{
			throw new RuntimeException("申明的绑定和代码里实际绑定不一致:试图绑定未申明的变量" + name);
		}
		ctx.vars[index] = value;
	}
1028130
public void setName(String name) {
        String oldname = this.name;
        this.name = name;
        //TODO Reset the main map
        save(oldname);
    }
1070092
function (name, value, oldValue) {
                this.$Element.onbind.apply(this, arguments);
                this.onDisabledBind(name, value, oldValue);
            }
434007
protected void relink(OutputElementBase parent)
    {
        mNsMapping = parent.mNsMapping;
        mNsMapShared = (mNsMapping != null);
        mDefaultNsURI = parent.mDefaultNsURI;
        mRootNsContext = parent.mRootNsContext;
    }
796947
@Override
    public /*final*/ void bind(ResourceAddress address, IoHandler handler, BridgeSessionInitializer<? extends IoFuture> initializer) {

        // bind only address with matching scheme
        URI location = address.getResource();
        String schemeName = location.getScheme();
        if (!canBind(schemeName)) {
            throw new IllegalArgumentException(format("Unexpected scheme \"%s\" for URI: %s", schemeName, location));
        }
        
        if (!started.get()) {
            synchronized (started) {
                if (!started.get()) {
                    init();
                    started.set(true);
                }
            }
        }

        boolean bindAlternate;
        do {
            bindAlternate = address.getOption(BIND_ALTERNATE);
            //
            // add binding, expecting no clashing (according to BINDINGS_COMPARATOR)
            //
            Binding newBinding = new Binding(address, handler, initializer);
            Binding oldBinding = bindings.addBinding(newBinding);

            //System.out.println(getClass().getSimpleName()+"@"+hashCode()+" binding: "+address.getExternalURI()+" -- "+address.getOption(NEXT_PROTOCOL));

            if (oldBinding != null) {
                throw new RuntimeException("Unable to bind address " + address
                        + " because it collides with an already bound address " + oldBinding.bindAddress());
            }

            bindInternal(address, handler, initializer);
            address = address.getOption(ALTERNATE);
            
        } while (address != null && bindAlternate);
    }
172663
public void bind(String name, T binding) {
        put(name, binding);

        Map<String, Map<String, NameClassPair>> bindingsByContext = this.contextBindings;
        if (bindingsByContext != null) {
            addContextBinding(bindingsByContext, name, binding);
        }

        Set<String> contexts = this.contexts;
        if (contexts != null) {
            contexts.add(getContextName(name));
        }
    }
957374
public final void setParameter(String name, Object value) {
        if (isNative()) {
            bindParameters.add(new BindParameter(name, value));
        } else {
            setParameterValue(":" + name, value);
        }

        parametersMap.put(":" + name, value);
    }
1240178
public void setValueBinding(String name, ValueBinding binding) {
        if (name == null) {
            throw new NullPointerException();
        }
        if (binding != null) {
            ValueExpressionValueBindingAdapter adapter =
                    new ValueExpressionValueBindingAdapter(binding);
            setValueExpression(name, adapter);
        } else {
            setValueExpression(name, null);
        }

    }
586476
public void bindTo(Object proxy) {
    if (handle != null) {
      throw new IllegalStateException(
          "Attempted to rebind a default method handler that was already bound");
    }
    handle = unboundHandle.bindTo(proxy);
  }
701369
@SuppressWarnings("unchecked")
	public final Object bind(ConfigurationPropertyName name, Bindable<?> target,
			AggregateElementBinder elementBinder) {
		Object result = bindAggregate(name, target, elementBinder);
		Supplier<?> value = target.getValue();
		if (result == null || value == null) {
			return result;
		}
		return merge((Supplier<T>) value, (T) result);
	}
212714
public void addBinding(Property<?> value) {
    if (value.getName() == null || value.getName().isEmpty()) {
      throw new IllegalArgumentException("property name must not be empty");
    }
    getBindings().put(value.getName(), value);
  }
1218954
@Override
	public void rename(Name oldname, Name newname) throws NamingException
    {
        if (oldname.isEmpty() || newname.isEmpty())
            throw new InvalidNameException("Cannot rename empty name");

        // Extract components that belong to this namespace
        String oldnm = oldname.toString();
        String newnm = newname.toString();

        // Check if new name exists
        if (bindings.get(newnm) != null)
            throw new NameAlreadyBoundException(newname.toString() + " is already bound");

        // Check if old name is bound
        Object oldBinding = bindings.remove(oldnm);
        if (oldBinding == null)
            throw new NameNotFoundException(oldname.toString() + " not bound");

        bindings.put(newnm, oldBinding);
    }
585693
public <T extends DataObject> DataBinder put(T object, String... names) throws Exception {
        Class<?> type = object.getClass();
        Object value;
        for (String name: names) {
            Field field = Beans.getKnownField(type, name);
            if (!Modifier.isStatic(field.getModifiers()) && !Modifier.isTransient(field.getModifiers()) && (value = field.get(object)) != null) {
                put(field.getName(), value.toString());
            }
        }
        return this;
    }