Receives the value from the client and sends it to the JSF bean.
341738
@Override
	public void decode(FacesContext context, UIComponent component) {
		SelectOneMenu menu = (SelectOneMenu) component;
		if (menu.isDisabled() || menu.isReadonly()) {
			return;
		}
		String outerClientId = menu.getClientId(context);
		String clientId = outerClientId + "Inner";
		String submittedOptionValue = (String) context.getExternalContext().getRequestParameterMap().get(clientId);

		Converter converter = menu.getConverter();
		if (null == converter) {
			converter = findImplicitConverter(context, component);
		}
		List<SelectItemAndComponent> items = SelectItemUtils.collectOptions(context, menu, converter);

		if (null != submittedOptionValue) {
			for (int index = 0; index < items.size(); index++) {
				Object currentOption = items.get(index).getSelectItem();
				String currentOptionValueAsString;
				Object currentOptionValue = null;
				if (currentOption instanceof SelectItem) {
					if (!((SelectItem) currentOption).isDisabled()) {
						currentOptionValue = ((SelectItem) currentOption).getValue();
					}
				}
				if (currentOptionValue instanceof String) {
					currentOptionValueAsString = (String) currentOptionValue;
				} else if (null != converter) {
					currentOptionValueAsString = converter.getAsString(context, component, currentOptionValue);
				} else if (currentOptionValue != null) {
					currentOptionValueAsString = String.valueOf(index);
				} else {
					currentOptionValueAsString = ""; // null values are submitted as empty strings
				}
				if (submittedOptionValue.equals(currentOptionValueAsString)) {
					Object submittedValue = null;
					if (currentOptionValue == null) {
						submittedValue = null;
					} else {
						submittedValue = null != converter ? currentOptionValueAsString : currentOptionValue;
					}
					menu.setSubmittedValue(submittedValue);
					menu.setValid(true);
					
					menu.validateValue(context, submittedValue);
					new AJAXRenderer().decode(context, component, clientId);
					if (menu.isValid()) {
						if (currentOptionValue == null)  {
							menu.setLocalValueSet(true);
						}
					}
					return;
				}
			}
			menu.validateValue(context, null);
			menu.setSubmittedValue(null);
			menu.setValid(false);
			return;
		}

		menu.setValid(true);
		menu.validateValue(context, submittedOptionValue);
		menu.setSubmittedValue(submittedOptionValue);
		new AJAXRenderer().decode(context, component, clientId);
	}
1209115
protected final Object beanLookup(Object value, Object propertyName) {
        LOGGER.trace("get JavaBean property : " + propertyName);
        return ParseUtils.getProperty(value, propertyName.toString(), PROPERTY_CACHE);
    }
240986
private void receiveMessage(ClientSocket client, DataInputStream buffer, byte from, StateConnection expected)
            throws IOException
    {
        if (ServerImpl.checkValidity(client, from, expected))
        {
            final byte dest = buffer.readByte();
            final byte type = buffer.readByte();
            final int size = buffer.readInt();
            if (size > 0)
            {
                final byte[] clientData = new byte[size];
                if (buffer.read(clientData) != -1) // CHECKSTYLE IGNORE LINE: TrailingComment|NestedIfDepth
                {
                    final DataInputStream clientBuffer = new DataInputStream(new ByteArrayInputStream(clientData));
                    decodeMessage(type, from, dest, clientBuffer);
                }
            }
            final int headerSize = 4;
            bandwidth += headerSize + size;
        }
    }
466155
private void updateBeanValueForColumnInRow(final WTableRowRenderer rowRenderer,
			final UIContext rowContext,
			final List<Integer> rowIndex, final int col, final TableModel model) {
		// The actual component is wrapped in a renderer wrapper, so we have to fetch it from that
		WComponent renderer = ((Container) rowRenderer.getRenderer(col)).getChildAt(0);

		UIContextHolder.pushContext(rowContext);

		try {
			// If the column is a Container then call updateBeanValue to let the column renderer and its children update
			// the "bean" returned by getValueAt(row, col)
			if (renderer instanceof Container) {
				WebUtilities.updateBeanValue(renderer);
			} else if (renderer instanceof DataBound) { // Update Databound renderer
				Object oldValue = model.getValueAt(rowIndex, col);
				Object newValue = ((DataBound) renderer).getData();
				if (!Util.equals(oldValue, newValue)) {
					model.setValueAt(newValue, rowIndex, col);
				}
			}

		} finally {
			UIContextHolder.popContext();
		}

	}
1104234
private void onChange(String key, byte[] oldValue, byte[] newValue) {
    listeners.forEach(id -> getSession(id).accept(client -> client.onChange(key, oldValue, newValue)));
  }
272017
private void beanToBean(Object providerBean, Object destBean) {
		valueProviderToBean(new BeanValueProvider(providerBean, this.copyOptions.ignoreCase, this.copyOptions.ignoreError), destBean);
	}
318025
@Override
    @SuppressWarnings("unchecked")
    public P get(Bean bean) {
        if (style().isReadable() == false) {
            throw new UnsupportedOperationException("Property cannot be read: " + name());
        }
        try {
            return (P) getMethod.invoke(bean, (Object[]) null);
        } catch (IllegalArgumentException | IllegalAccessException ex) {
            throw new UnsupportedOperationException("Property cannot be read: " + name(), ex);
        } catch (InvocationTargetException ex) {
            if (ex.getCause() instanceof RuntimeException) {
                throw (RuntimeException) ex.getCause();
            }
            throw new RuntimeException(ex);
        }
    }
195518
function send(data) {
                verifyState(this);

                if (!/^(get|head)$/i.test(this.method)) {
                    var contentType = getHeader(this.requestHeaders, "Content-Type");
                    if (this.requestHeaders[contentType]) {
                        var value = this.requestHeaders[contentType].split(";");
                        this.requestHeaders[contentType] = value[0] + ";charset=utf-8";
                    } else if (!(data instanceof FormData)) {
                        this.requestHeaders["Content-Type"] = "text/plain;charset=utf-8";
                    }

                    this.requestBody = data;
                }

                this.errorFlag = false;
                this.sendFlag = this.async;
                this.readyStateChange(FakeXMLHttpRequest.OPENED);

                if (typeof this.onSend == "function") {
                    this.onSend(this);
                }

                this.dispatchEvent(new sinon.Event("loadstart", false, false, this));
            }
1047739
function (value, sendUpdatedEvt) {
			
			var a, firstVal, secondVal, i;
			
			a = value.split(this.options.valueSeparator);
			
			this.selects[0].setValue(a[0], false);
			this.updateSecondSelectChoices();
			this.selects[1].setValue(a[1], false);
			
			// Call Field.setValue to set class and fire updated event
			inputEx.SelectTwiceField.superclass.setValue.call(this, value, sendUpdatedEvt);
		}
242462
public int doEndTag() throws JspException
    {
        if (hasErrors())
            return reportAndExit(EVAL_PAGE);

        String idScript = null;

        // Create an appropriate "form" element based on our parameters
        HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
        ServletContext servletContext = pageContext.getServletContext();

        // if we have an Id or a tag is forcing the name, then set the state and generate
        // the JavaScript
        if (_state.id != null || _setRealName) {
            String id = _state.id;
            _state.name = _realName;
            _state.id = _realName;
            idScript = renderNameAndId(request, id);
        }

        if (_state.method == null)
            _state.method = FORM_POST;

        // Encode the action
        // If the rewritten form action contains request parameters, turn them into hidden fields --
        // it's not legal to include them in the action URI on a GET.
        HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();

        if (_actionUrl != null) {
            _state.action = response.encodeURL(_actionUrl);
        }

        WriteRenderAppender writer = new WriteRenderAppender(pageContext);
        TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.FORM_TAG, request);
        br.doStartTag(writer, _state);

        // If the action we're submitting to is checking for double-submits, save a token in the session.
        // This will be written out as a hidden param (below), and will be checked in PageFlowRequestProcessor.
        String token = PageFlowTagUtils.getToken(request, _mapping);

        // Add a transaction token (if present in our session)
        HttpSession session = pageContext.getSession();
        if (session != null) {
            if (token == null) {
                token = (String) session.getAttribute(Globals.TRANSACTION_TOKEN_KEY);
            }
            if (token != null) {
                String name = URLRewriterService.getNamePrefix(servletContext, request, Constants.TOKEN_KEY)
                              + Constants.TOKEN_KEY;
                writeHiddenParam(name, token, writer, request, true);
            }
        }

        // add a hidden value for each parameter
        if (_params != null) {
            Iterator paramKeys = _params.keySet().iterator();
            while (paramKeys.hasNext()) {
                Object paramKey = paramKeys.next();
                Object paramValue = _params.get(paramKey);
                if (paramValue instanceof String[]) {
                    String[] paramValArray = (String[]) paramValue;
                    for (int i = 0; i < paramValArray.length; i++) {
                        String name = paramKey.toString();
                        String paramName = URLRewriterService.getNamePrefix(servletContext, request, name) + name;
                        writeHiddenParam(paramName, paramValArray[i], writer, request, true);
                    }
                }
                else {
                    String name = paramKey.toString();
                    String paramName = URLRewriterService.getNamePrefix(servletContext, request, name) + name;
                    writeHiddenParam(paramName, paramValue.toString(), writer, request, true);
                }
            }
        }

        // add the extra hidden parameters
        if (_extraHiddenParams != null && _extraHiddenParams.size() > 0) {
            for (Iterator i = _extraHiddenParams.keySet().iterator(); i.hasNext();) {
                String name = (String) i.next();
                for (Iterator j = ((List)_extraHiddenParams.get(name)).iterator(); j.hasNext();) {
                    String value = (String) j.next();
                    writeHiddenParam(name, value, writer, request, true);
                }
            }
        }

        // add the body content
        if (_text != null)
            write(_text);

        // Remove the page scope attributes we created
        pageContext.removeAttribute(Constants.BEAN_KEY, PageContext.REQUEST_SCOPE);
        pageContext.removeAttribute(Constants.FORM_KEY, PageContext.REQUEST_SCOPE);
        ImplicitObjectUtil.unloadActionForm(pageContext);

        // Render a tag representing the end of our current form
        br.doEndTag(writer);

        // Render JavaScript to set the input focus if required
        if ((_focus != null) && (_focusMap != null)) {
            String focusName = (String) _focusMap.get(_focus);

            if (focusName != null) {
                String formName = _realName;
                ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request);
                srs.writeFeature(getScriptReporter(), writer, CoreScriptFeature.SET_FOCUS, false, true,
                        new Object[]{formName, focusName});
            }
        }

        if (_formSubmit) {
            ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request);
            srs.writeFeature(getScriptReporter(), writer, CoreScriptFeature.ANCHOR_SUBMIT, true, false, null);
        }

        // output any generated javascript
        if (idScript != null)
            write(idScript);

        localRelease();
        return EVAL_PAGE;
    }
1353495
public void onModuleLoad() {
        final Button sendButton = new Button( "Send" );
        final TextBox nameField = new TextBox();
        nameField.setText( "GWT User" );
        final Label errorLabel = new Label();

        // We can add style names to widgets
        sendButton.addStyleName( "sendButton" );

        // Add the nameField and sendButton to the RootPanel
        // Use RootPanel.get() to get the entire body element
        RootPanel.get( "nameFieldContainer" ).add( nameField );
        RootPanel.get( "sendButtonContainer" ).add( sendButton );
        RootPanel.get( "errorLabelContainer" ).add( errorLabel );

        // Focus the cursor on the name field when the app loads
        nameField.setFocus( true );
        nameField.selectAll();

        // Create the popup dialog box
        final DialogBox dialogBox = new DialogBox();
        dialogBox.setText( "Remote Procedure Call" );
        dialogBox.setAnimationEnabled( true );
        final Button closeButton = new Button( "Close" );
        // We can set the id of a widget by accessing its Element
        closeButton.getElement().setId( "closeButton" );
        final Label textToServerLabel = new Label();
        final HTML serverResponseLabel = new HTML();
        VerticalPanel dialogVPanel = new VerticalPanel();
        dialogVPanel.addStyleName( "dialogVPanel" );
        dialogVPanel.add( new HTML( "<b>Sending name to the server:</b>" ) );
        dialogVPanel.add( textToServerLabel );
        dialogVPanel.add( new HTML( "<br><b>Server replies:</b>" ) );
        dialogVPanel.add( serverResponseLabel );
        dialogVPanel.setHorizontalAlignment( VerticalPanel.ALIGN_RIGHT );
        dialogVPanel.add( closeButton );
        dialogBox.setWidget( dialogVPanel );

        // Add a handler to close the DialogBox
        closeButton.addClickHandler( new ClickHandler() {
            public void onClick( ClickEvent event ) {
                dialogBox.hide();
                sendButton.setEnabled( true );
                sendButton.setFocus( true );
            }
        } );

        // Create a handler for the sendButton and nameField
        class MyHandler implements ClickHandler, KeyUpHandler {

            /**
             * Fired when the user clicks on the sendButton.
             */
            public void onClick( ClickEvent event ) {
                sendNameToServer();
            }

            /**
             * Fired when the user types in the nameField.
             */
            public void onKeyUp( KeyUpEvent event ) {
                if ( event.getNativeKeyCode() == KeyCodes.KEY_ENTER ) {
                    sendNameToServer();
                }
            }

            /**
             * Send the name from the nameField to the server and wait for a response.
             */
            private void sendNameToServer() {
                // First, we validate the input.
                errorLabel.setText( "" );
                String textToServer = nameField.getText();
                if ( !FieldVerifier.isValidName( textToServer ) ) {
                    errorLabel.setText( "Please enter at least four characters" );
                    return;
                }

                // Then, we send the input to the server.
                sendButton.setEnabled( false );
                textToServerLabel.setText( textToServer );
                serverResponseLabel.setText( "" );

                ginjector.getRestDispatch().execute( ginjector.getHelloRestService()
                        .greet( new GreetingRequest( textToServer ) ), new RestCallback<GreetingResponse>() {

                    private Response response;

                    @Override
                    public void setResponse( Response response ) {
                        this.response = response;
                    }

                    @Override
                    public void onFailure( Throwable caught ) {
                        // Show the RPC error message to the user
                        dialogBox.setText( "Remote Procedure Call - Failure" );
                        serverResponseLabel.addStyleName( "serverResponseLabelError" );
                        if ( null == response ) {
                            serverResponseLabel.setHTML( SERVER_ERROR );
                        } else {
                            serverResponseLabel.setHTML( new SafeHtmlBuilder().appendEscaped( Integer.toString( response.getStatusCode() ) )
                                    .appendEscaped( " : " ).appendEscaped( response.getStatusText() ).toSafeHtml() );
                        }
                        dialogBox.center();
                        closeButton.setFocus( true );
                    }

                    @Override
                    public void onSuccess( GreetingResponse result ) {
                        dialogBox.setText( "Remote Procedure Call" );
                        serverResponseLabel.removeStyleName( "serverResponseLabelError" );
                        serverResponseLabel.setHTML( new SafeHtmlBuilder().appendEscaped( result.getGreeting() )
                                .appendHtmlConstant( "<br><br>I am running " ).appendEscaped( result.getServerInfo() )
                                .appendHtmlConstant( ".<br><br>It looks like you are using:<br>" ).appendEscaped( result.getUserAgent() )
                                .toSafeHtml() );
                        dialogBox.center();
                        closeButton.setFocus( true );
                    }
                } );
            }
        }

        // Add a handler to send the name to the server
        MyHandler handler = new MyHandler();
        sendButton.addClickHandler( handler );
        nameField.addKeyUpHandler( handler );
    }
1145448
@SuppressWarnings("unused")
    final void handleHeaderValue(ByteBuffer buffer, ParseState state, HttpServerExchange builder) throws BadRequestException {
        HttpString headerName = state.nextHeader;
        StringBuilder stringBuilder = state.stringBuilder;
        CacheMap<HttpString, String> headerValuesCache = state.headerValuesCache;
        if (headerName != null && stringBuilder.length() == 0 && headerValuesCache != null) {
            String existing = headerValuesCache.get(headerName);
            if (existing != null) {
                if (handleCachedHeader(existing, buffer, state, builder)) {
                    return;
                }
            }
        }

        handleHeaderValueCacheMiss(buffer, state, builder, headerName, headerValuesCache, stringBuilder);
    }
894264
@Override
  public synchronized void accept(final double value) {
    super.accept(value);
    final double squareValue = value * value;
    simpleSumOfSquare += squareValue;
    sumOfSquareWithCompensation(squareValue);
  }
842096
@Override
    public Object put(String name, Object value) throws IllegalArgumentException, ClassCastException {
        if (bean != null) {
            Object oldValue = get(name);
            BeanInvoker invoker = getWriteInvoker(name);
            if (invoker == null) {
                return null;
            }
            try {
                if (value instanceof BeanMap) {
                    value = ((BeanMap) value).bean;
                }

                invoker.invoke(value);

                Object newValue = get(name);
                firePropertyChange(name, oldValue, newValue);
            } catch (Throwable e) {
                throw new IllegalArgumentException(e.getMessage());
            }
            return oldValue;
        }
        return null;
    }
557261
public static final Object getValue(Object bean, String property)
    {
        return doFor(bean, property, null, BeanHelper::getValue, BeanHelper::getValue, BeanHelper::getFieldValue, BeanHelper::getMethodValue);
    }
762388
@Override
	public void invoke(IN value) {
		try {
			byte[] msg = schema.serialize(value);

			if (publishOptions == null) {
				channel.basicPublish("", queueName, null, msg);
			} else {
				boolean mandatory = publishOptions.computeMandatory(value);
				boolean immediate = publishOptions.computeImmediate(value);

				Preconditions.checkState(!(returnListener == null && (mandatory || immediate)),
					"Setting mandatory and/or immediate flags to true requires a ReturnListener.");

				String rk = publishOptions.computeRoutingKey(value);
				String exchange = publishOptions.computeExchange(value);

				channel.basicPublish(exchange, rk, mandatory, immediate,
					publishOptions.computeProperties(value), msg);
			}
		} catch (IOException e) {
			if (logFailuresOnly) {
				LOG.error("Cannot send RMQ message {} at {}", queueName, rmqConnectionConfig.getHost(), e);
			} else {
				throw new RuntimeException("Cannot send RMQ message " + queueName + " at " + rmqConnectionConfig.getHost(), e);
			}
		}

	}
968381
public void value(AjaxRequestTarget ajaxRequestTarget, int value)
	{
		ajaxRequestTarget.appendJavaScript(this.value(value).render().toString());
	}