Example usage for java.lang Boolean Boolean

List of usage examples for java.lang Boolean Boolean

Introduction

In this page you can find the example usage for java.lang Boolean Boolean.

Prototype

@Deprecated(since = "9")
public Boolean(String s) 

Source Link

Document

Allocates a Boolean object representing the value true if the string argument is not null and is equal, ignoring case, to the string "true" .

Usage

From source file:com.sun.faces.taglib.html_basic.InputTextTag.java

protected void setProperties(UIComponent component) {
    super.setProperties(component);
    UIInput input = null;/*from w ww  .ja v a  2  s. co  m*/
    try {
        input = (UIInput) component;
    } catch (ClassCastException cce) {
        throw new IllegalStateException("Component " + component.toString()
                + " not expected type.  Expected: UIInput.  Perhaps you're missing a tag?");
    }

    if (converter != null) {
        if (isValueReference(converter)) {
            ValueBinding vb = Util.getValueBinding(converter);
            input.setValueBinding("converter", vb);
        } else {
            Converter _converter = FacesContext.getCurrentInstance().getApplication()
                    .createConverter(converter);
            input.setConverter(_converter);
        }
    }

    if (immediate != null) {
        if (isValueReference(immediate)) {
            ValueBinding vb = Util.getValueBinding(immediate);
            input.setValueBinding("immediate", vb);
        } else {
            boolean _immediate = new Boolean(immediate).booleanValue();
            input.setImmediate(_immediate);
        }
    }
    if (required != null) {
        if (isValueReference(required)) {
            ValueBinding vb = Util.getValueBinding(required);
            input.setValueBinding("required", vb);
        } else {
            boolean _required = new Boolean(required).booleanValue();
            input.setRequired(_required);
        }
    }
    if (validator != null) {
        if (isValueReference(validator)) {
            Class args[] = { FacesContext.class, UIComponent.class, Object.class };
            MethodBinding vb = FacesContext.getCurrentInstance().getApplication().createMethodBinding(validator,
                    args);
            input.setValidator(vb);
        } else {
            Object params[] = { validator };
            throw new javax.faces.FacesException(
                    Util.getExceptionMessageString(Util.INVALID_EXPRESSION_ID, params));
        }
    }
    if (value != null) {
        if (isValueReference(value)) {
            ValueBinding vb = Util.getValueBinding(value);
            input.setValueBinding("value", vb);
        } else {
            input.setValue(value);
        }
    }
    if (valueChangeListener != null) {
        if (isValueReference(valueChangeListener)) {
            Class args[] = { ValueChangeEvent.class };
            MethodBinding vb = FacesContext.getCurrentInstance().getApplication()
                    .createMethodBinding(valueChangeListener, args);
            input.setValueChangeListener(vb);
        } else {
            Object params[] = { valueChangeListener };
            throw new javax.faces.FacesException(
                    Util.getExceptionMessageString(Util.INVALID_EXPRESSION_ID, params));
        }
    }
    if (accesskey != null) {
        if (isValueReference(accesskey)) {
            ValueBinding vb = Util.getValueBinding(accesskey);
            input.setValueBinding("accesskey", vb);
        } else {
            input.getAttributes().put("accesskey", accesskey);
        }
    }
    if (alt != null) {
        if (isValueReference(alt)) {
            ValueBinding vb = Util.getValueBinding(alt);
            input.setValueBinding("alt", vb);
        } else {
            input.getAttributes().put("alt", alt);
        }
    }
    if (dir != null) {
        if (isValueReference(dir)) {
            ValueBinding vb = Util.getValueBinding(dir);
            input.setValueBinding("dir", vb);
        } else {
            input.getAttributes().put("dir", dir);
        }
    }
    if (disabled != null) {
        if (isValueReference(disabled)) {
            ValueBinding vb = Util.getValueBinding(disabled);
            input.setValueBinding("disabled", vb);
        } else {
            boolean _disabled = new Boolean(disabled).booleanValue();
            input.getAttributes().put("disabled", _disabled ? Boolean.TRUE : Boolean.FALSE);
        }
    }
    if (lang != null) {
        if (isValueReference(lang)) {
            ValueBinding vb = Util.getValueBinding(lang);
            input.setValueBinding("lang", vb);
        } else {
            input.getAttributes().put("lang", lang);
        }
    }
    if (maxlength != null) {
        if (isValueReference(maxlength)) {
            ValueBinding vb = Util.getValueBinding(maxlength);
            input.setValueBinding("maxlength", vb);
        } else {
            int _maxlength = new Integer(maxlength).intValue();
            if (_maxlength != Integer.MIN_VALUE) {
                input.getAttributes().put("maxlength", new Integer(_maxlength));
            }
        }
    }
    if (onblur != null) {
        if (isValueReference(onblur)) {
            ValueBinding vb = Util.getValueBinding(onblur);
            input.setValueBinding("onblur", vb);
        } else {
            input.getAttributes().put("onblur", onblur);
        }
    }
    if (onchange != null) {
        if (isValueReference(onchange)) {
            ValueBinding vb = Util.getValueBinding(onchange);
            input.setValueBinding("onchange", vb);
        } else {
            input.getAttributes().put("onchange", onchange);
        }
    }
    if (onclick != null) {
        if (isValueReference(onclick)) {
            ValueBinding vb = Util.getValueBinding(onclick);
            input.setValueBinding("onclick", vb);
        } else {
            input.getAttributes().put("onclick", onclick);
        }
    }
    if (ondblclick != null) {
        if (isValueReference(ondblclick)) {
            ValueBinding vb = Util.getValueBinding(ondblclick);
            input.setValueBinding("ondblclick", vb);
        } else {
            input.getAttributes().put("ondblclick", ondblclick);
        }
    }
    if (onfocus != null) {
        if (isValueReference(onfocus)) {
            ValueBinding vb = Util.getValueBinding(onfocus);
            input.setValueBinding("onfocus", vb);
        } else {
            input.getAttributes().put("onfocus", onfocus);
        }
    }
    if (onkeydown != null) {
        if (isValueReference(onkeydown)) {
            ValueBinding vb = Util.getValueBinding(onkeydown);
            input.setValueBinding("onkeydown", vb);
        } else {
            input.getAttributes().put("onkeydown", onkeydown);
        }
    }
    if (onkeypress != null) {
        if (isValueReference(onkeypress)) {
            ValueBinding vb = Util.getValueBinding(onkeypress);
            input.setValueBinding("onkeypress", vb);
        } else {
            input.getAttributes().put("onkeypress", onkeypress);
        }
    }
    if (onkeyup != null) {
        if (isValueReference(onkeyup)) {
            ValueBinding vb = Util.getValueBinding(onkeyup);
            input.setValueBinding("onkeyup", vb);
        } else {
            input.getAttributes().put("onkeyup", onkeyup);
        }
    }
    if (onmousedown != null) {
        if (isValueReference(onmousedown)) {
            ValueBinding vb = Util.getValueBinding(onmousedown);
            input.setValueBinding("onmousedown", vb);
        } else {
            input.getAttributes().put("onmousedown", onmousedown);
        }
    }
    if (onmousemove != null) {
        if (isValueReference(onmousemove)) {
            ValueBinding vb = Util.getValueBinding(onmousemove);
            input.setValueBinding("onmousemove", vb);
        } else {
            input.getAttributes().put("onmousemove", onmousemove);
        }
    }
    if (onmouseout != null) {
        if (isValueReference(onmouseout)) {
            ValueBinding vb = Util.getValueBinding(onmouseout);
            input.setValueBinding("onmouseout", vb);
        } else {
            input.getAttributes().put("onmouseout", onmouseout);
        }
    }
    if (onmouseover != null) {
        if (isValueReference(onmouseover)) {
            ValueBinding vb = Util.getValueBinding(onmouseover);
            input.setValueBinding("onmouseover", vb);
        } else {
            input.getAttributes().put("onmouseover", onmouseover);
        }
    }
    if (onmouseup != null) {
        if (isValueReference(onmouseup)) {
            ValueBinding vb = Util.getValueBinding(onmouseup);
            input.setValueBinding("onmouseup", vb);
        } else {
            input.getAttributes().put("onmouseup", onmouseup);
        }
    }
    if (onselect != null) {
        if (isValueReference(onselect)) {
            ValueBinding vb = Util.getValueBinding(onselect);
            input.setValueBinding("onselect", vb);
        } else {
            input.getAttributes().put("onselect", onselect);
        }
    }
    if (readonly != null) {
        if (isValueReference(readonly)) {
            ValueBinding vb = Util.getValueBinding(readonly);
            input.setValueBinding("readonly", vb);
        } else {
            boolean _readonly = new Boolean(readonly).booleanValue();
            input.getAttributes().put("readonly", _readonly ? Boolean.TRUE : Boolean.FALSE);
        }
    }
    if (size != null) {
        if (isValueReference(size)) {
            ValueBinding vb = Util.getValueBinding(size);
            input.setValueBinding("size", vb);
        } else {
            int _size = new Integer(size).intValue();
            if (_size != Integer.MIN_VALUE) {
                input.getAttributes().put("size", new Integer(_size));
            }
        }
    }
    if (style != null) {
        if (isValueReference(style)) {
            ValueBinding vb = Util.getValueBinding(style);
            input.setValueBinding("style", vb);
        } else {
            input.getAttributes().put("style", style);
        }
    }
    if (styleClass != null) {
        if (isValueReference(styleClass)) {
            ValueBinding vb = Util.getValueBinding(styleClass);
            input.setValueBinding("styleClass", vb);
        } else {
            input.getAttributes().put("styleClass", styleClass);
        }
    }
    if (tabindex != null) {
        if (isValueReference(tabindex)) {
            ValueBinding vb = Util.getValueBinding(tabindex);
            input.setValueBinding("tabindex", vb);
        } else {
            input.getAttributes().put("tabindex", tabindex);
        }
    }
    if (title != null) {
        if (isValueReference(title)) {
            ValueBinding vb = Util.getValueBinding(title);
            input.setValueBinding("title", vb);
        } else {
            input.getAttributes().put("title", title);
        }
    }
}

From source file:com.sapienter.jbilling.client.payment.PaymentCrudAction.java

@Override
protected ForwardAndMessage doSetup() {
    CreditCardDTO ccDto = null;/*  w ww  .jav  a2s.  co m*/
    AchDTO achDto = null;
    PaymentInfoChequeDTO chequeDto = null;

    boolean isEdit = "edit".equals(request.getParameter("submode"));

    // if an invoice was selected, pre-populate the amount field
    InvoiceDTO invoiceDto = (InvoiceDTO) session.getAttribute(Constants.SESSION_INVOICE_DTO);
    PaymentDTOEx paymentDto = (PaymentDTOEx) session.getAttribute(Constants.SESSION_PAYMENT_DTO);

    if (invoiceDto != null) {
        LOG.debug("setting payment with invoice:" + invoiceDto.getId());

        myForm.set(FIELD_AMOUNT, invoiceDto.getBalance().toString());
        //paypal can't take i18n amounts
        session.setAttribute("jsp_paypay_amount", invoiceDto.getBalance());
        myForm.set(FIELD_CURRENCY, invoiceDto.getCurrency().getId());
    } else if (paymentDto != null) {
        // this works for both refunds and payouts
        LOG.debug("setting form with payment:" + paymentDto.getId());
        myForm.set(FIELD_ID, paymentDto.getId());
        myForm.set(FIELD_AMOUNT, paymentDto.getAmount().toString());
        setFormDate(FIELD_GROUP_DATE, paymentDto.getPaymentDate());
        myForm.set(FIELD_CURRENCY, paymentDto.getCurrency().getId());
        ccDto = paymentDto.getCreditCard();
        achDto = paymentDto.getAch();
        chequeDto = paymentDto.getCheque();
    } else { // this is not an invoice selected, it's the first call
        LOG.debug("setting payment without invoice");
        // the date might come handy
        setFormDate(FIELD_GROUP_DATE, Calendar.getInstance().getTime());
        // make the default real-time
        myForm.set(FIELD_PROCESS_NOW, new Boolean(true));
        // find out if this is a payment or a refund
    }

    boolean isRefund = session.getAttribute("jsp_is_refund") != null;

    // populate the credit card fields with the cc in file
    // if this is a payment creation only
    if (!isRefund && !isEdit && ((String) myForm.get(FIELD_CC_NUMBER)).length() == 0) {
        // normal payment, get the selected user cc
        // if the user has a credit card, put it (this is a waste for
        // cheques, but it really doesn't hurt)
        LOG.debug("getting this user's cc");
        UserDTOEx user = getSessionUser();
        ccDto = user.getCreditCard();
        achDto = user.getAch();
    }

    if (ccDto != null) {
        String ccNumber = ccDto.getNumber();
        // mask cc number
        ccNumber = maskCreditCard(ccNumber);
        myForm.set(FIELD_CC_NUMBER, ccNumber);
        myForm.set(FIELD_CC_NAME, ccDto.getName());
        GregorianCalendar cal = new GregorianCalendar();
        cal.setTime(ccDto.getCcExpiry());
        myForm.set(FIELD_GROUP_CC_EXPIRY + "_month", String.valueOf(cal.get(GregorianCalendar.MONTH) + 1));
        myForm.set(FIELD_GROUP_CC_EXPIRY + "_year", String.valueOf(cal.get(GregorianCalendar.YEAR)));
    }

    if (achDto != null) {
        myForm.set(FIELD_ACH_ABA_CODE, achDto.getAbaRouting());
        myForm.set(FIELD_ACH_ACCOUNT_NUMBER, achDto.getBankAccount());
        myForm.set(FIELD_ACH_BANK_NAME, achDto.getBankName());
        myForm.set(FIELD_ACH_ACCOUNT_NAME, achDto.getAccountName());
        myForm.set(FIELD_ACH_ACCOUNT_TYPE, achDto.getAccountType());
    }

    if (chequeDto != null) {
        myForm.set(FIELD_CHEQUE_BANK, chequeDto.getBank());
        myForm.set(FIELD_CHEQUE_NUMBER, chequeDto.getNumber());
        setFormDate(FIELD_GROUP_CHEQUE_DATE, chequeDto.getDate());
    }

    ForwardAndMessage result = new ForwardAndMessage(FORWARD_EDIT);
    // if this payment is direct from an order, continue with the
    // page without invoice list
    if (request.getParameter("direct") != null) {
        // the date won't be shown, and it has to be initialized
        setFormDate(FIELD_GROUP_DATE, Calendar.getInstance().getTime());
        myForm.set(FIELD_PAY_METHOD, "cc");
        result = new ForwardAndMessage(FORWARD_FROM_ORDER, MESSAGE_INVOICE_GENERATED);
    }

    // if this is a payout, it has its own page
    if (request.getParameter("payout") != null) {
        result = new ForwardAndMessage(FORWARD_PAYOUT);
    }

    // payment edition has a different layout
    if (isEdit) {
        result = new ForwardAndMessage(FORWARD_UPDATE);
    }

    return result;
}

From source file:nz.co.senanque.validationengine.ConvertUtils.java

public static Object getObjectForNull(Class<?> clazz) {
    if (clazz.equals(Long.TYPE)) {
        return new Long(0);
    } else if (clazz.equals(Integer.TYPE)) {
        return new Integer(0);
    } else if (clazz.equals(Float.TYPE)) {
        return new Float(0.0F);
    } else if (clazz.equals(Double.TYPE)) {
        return new Double(0.0D);
    } else if (clazz.equals(Boolean.TYPE)) {
        return new Boolean(false);
    }// ww w  .j  a v  a  2s .  c om
    return null;
}

From source file:edu.uci.ics.jung.utils.PredicateUtils.java

/**
 * Returns a <code>Map</code> of each constituent predicate of <code>p</code>
 * (if any) to the result of evaluating this predicate on <code>o</code>.  
 * If <code>p</code> is a <code>PredicateDecorator</code>, i.e., a predicate
 * that operates on other <code>Predicate</code>s, the output will consist of
 * the results of evaluting the constituents of <code>p</code> on <code>o</code>;
 * otherwise, the output will be the result of evaluating <code>p</code> itself
 * on <code>o</code>./*from w w w. j  a va 2 s  . c om*/
 */
public static Map evaluateNestedPredicates(Predicate p, Object o) {
    Map evaluations = new HashMap();
    if (p instanceof PredicateDecorator) {
        Predicate[] nested_preds = ((PredicateDecorator) p).getPredicates();
        for (int i = 0; i < nested_preds.length; i++)
            evaluations.put(nested_preds[i], new Boolean(nested_preds[i].evaluate(o)));
    } else
        evaluations.put(p, new Boolean(p.evaluate(o)));
    return evaluations;
}

From source file:com.sun.faces.taglib.html_basic.SelectOneListboxTag.java

protected void setProperties(UIComponent component) {
    super.setProperties(component);
    UISelectOne selectone = null;//w  ww .  j a  va 2  s . com
    try {
        selectone = (UISelectOne) component;
    } catch (ClassCastException cce) {
        throw new IllegalStateException("Component " + component.toString()
                + " not expected type.  Expected: UISelectOne.  Perhaps you're missing a tag?");
    }

    if (converter != null) {
        if (isValueReference(converter)) {
            ValueBinding vb = Util.getValueBinding(converter);
            selectone.setValueBinding("converter", vb);
        } else {
            Converter _converter = FacesContext.getCurrentInstance().getApplication()
                    .createConverter(converter);
            selectone.setConverter(_converter);
        }
    }

    if (immediate != null) {
        if (isValueReference(immediate)) {
            ValueBinding vb = Util.getValueBinding(immediate);
            selectone.setValueBinding("immediate", vb);
        } else {
            boolean _immediate = new Boolean(immediate).booleanValue();
            selectone.setImmediate(_immediate);
        }
    }
    if (required != null) {
        if (isValueReference(required)) {
            ValueBinding vb = Util.getValueBinding(required);
            selectone.setValueBinding("required", vb);
        } else {
            boolean _required = new Boolean(required).booleanValue();
            selectone.setRequired(_required);
        }
    }
    if (validator != null) {
        if (isValueReference(validator)) {
            Class args[] = { FacesContext.class, UIComponent.class, Object.class };
            MethodBinding vb = FacesContext.getCurrentInstance().getApplication().createMethodBinding(validator,
                    args);
            selectone.setValidator(vb);
        } else {
            Object params[] = { validator };
            throw new javax.faces.FacesException(
                    Util.getExceptionMessageString(Util.INVALID_EXPRESSION_ID, params));
        }
    }
    if (value != null) {
        if (isValueReference(value)) {
            ValueBinding vb = Util.getValueBinding(value);
            selectone.setValueBinding("value", vb);
        } else {
            selectone.setValue(value);
        }
    }
    if (valueChangeListener != null) {
        if (isValueReference(valueChangeListener)) {
            Class args[] = { ValueChangeEvent.class };
            MethodBinding vb = FacesContext.getCurrentInstance().getApplication()
                    .createMethodBinding(valueChangeListener, args);
            selectone.setValueChangeListener(vb);
        } else {
            Object params[] = { valueChangeListener };
            throw new javax.faces.FacesException(
                    Util.getExceptionMessageString(Util.INVALID_EXPRESSION_ID, params));
        }
    }
    if (accesskey != null) {
        if (isValueReference(accesskey)) {
            ValueBinding vb = Util.getValueBinding(accesskey);
            selectone.setValueBinding("accesskey", vb);
        } else {
            selectone.getAttributes().put("accesskey", accesskey);
        }
    }
    if (dir != null) {
        if (isValueReference(dir)) {
            ValueBinding vb = Util.getValueBinding(dir);
            selectone.setValueBinding("dir", vb);
        } else {
            selectone.getAttributes().put("dir", dir);
        }
    }
    if (disabled != null) {
        if (isValueReference(disabled)) {
            ValueBinding vb = Util.getValueBinding(disabled);
            selectone.setValueBinding("disabled", vb);
        } else {
            boolean _disabled = new Boolean(disabled).booleanValue();
            selectone.getAttributes().put("disabled", _disabled ? Boolean.TRUE : Boolean.FALSE);
        }
    }
    if (disabledClass != null) {
        if (isValueReference(disabledClass)) {
            ValueBinding vb = Util.getValueBinding(disabledClass);
            selectone.setValueBinding("disabledClass", vb);
        } else {
            selectone.getAttributes().put("disabledClass", disabledClass);
        }
    }
    if (enabledClass != null) {
        if (isValueReference(enabledClass)) {
            ValueBinding vb = Util.getValueBinding(enabledClass);
            selectone.setValueBinding("enabledClass", vb);
        } else {
            selectone.getAttributes().put("enabledClass", enabledClass);
        }
    }
    if (lang != null) {
        if (isValueReference(lang)) {
            ValueBinding vb = Util.getValueBinding(lang);
            selectone.setValueBinding("lang", vb);
        } else {
            selectone.getAttributes().put("lang", lang);
        }
    }
    if (onblur != null) {
        if (isValueReference(onblur)) {
            ValueBinding vb = Util.getValueBinding(onblur);
            selectone.setValueBinding("onblur", vb);
        } else {
            selectone.getAttributes().put("onblur", onblur);
        }
    }
    if (onchange != null) {
        if (isValueReference(onchange)) {
            ValueBinding vb = Util.getValueBinding(onchange);
            selectone.setValueBinding("onchange", vb);
        } else {
            selectone.getAttributes().put("onchange", onchange);
        }
    }
    if (onclick != null) {
        if (isValueReference(onclick)) {
            ValueBinding vb = Util.getValueBinding(onclick);
            selectone.setValueBinding("onclick", vb);
        } else {
            selectone.getAttributes().put("onclick", onclick);
        }
    }
    if (ondblclick != null) {
        if (isValueReference(ondblclick)) {
            ValueBinding vb = Util.getValueBinding(ondblclick);
            selectone.setValueBinding("ondblclick", vb);
        } else {
            selectone.getAttributes().put("ondblclick", ondblclick);
        }
    }
    if (onfocus != null) {
        if (isValueReference(onfocus)) {
            ValueBinding vb = Util.getValueBinding(onfocus);
            selectone.setValueBinding("onfocus", vb);
        } else {
            selectone.getAttributes().put("onfocus", onfocus);
        }
    }
    if (onkeydown != null) {
        if (isValueReference(onkeydown)) {
            ValueBinding vb = Util.getValueBinding(onkeydown);
            selectone.setValueBinding("onkeydown", vb);
        } else {
            selectone.getAttributes().put("onkeydown", onkeydown);
        }
    }
    if (onkeypress != null) {
        if (isValueReference(onkeypress)) {
            ValueBinding vb = Util.getValueBinding(onkeypress);
            selectone.setValueBinding("onkeypress", vb);
        } else {
            selectone.getAttributes().put("onkeypress", onkeypress);
        }
    }
    if (onkeyup != null) {
        if (isValueReference(onkeyup)) {
            ValueBinding vb = Util.getValueBinding(onkeyup);
            selectone.setValueBinding("onkeyup", vb);
        } else {
            selectone.getAttributes().put("onkeyup", onkeyup);
        }
    }
    if (onmousedown != null) {
        if (isValueReference(onmousedown)) {
            ValueBinding vb = Util.getValueBinding(onmousedown);
            selectone.setValueBinding("onmousedown", vb);
        } else {
            selectone.getAttributes().put("onmousedown", onmousedown);
        }
    }
    if (onmousemove != null) {
        if (isValueReference(onmousemove)) {
            ValueBinding vb = Util.getValueBinding(onmousemove);
            selectone.setValueBinding("onmousemove", vb);
        } else {
            selectone.getAttributes().put("onmousemove", onmousemove);
        }
    }
    if (onmouseout != null) {
        if (isValueReference(onmouseout)) {
            ValueBinding vb = Util.getValueBinding(onmouseout);
            selectone.setValueBinding("onmouseout", vb);
        } else {
            selectone.getAttributes().put("onmouseout", onmouseout);
        }
    }
    if (onmouseover != null) {
        if (isValueReference(onmouseover)) {
            ValueBinding vb = Util.getValueBinding(onmouseover);
            selectone.setValueBinding("onmouseover", vb);
        } else {
            selectone.getAttributes().put("onmouseover", onmouseover);
        }
    }
    if (onmouseup != null) {
        if (isValueReference(onmouseup)) {
            ValueBinding vb = Util.getValueBinding(onmouseup);
            selectone.setValueBinding("onmouseup", vb);
        } else {
            selectone.getAttributes().put("onmouseup", onmouseup);
        }
    }
    if (onselect != null) {
        if (isValueReference(onselect)) {
            ValueBinding vb = Util.getValueBinding(onselect);
            selectone.setValueBinding("onselect", vb);
        } else {
            selectone.getAttributes().put("onselect", onselect);
        }
    }
    if (readonly != null) {
        if (isValueReference(readonly)) {
            ValueBinding vb = Util.getValueBinding(readonly);
            selectone.setValueBinding("readonly", vb);
        } else {
            boolean _readonly = new Boolean(readonly).booleanValue();
            selectone.getAttributes().put("readonly", _readonly ? Boolean.TRUE : Boolean.FALSE);
        }
    }
    if (size != null) {
        if (isValueReference(size)) {
            ValueBinding vb = Util.getValueBinding(size);
            selectone.setValueBinding("size", vb);
        } else {
            int _size = new Integer(size).intValue();
            if (_size != Integer.MIN_VALUE) {
                selectone.getAttributes().put("size", new Integer(_size));
            }
        }
    }
    if (style != null) {
        if (isValueReference(style)) {
            ValueBinding vb = Util.getValueBinding(style);
            selectone.setValueBinding("style", vb);
        } else {
            selectone.getAttributes().put("style", style);
        }
    }
    if (styleClass != null) {
        if (isValueReference(styleClass)) {
            ValueBinding vb = Util.getValueBinding(styleClass);
            selectone.setValueBinding("styleClass", vb);
        } else {
            selectone.getAttributes().put("styleClass", styleClass);
        }
    }
    if (tabindex != null) {
        if (isValueReference(tabindex)) {
            ValueBinding vb = Util.getValueBinding(tabindex);
            selectone.setValueBinding("tabindex", vb);
        } else {
            selectone.getAttributes().put("tabindex", tabindex);
        }
    }
    if (title != null) {
        if (isValueReference(title)) {
            ValueBinding vb = Util.getValueBinding(title);
            selectone.setValueBinding("title", vb);
        } else {
            selectone.getAttributes().put("title", title);
        }
    }
}

From source file:com.sun.faces.taglib.html_basic.SelectManyListboxTag.java

protected void setProperties(UIComponent component) {
    super.setProperties(component);
    UISelectMany selectmany = null;/*from   ww w.  j  av  a2  s.co m*/
    try {
        selectmany = (UISelectMany) component;
    } catch (ClassCastException cce) {
        throw new IllegalStateException("Component " + component.toString()
                + " not expected type.  Expected: UISelectMany.  Perhaps you're missing a tag?");
    }

    if (converter != null) {
        if (isValueReference(converter)) {
            ValueBinding vb = Util.getValueBinding(converter);
            selectmany.setValueBinding("converter", vb);
        } else {
            Converter _converter = FacesContext.getCurrentInstance().getApplication()
                    .createConverter(converter);
            selectmany.setConverter(_converter);
        }
    }

    if (immediate != null) {
        if (isValueReference(immediate)) {
            ValueBinding vb = Util.getValueBinding(immediate);
            selectmany.setValueBinding("immediate", vb);
        } else {
            boolean _immediate = new Boolean(immediate).booleanValue();
            selectmany.setImmediate(_immediate);
        }
    }
    if (required != null) {
        if (isValueReference(required)) {
            ValueBinding vb = Util.getValueBinding(required);
            selectmany.setValueBinding("required", vb);
        } else {
            boolean _required = new Boolean(required).booleanValue();
            selectmany.setRequired(_required);
        }
    }
    if (validator != null) {
        if (isValueReference(validator)) {
            Class args[] = { FacesContext.class, UIComponent.class, Object.class };
            MethodBinding vb = FacesContext.getCurrentInstance().getApplication().createMethodBinding(validator,
                    args);
            selectmany.setValidator(vb);
        } else {
            Object params[] = { validator };
            throw new javax.faces.FacesException(
                    Util.getExceptionMessageString(Util.INVALID_EXPRESSION_ID, params));
        }
    }
    if (value != null) {
        if (isValueReference(value)) {
            ValueBinding vb = Util.getValueBinding(value);
            selectmany.setValueBinding("value", vb);
        } else {
            selectmany.setValue(value);
        }
    }
    if (valueChangeListener != null) {
        if (isValueReference(valueChangeListener)) {
            Class args[] = { ValueChangeEvent.class };
            MethodBinding vb = FacesContext.getCurrentInstance().getApplication()
                    .createMethodBinding(valueChangeListener, args);
            selectmany.setValueChangeListener(vb);
        } else {
            Object params[] = { valueChangeListener };
            throw new javax.faces.FacesException(
                    Util.getExceptionMessageString(Util.INVALID_EXPRESSION_ID, params));
        }
    }
    if (accesskey != null) {
        if (isValueReference(accesskey)) {
            ValueBinding vb = Util.getValueBinding(accesskey);
            selectmany.setValueBinding("accesskey", vb);
        } else {
            selectmany.getAttributes().put("accesskey", accesskey);
        }
    }
    if (dir != null) {
        if (isValueReference(dir)) {
            ValueBinding vb = Util.getValueBinding(dir);
            selectmany.setValueBinding("dir", vb);
        } else {
            selectmany.getAttributes().put("dir", dir);
        }
    }
    if (disabled != null) {
        if (isValueReference(disabled)) {
            ValueBinding vb = Util.getValueBinding(disabled);
            selectmany.setValueBinding("disabled", vb);
        } else {
            boolean _disabled = new Boolean(disabled).booleanValue();
            selectmany.getAttributes().put("disabled", _disabled ? Boolean.TRUE : Boolean.FALSE);
        }
    }
    if (disabledClass != null) {
        if (isValueReference(disabledClass)) {
            ValueBinding vb = Util.getValueBinding(disabledClass);
            selectmany.setValueBinding("disabledClass", vb);
        } else {
            selectmany.getAttributes().put("disabledClass", disabledClass);
        }
    }
    if (enabledClass != null) {
        if (isValueReference(enabledClass)) {
            ValueBinding vb = Util.getValueBinding(enabledClass);
            selectmany.setValueBinding("enabledClass", vb);
        } else {
            selectmany.getAttributes().put("enabledClass", enabledClass);
        }
    }
    if (lang != null) {
        if (isValueReference(lang)) {
            ValueBinding vb = Util.getValueBinding(lang);
            selectmany.setValueBinding("lang", vb);
        } else {
            selectmany.getAttributes().put("lang", lang);
        }
    }
    if (onblur != null) {
        if (isValueReference(onblur)) {
            ValueBinding vb = Util.getValueBinding(onblur);
            selectmany.setValueBinding("onblur", vb);
        } else {
            selectmany.getAttributes().put("onblur", onblur);
        }
    }
    if (onchange != null) {
        if (isValueReference(onchange)) {
            ValueBinding vb = Util.getValueBinding(onchange);
            selectmany.setValueBinding("onchange", vb);
        } else {
            selectmany.getAttributes().put("onchange", onchange);
        }
    }
    if (onclick != null) {
        if (isValueReference(onclick)) {
            ValueBinding vb = Util.getValueBinding(onclick);
            selectmany.setValueBinding("onclick", vb);
        } else {
            selectmany.getAttributes().put("onclick", onclick);
        }
    }
    if (ondblclick != null) {
        if (isValueReference(ondblclick)) {
            ValueBinding vb = Util.getValueBinding(ondblclick);
            selectmany.setValueBinding("ondblclick", vb);
        } else {
            selectmany.getAttributes().put("ondblclick", ondblclick);
        }
    }
    if (onfocus != null) {
        if (isValueReference(onfocus)) {
            ValueBinding vb = Util.getValueBinding(onfocus);
            selectmany.setValueBinding("onfocus", vb);
        } else {
            selectmany.getAttributes().put("onfocus", onfocus);
        }
    }
    if (onkeydown != null) {
        if (isValueReference(onkeydown)) {
            ValueBinding vb = Util.getValueBinding(onkeydown);
            selectmany.setValueBinding("onkeydown", vb);
        } else {
            selectmany.getAttributes().put("onkeydown", onkeydown);
        }
    }
    if (onkeypress != null) {
        if (isValueReference(onkeypress)) {
            ValueBinding vb = Util.getValueBinding(onkeypress);
            selectmany.setValueBinding("onkeypress", vb);
        } else {
            selectmany.getAttributes().put("onkeypress", onkeypress);
        }
    }
    if (onkeyup != null) {
        if (isValueReference(onkeyup)) {
            ValueBinding vb = Util.getValueBinding(onkeyup);
            selectmany.setValueBinding("onkeyup", vb);
        } else {
            selectmany.getAttributes().put("onkeyup", onkeyup);
        }
    }
    if (onmousedown != null) {
        if (isValueReference(onmousedown)) {
            ValueBinding vb = Util.getValueBinding(onmousedown);
            selectmany.setValueBinding("onmousedown", vb);
        } else {
            selectmany.getAttributes().put("onmousedown", onmousedown);
        }
    }
    if (onmousemove != null) {
        if (isValueReference(onmousemove)) {
            ValueBinding vb = Util.getValueBinding(onmousemove);
            selectmany.setValueBinding("onmousemove", vb);
        } else {
            selectmany.getAttributes().put("onmousemove", onmousemove);
        }
    }
    if (onmouseout != null) {
        if (isValueReference(onmouseout)) {
            ValueBinding vb = Util.getValueBinding(onmouseout);
            selectmany.setValueBinding("onmouseout", vb);
        } else {
            selectmany.getAttributes().put("onmouseout", onmouseout);
        }
    }
    if (onmouseover != null) {
        if (isValueReference(onmouseover)) {
            ValueBinding vb = Util.getValueBinding(onmouseover);
            selectmany.setValueBinding("onmouseover", vb);
        } else {
            selectmany.getAttributes().put("onmouseover", onmouseover);
        }
    }
    if (onmouseup != null) {
        if (isValueReference(onmouseup)) {
            ValueBinding vb = Util.getValueBinding(onmouseup);
            selectmany.setValueBinding("onmouseup", vb);
        } else {
            selectmany.getAttributes().put("onmouseup", onmouseup);
        }
    }
    if (onselect != null) {
        if (isValueReference(onselect)) {
            ValueBinding vb = Util.getValueBinding(onselect);
            selectmany.setValueBinding("onselect", vb);
        } else {
            selectmany.getAttributes().put("onselect", onselect);
        }
    }
    if (readonly != null) {
        if (isValueReference(readonly)) {
            ValueBinding vb = Util.getValueBinding(readonly);
            selectmany.setValueBinding("readonly", vb);
        } else {
            boolean _readonly = new Boolean(readonly).booleanValue();
            selectmany.getAttributes().put("readonly", _readonly ? Boolean.TRUE : Boolean.FALSE);
        }
    }
    if (size != null) {
        if (isValueReference(size)) {
            ValueBinding vb = Util.getValueBinding(size);
            selectmany.setValueBinding("size", vb);
        } else {
            int _size = new Integer(size).intValue();
            if (_size != Integer.MIN_VALUE) {
                selectmany.getAttributes().put("size", new Integer(_size));
            }
        }
    }
    if (style != null) {
        if (isValueReference(style)) {
            ValueBinding vb = Util.getValueBinding(style);
            selectmany.setValueBinding("style", vb);
        } else {
            selectmany.getAttributes().put("style", style);
        }
    }
    if (styleClass != null) {
        if (isValueReference(styleClass)) {
            ValueBinding vb = Util.getValueBinding(styleClass);
            selectmany.setValueBinding("styleClass", vb);
        } else {
            selectmany.getAttributes().put("styleClass", styleClass);
        }
    }
    if (tabindex != null) {
        if (isValueReference(tabindex)) {
            ValueBinding vb = Util.getValueBinding(tabindex);
            selectmany.setValueBinding("tabindex", vb);
        } else {
            selectmany.getAttributes().put("tabindex", tabindex);
        }
    }
    if (title != null) {
        if (isValueReference(title)) {
            ValueBinding vb = Util.getValueBinding(title);
            selectmany.setValueBinding("title", vb);
        } else {
            selectmany.getAttributes().put("title", title);
        }
    }
}

From source file:com.sun.faces.taglib.html_basic.InputSecretTag.java

protected void setProperties(UIComponent component) {
    super.setProperties(component);
    UIInput input = null;//from w  w  w .  ja  v  a  2 s .  com
    try {
        input = (UIInput) component;
    } catch (ClassCastException cce) {
        throw new IllegalStateException("Component " + component.toString()
                + " not expected type.  Expected: UIInput.  Perhaps you're missing a tag?");
    }

    if (converter != null) {
        if (isValueReference(converter)) {
            ValueBinding vb = Util.getValueBinding(converter);
            input.setValueBinding("converter", vb);
        } else {
            Converter _converter = FacesContext.getCurrentInstance().getApplication()
                    .createConverter(converter);
            input.setConverter(_converter);
        }
    }

    if (immediate != null) {
        if (isValueReference(immediate)) {
            ValueBinding vb = Util.getValueBinding(immediate);
            input.setValueBinding("immediate", vb);
        } else {
            boolean _immediate = new Boolean(immediate).booleanValue();
            input.setImmediate(_immediate);
        }
    }
    if (required != null) {
        if (isValueReference(required)) {
            ValueBinding vb = Util.getValueBinding(required);
            input.setValueBinding("required", vb);
        } else {
            boolean _required = new Boolean(required).booleanValue();
            input.setRequired(_required);
        }
    }
    if (validator != null) {
        if (isValueReference(validator)) {
            Class args[] = { FacesContext.class, UIComponent.class, Object.class };
            MethodBinding vb = FacesContext.getCurrentInstance().getApplication().createMethodBinding(validator,
                    args);
            input.setValidator(vb);
        } else {
            Object params[] = { validator };
            throw new javax.faces.FacesException(
                    Util.getExceptionMessageString(Util.INVALID_EXPRESSION_ID, params));
        }
    }
    if (value != null) {
        if (isValueReference(value)) {
            ValueBinding vb = Util.getValueBinding(value);
            input.setValueBinding("value", vb);
        } else {
            input.setValue(value);
        }
    }
    if (valueChangeListener != null) {
        if (isValueReference(valueChangeListener)) {
            Class args[] = { ValueChangeEvent.class };
            MethodBinding vb = FacesContext.getCurrentInstance().getApplication()
                    .createMethodBinding(valueChangeListener, args);
            input.setValueChangeListener(vb);
        } else {
            Object params[] = { valueChangeListener };
            throw new javax.faces.FacesException(
                    Util.getExceptionMessageString(Util.INVALID_EXPRESSION_ID, params));
        }
    }
    if (accesskey != null) {
        if (isValueReference(accesskey)) {
            ValueBinding vb = Util.getValueBinding(accesskey);
            input.setValueBinding("accesskey", vb);
        } else {
            input.getAttributes().put("accesskey", accesskey);
        }
    }
    if (alt != null) {
        if (isValueReference(alt)) {
            ValueBinding vb = Util.getValueBinding(alt);
            input.setValueBinding("alt", vb);
        } else {
            input.getAttributes().put("alt", alt);
        }
    }
    if (dir != null) {
        if (isValueReference(dir)) {
            ValueBinding vb = Util.getValueBinding(dir);
            input.setValueBinding("dir", vb);
        } else {
            input.getAttributes().put("dir", dir);
        }
    }
    if (disabled != null) {
        if (isValueReference(disabled)) {
            ValueBinding vb = Util.getValueBinding(disabled);
            input.setValueBinding("disabled", vb);
        } else {
            boolean _disabled = new Boolean(disabled).booleanValue();
            input.getAttributes().put("disabled", _disabled ? Boolean.TRUE : Boolean.FALSE);
        }
    }
    if (lang != null) {
        if (isValueReference(lang)) {
            ValueBinding vb = Util.getValueBinding(lang);
            input.setValueBinding("lang", vb);
        } else {
            input.getAttributes().put("lang", lang);
        }
    }
    if (maxlength != null) {
        if (isValueReference(maxlength)) {
            ValueBinding vb = Util.getValueBinding(maxlength);
            input.setValueBinding("maxlength", vb);
        } else {
            int _maxlength = new Integer(maxlength).intValue();
            if (_maxlength != Integer.MIN_VALUE) {
                input.getAttributes().put("maxlength", new Integer(_maxlength));
            }
        }
    }
    if (onblur != null) {
        if (isValueReference(onblur)) {
            ValueBinding vb = Util.getValueBinding(onblur);
            input.setValueBinding("onblur", vb);
        } else {
            input.getAttributes().put("onblur", onblur);
        }
    }
    if (onchange != null) {
        if (isValueReference(onchange)) {
            ValueBinding vb = Util.getValueBinding(onchange);
            input.setValueBinding("onchange", vb);
        } else {
            input.getAttributes().put("onchange", onchange);
        }
    }
    if (onclick != null) {
        if (isValueReference(onclick)) {
            ValueBinding vb = Util.getValueBinding(onclick);
            input.setValueBinding("onclick", vb);
        } else {
            input.getAttributes().put("onclick", onclick);
        }
    }
    if (ondblclick != null) {
        if (isValueReference(ondblclick)) {
            ValueBinding vb = Util.getValueBinding(ondblclick);
            input.setValueBinding("ondblclick", vb);
        } else {
            input.getAttributes().put("ondblclick", ondblclick);
        }
    }
    if (onfocus != null) {
        if (isValueReference(onfocus)) {
            ValueBinding vb = Util.getValueBinding(onfocus);
            input.setValueBinding("onfocus", vb);
        } else {
            input.getAttributes().put("onfocus", onfocus);
        }
    }
    if (onkeydown != null) {
        if (isValueReference(onkeydown)) {
            ValueBinding vb = Util.getValueBinding(onkeydown);
            input.setValueBinding("onkeydown", vb);
        } else {
            input.getAttributes().put("onkeydown", onkeydown);
        }
    }
    if (onkeypress != null) {
        if (isValueReference(onkeypress)) {
            ValueBinding vb = Util.getValueBinding(onkeypress);
            input.setValueBinding("onkeypress", vb);
        } else {
            input.getAttributes().put("onkeypress", onkeypress);
        }
    }
    if (onkeyup != null) {
        if (isValueReference(onkeyup)) {
            ValueBinding vb = Util.getValueBinding(onkeyup);
            input.setValueBinding("onkeyup", vb);
        } else {
            input.getAttributes().put("onkeyup", onkeyup);
        }
    }
    if (onmousedown != null) {
        if (isValueReference(onmousedown)) {
            ValueBinding vb = Util.getValueBinding(onmousedown);
            input.setValueBinding("onmousedown", vb);
        } else {
            input.getAttributes().put("onmousedown", onmousedown);
        }
    }
    if (onmousemove != null) {
        if (isValueReference(onmousemove)) {
            ValueBinding vb = Util.getValueBinding(onmousemove);
            input.setValueBinding("onmousemove", vb);
        } else {
            input.getAttributes().put("onmousemove", onmousemove);
        }
    }
    if (onmouseout != null) {
        if (isValueReference(onmouseout)) {
            ValueBinding vb = Util.getValueBinding(onmouseout);
            input.setValueBinding("onmouseout", vb);
        } else {
            input.getAttributes().put("onmouseout", onmouseout);
        }
    }
    if (onmouseover != null) {
        if (isValueReference(onmouseover)) {
            ValueBinding vb = Util.getValueBinding(onmouseover);
            input.setValueBinding("onmouseover", vb);
        } else {
            input.getAttributes().put("onmouseover", onmouseover);
        }
    }
    if (onmouseup != null) {
        if (isValueReference(onmouseup)) {
            ValueBinding vb = Util.getValueBinding(onmouseup);
            input.setValueBinding("onmouseup", vb);
        } else {
            input.getAttributes().put("onmouseup", onmouseup);
        }
    }
    if (onselect != null) {
        if (isValueReference(onselect)) {
            ValueBinding vb = Util.getValueBinding(onselect);
            input.setValueBinding("onselect", vb);
        } else {
            input.getAttributes().put("onselect", onselect);
        }
    }
    if (readonly != null) {
        if (isValueReference(readonly)) {
            ValueBinding vb = Util.getValueBinding(readonly);
            input.setValueBinding("readonly", vb);
        } else {
            boolean _readonly = new Boolean(readonly).booleanValue();
            input.getAttributes().put("readonly", _readonly ? Boolean.TRUE : Boolean.FALSE);
        }
    }
    if (redisplay != null) {
        if (isValueReference(redisplay)) {
            ValueBinding vb = Util.getValueBinding(redisplay);
            input.setValueBinding("redisplay", vb);
        } else {
            boolean _redisplay = new Boolean(redisplay).booleanValue();
            input.getAttributes().put("redisplay", _redisplay ? Boolean.TRUE : Boolean.FALSE);
        }
    }
    if (size != null) {
        if (isValueReference(size)) {
            ValueBinding vb = Util.getValueBinding(size);
            input.setValueBinding("size", vb);
        } else {
            int _size = new Integer(size).intValue();
            if (_size != Integer.MIN_VALUE) {
                input.getAttributes().put("size", new Integer(_size));
            }
        }
    }
    if (style != null) {
        if (isValueReference(style)) {
            ValueBinding vb = Util.getValueBinding(style);
            input.setValueBinding("style", vb);
        } else {
            input.getAttributes().put("style", style);
        }
    }
    if (styleClass != null) {
        if (isValueReference(styleClass)) {
            ValueBinding vb = Util.getValueBinding(styleClass);
            input.setValueBinding("styleClass", vb);
        } else {
            input.getAttributes().put("styleClass", styleClass);
        }
    }
    if (tabindex != null) {
        if (isValueReference(tabindex)) {
            ValueBinding vb = Util.getValueBinding(tabindex);
            input.setValueBinding("tabindex", vb);
        } else {
            input.getAttributes().put("tabindex", tabindex);
        }
    }
    if (title != null) {
        if (isValueReference(title)) {
            ValueBinding vb = Util.getValueBinding(title);
            input.setValueBinding("title", vb);
        } else {
            input.getAttributes().put("title", title);
        }
    }
}

From source file:gov.nih.nci.cabig.caaers2adeers.track.Tracker.java

private void captureLogDetails(Exchange exchange, IntegrationLog integrationLog) {
    if (caputureLogDetails) {
        //Check for soap fault
        String faultString = XPathBuilder.xpath("//faultstring/text()").evaluate(exchange, String.class);
        if (!StringUtils.isBlank(faultString)) {
            integrationLog.setNotes(SOAP_FAULT_STATUS);
            integrationLog.addIntegrationLogDetail(new IntegrationLogDetail(null, faultString, true));
        }/*from   w w w.j  av a2  s. c  o m*/

        //check for caaers error message in response
        String errorString = XPathBuilder.xpath("//error/text()").evaluate(exchange, String.class);
        if (!StringUtils.isBlank(errorString)) {
            integrationLog.setNotes(CAAERS_RESPONSE_ERROR);
            integrationLog.addIntegrationLogDetail(new IntegrationLogDetail(null, errorString, true));
        }

        //check for 'com:entityProcessingOutcomes'
        NodeList nodes = XPathBuilder.xpath("//com:entityProcessingOutcomes")
                .namespace("com", "http://schema.integration.caaers.cabig.nci.nih.gov/common").nodeResult()
                .evaluate(exchange, NodeList.class);

        if (nodes != null) {

            for (int i = 0; i < nodes.getLength(); i++) {
                Node outcome = nodes.item(i);
                if (StringUtils.equals(outcome.getLocalName(), "entityProcessingOutcome")) {
                    NodeList children = outcome.getChildNodes();
                    String businessIdentifier = null;
                    String outcomeMsg = null;
                    boolean failed = false;
                    for (int j = 0; j < children.getLength(); j++) {
                        Node child = children.item(j);
                        String childLocalName = child.getLocalName();
                        if (!StringUtils.isBlank(childLocalName)
                                && childLocalName.equals("businessIdentifier")) {
                            businessIdentifier = child.getFirstChild().getNodeValue();
                        } else if (!StringUtils.isBlank(childLocalName) && childLocalName.equals("message")) {
                            outcomeMsg = child.getFirstChild() != null ? child.getFirstChild().getNodeValue()
                                    : null;
                        } else if (!StringUtils.isBlank(childLocalName) && childLocalName.equals("failed")) {
                            failed = new Boolean(
                                    child.getFirstChild() != null ? child.getFirstChild().getNodeValue()
                                            : "false");
                        }
                    }
                    if (businessIdentifier != null) {
                        integrationLog.addIntegrationLogDetail(
                                new IntegrationLogDetail(businessIdentifier, outcomeMsg, failed));
                    }
                }
            }
        }
    }
}

From source file:piazza.services.ingest.test.ControllerTests.java

/**
 * Test updating a Service/*from  w  ww  .j av  a 2 s. c o m*/
 */
@Test
public void testServiceUpdate() throws Exception {
    // Mock
    Service mockService = new Service();
    mockService.setUrl("http://test.com/service");
    mockService.setContractUrl("http://test.com/contract");
    mockService.setMethod("GET");
    mockService.setResourceMetadata(new ResourceMetadata());
    mockService.setServiceId("123456");
    mockService.getResourceMetadata().setName("Test Service");
    ServiceContainer mockContainer = new ServiceContainer(mockService);

    Mockito.doReturn(mockContainer).when(template).findOne(Mockito.eq("pzservices"),
            Mockito.eq("ServiceContainer"), Mockito.eq("123456"), Mockito.any());
    Mockito.doReturn(new Boolean(true)).when(template).index(Mockito.eq("pzservices"),
            Mockito.eq("ServiceContainer"), Mockito.any());
    Mockito.doReturn(true).when(template).delete(Mockito.eq("pzservices"), Mockito.eq("ServiceContainer"),
            Mockito.any(ServiceContainer.class));

    // Test
    Boolean isSuccess = controller.updateServiceDocById(mockService);

    // Verify
    Assert.assertTrue(isSuccess.booleanValue());
}

From source file:userinterface.graph.AxisSettingsHistogram.java

/**
 * Setter for property showGrid./*from   w  w  w.  ja  v a  2  s  .  c om*/
 * @param value Value of property showGrid.
 */
public void showGrid(boolean value) {
    try {
        showGrid.setValue(new Boolean(value));
        updateAxis();
        setChanged();
        notifyObservers(this);
    } catch (SettingException e) {
        // Shouldn't happen.
    }
}