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:jp.terasoluna.fw.web.struts.actions.ForwardAction.java

/**
 * parameter??J?/*from   w ww .j  a  v a  2  s.  co m*/
 * ANVtH??[hZbg?B
 * parameter?????A
 * J?_?tH??[h"success"
 * ANVtH??[h?B
 * ????A?i404?jG?[?B
 *
 * @param mapping ANV}bsO
 * @param form ANVtH?[
 * @param req HTTPNGXg
 * @param res HTTPX|X
 * @return J?ANVtH??[h
 */
@SuppressWarnings("deprecation")
@Override
public ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest req,
        HttpServletResponse res) {
    if (log.isDebugEnabled()) {
        log.debug("doExecute() called.");
    }

    // parameter??itH??[h??j
    String path = mapping.getParameter();

    // ANVtH??[h??
    ActionForward retVal = null;

    if (path == null) {

        // ActionMappingActionForward
        retVal = mapping.findForward(FORWARD_SUCCESS);

        // ActionFoward???
        if (retVal == null) {
            // parameter??Aforwardvf????A
            // ?i404?jG?[p
            try {
                res.sendError(HttpServletResponse.SC_NOT_FOUND);
            } catch (IOException e) {
                log.error("Error page(404) forwarding failed.");

                throw new SystemException(e, FORWARD_ERRORPAGE_ERROR);
            }
            return null;
        }
        return retVal;
    }

    retVal = new ActionForward(path);

    // contextRelative?l
    String contextRelativeStr = PropertyUtil.getProperty(FORWARD_ACTION_CONTEXT_RELATIVE_KEY,
            Boolean.FALSE.toString());
    Boolean contextRelative = new Boolean(contextRelativeStr);

    // ActionForwardcontextRelativel?
    retVal.setContextRelative(contextRelative);
    if (log.isDebugEnabled()) {
        StringBuilder debugLog = new StringBuilder();
        debugLog.append("contextRelative:");
        debugLog.append(contextRelative);
        log.debug(debugLog.toString());
    }

    return retVal;
}

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

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

    if (action != null) {
        if (isValueReference(action)) {
            MethodBinding vb = FacesContext.getCurrentInstance().getApplication().createMethodBinding(action,
                    null);
            command.setAction(vb);
        } else {
            final String outcome = action;
            MethodBinding vb = Util.createConstantMethodBinding(action);
            command.setAction(vb);
        }
    }
    if (actionListener != null) {
        if (isValueReference(actionListener)) {
            Class args[] = { ActionEvent.class };
            MethodBinding vb = FacesContext.getCurrentInstance().getApplication()
                    .createMethodBinding(actionListener, args);
            command.setActionListener(vb);
        } else {
            Object params[] = { actionListener };
            throw new javax.faces.FacesException(
                    Util.getExceptionMessageString(Util.INVALID_EXPRESSION_ID, params));
        }
    }
    if (immediate != null) {
        if (isValueReference(immediate)) {
            ValueBinding vb = Util.getValueBinding(immediate);
            command.setValueBinding("immediate", vb);
        } else {
            boolean _immediate = new Boolean(immediate).booleanValue();
            command.setImmediate(_immediate);
        }
    }
    if (value != null) {
        if (isValueReference(value)) {
            ValueBinding vb = Util.getValueBinding(value);
            command.setValueBinding("value", vb);
        } else {
            command.setValue(value);
        }
    }
    if (accesskey != null) {
        if (isValueReference(accesskey)) {
            ValueBinding vb = Util.getValueBinding(accesskey);
            command.setValueBinding("accesskey", vb);
        } else {
            command.getAttributes().put("accesskey", accesskey);
        }
    }
    if (alt != null) {
        if (isValueReference(alt)) {
            ValueBinding vb = Util.getValueBinding(alt);
            command.setValueBinding("alt", vb);
        } else {
            command.getAttributes().put("alt", alt);
        }
    }
    if (dir != null) {
        if (isValueReference(dir)) {
            ValueBinding vb = Util.getValueBinding(dir);
            command.setValueBinding("dir", vb);
        } else {
            command.getAttributes().put("dir", dir);
        }
    }
    if (disabled != null) {
        if (isValueReference(disabled)) {
            ValueBinding vb = Util.getValueBinding(disabled);
            command.setValueBinding("disabled", vb);
        } else {
            boolean _disabled = new Boolean(disabled).booleanValue();
            command.getAttributes().put("disabled", _disabled ? Boolean.TRUE : Boolean.FALSE);
        }
    }
    if (image != null) {
        if (isValueReference(image)) {
            ValueBinding vb = Util.getValueBinding(image);
            command.setValueBinding("image", vb);
        } else {
            command.getAttributes().put("image", image);
        }
    }
    if (lang != null) {
        if (isValueReference(lang)) {
            ValueBinding vb = Util.getValueBinding(lang);
            command.setValueBinding("lang", vb);
        } else {
            command.getAttributes().put("lang", lang);
        }
    }
    if (onblur != null) {
        if (isValueReference(onblur)) {
            ValueBinding vb = Util.getValueBinding(onblur);
            command.setValueBinding("onblur", vb);
        } else {
            command.getAttributes().put("onblur", onblur);
        }
    }
    if (onchange != null) {
        if (isValueReference(onchange)) {
            ValueBinding vb = Util.getValueBinding(onchange);
            command.setValueBinding("onchange", vb);
        } else {
            command.getAttributes().put("onchange", onchange);
        }
    }
    if (onclick != null) {
        if (isValueReference(onclick)) {
            ValueBinding vb = Util.getValueBinding(onclick);
            command.setValueBinding("onclick", vb);
        } else {
            command.getAttributes().put("onclick", onclick);
        }
    }
    if (ondblclick != null) {
        if (isValueReference(ondblclick)) {
            ValueBinding vb = Util.getValueBinding(ondblclick);
            command.setValueBinding("ondblclick", vb);
        } else {
            command.getAttributes().put("ondblclick", ondblclick);
        }
    }
    if (onfocus != null) {
        if (isValueReference(onfocus)) {
            ValueBinding vb = Util.getValueBinding(onfocus);
            command.setValueBinding("onfocus", vb);
        } else {
            command.getAttributes().put("onfocus", onfocus);
        }
    }
    if (onkeydown != null) {
        if (isValueReference(onkeydown)) {
            ValueBinding vb = Util.getValueBinding(onkeydown);
            command.setValueBinding("onkeydown", vb);
        } else {
            command.getAttributes().put("onkeydown", onkeydown);
        }
    }
    if (onkeypress != null) {
        if (isValueReference(onkeypress)) {
            ValueBinding vb = Util.getValueBinding(onkeypress);
            command.setValueBinding("onkeypress", vb);
        } else {
            command.getAttributes().put("onkeypress", onkeypress);
        }
    }
    if (onkeyup != null) {
        if (isValueReference(onkeyup)) {
            ValueBinding vb = Util.getValueBinding(onkeyup);
            command.setValueBinding("onkeyup", vb);
        } else {
            command.getAttributes().put("onkeyup", onkeyup);
        }
    }
    if (onmousedown != null) {
        if (isValueReference(onmousedown)) {
            ValueBinding vb = Util.getValueBinding(onmousedown);
            command.setValueBinding("onmousedown", vb);
        } else {
            command.getAttributes().put("onmousedown", onmousedown);
        }
    }
    if (onmousemove != null) {
        if (isValueReference(onmousemove)) {
            ValueBinding vb = Util.getValueBinding(onmousemove);
            command.setValueBinding("onmousemove", vb);
        } else {
            command.getAttributes().put("onmousemove", onmousemove);
        }
    }
    if (onmouseout != null) {
        if (isValueReference(onmouseout)) {
            ValueBinding vb = Util.getValueBinding(onmouseout);
            command.setValueBinding("onmouseout", vb);
        } else {
            command.getAttributes().put("onmouseout", onmouseout);
        }
    }
    if (onmouseover != null) {
        if (isValueReference(onmouseover)) {
            ValueBinding vb = Util.getValueBinding(onmouseover);
            command.setValueBinding("onmouseover", vb);
        } else {
            command.getAttributes().put("onmouseover", onmouseover);
        }
    }
    if (onmouseup != null) {
        if (isValueReference(onmouseup)) {
            ValueBinding vb = Util.getValueBinding(onmouseup);
            command.setValueBinding("onmouseup", vb);
        } else {
            command.getAttributes().put("onmouseup", onmouseup);
        }
    }
    if (onselect != null) {
        if (isValueReference(onselect)) {
            ValueBinding vb = Util.getValueBinding(onselect);
            command.setValueBinding("onselect", vb);
        } else {
            command.getAttributes().put("onselect", onselect);
        }
    }
    if (readonly != null) {
        if (isValueReference(readonly)) {
            ValueBinding vb = Util.getValueBinding(readonly);
            command.setValueBinding("readonly", vb);
        } else {
            boolean _readonly = new Boolean(readonly).booleanValue();
            command.getAttributes().put("readonly", _readonly ? Boolean.TRUE : Boolean.FALSE);
        }
    }
    if (style != null) {
        if (isValueReference(style)) {
            ValueBinding vb = Util.getValueBinding(style);
            command.setValueBinding("style", vb);
        } else {
            command.getAttributes().put("style", style);
        }
    }
    if (styleClass != null) {
        if (isValueReference(styleClass)) {
            ValueBinding vb = Util.getValueBinding(styleClass);
            command.setValueBinding("styleClass", vb);
        } else {
            command.getAttributes().put("styleClass", styleClass);
        }
    }
    if (tabindex != null) {
        if (isValueReference(tabindex)) {
            ValueBinding vb = Util.getValueBinding(tabindex);
            command.setValueBinding("tabindex", vb);
        } else {
            command.getAttributes().put("tabindex", tabindex);
        }
    }
    if (title != null) {
        if (isValueReference(title)) {
            ValueBinding vb = Util.getValueBinding(title);
            command.setValueBinding("title", vb);
        } else {
            command.getAttributes().put("title", title);
        }
    }
    if (type != null) {
        if (isValueReference(type)) {
            ValueBinding vb = Util.getValueBinding(type);
            command.setValueBinding("type", vb);
        } else {
            command.getAttributes().put("type", type);
        }
    }
}

From source file:com.aurel.track.util.StringArrayParameterUtils.java

public static Boolean getBooleanValue(Map/*<String, String[]>*/ configParameters, String fieldName) {
    String[] strArr = null;//w  w  w .  j av a2 s .  co  m
    if (configParameters != null) {
        try {
            strArr = (String[]) configParameters.get(fieldName);
        } catch (Exception e) {
            LOGGER.info("getBooleanValue: converting the " + fieldName + " parameter to String[] failed with "
                    + e.getMessage());
            LOGGER.debug(ExceptionUtils.getStackTrace(e));
        }
    }
    if (strArr != null && strArr.length > 0) {
        try {
            return new Boolean(strArr[0]);
        } catch (Exception e) {
            LOGGER.info("Converting the parameter " + strArr[0] + " to boolean failed with " + e.getMessage());
            LOGGER.debug(ExceptionUtils.getStackTrace(e));
        }
    }
    return new Boolean(false);
}

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

protected void setProperties(UIComponent component) {
    super.setProperties(component);
    UISelectOne selectone = null;/*w w w.j  av  a  2s  .c  o m*/
    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 (border != null) {
        if (isValueReference(border)) {
            ValueBinding vb = Util.getValueBinding(border);
            selectone.setValueBinding("border", vb);
        } else {
            int _border = new Integer(border).intValue();
            if (_border != Integer.MIN_VALUE) {
                selectone.getAttributes().put("border", new Integer(_border));
            }
        }
    }
    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 (layout != null) {
        if (isValueReference(layout)) {
            ValueBinding vb = Util.getValueBinding(layout);
            selectone.setValueBinding("layout", vb);
        } else {
            selectone.getAttributes().put("layout", layout);
        }
    }
    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 (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:edu.htwm.vsp.phoebook.rest.client.RestClient.java

/**
 * Example code for serializing a PhoneUser via JAXB.
 *///from  www  .j  a v a  2  s  .  c om
public void marshalPhoneUserToXML(PhoneUser user, Writer out) throws JAXBException {

    JAXBContext jc = JAXBContext.newInstance(PhoneUser.class);
    assertNotNull(jc);
    Marshaller marshaller = jc.createMarshaller();

    assertNotNull(marshaller);

    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, new Boolean(true));
    marshaller.marshal(user, out);
}

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

protected void setProperties(UIComponent component) {
    super.setProperties(component);
    UISelectMany selectmany = null;//from  w  w w  . j av a  2 s  .  c om
    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 (border != null) {
        if (isValueReference(border)) {
            ValueBinding vb = Util.getValueBinding(border);
            selectmany.setValueBinding("border", vb);
        } else {
            int _border = new Integer(border).intValue();
            if (_border != Integer.MIN_VALUE) {
                selectmany.getAttributes().put("border", new Integer(_border));
            }
        }
    }
    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 (layout != null) {
        if (isValueReference(layout)) {
            ValueBinding vb = Util.getValueBinding(layout);
            selectmany.setValueBinding("layout", vb);
        } else {
            selectmany.getAttributes().put("layout", layout);
        }
    }
    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 (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:eu.europeana.querylog.learn.Evaluate.java

public double evaluateCurrentRankingFunction() {

    double totalScore = 0d;
    int queries = 0;
    logger.info("assessment size = {} ", assessment.size());
    boolean partial = false;
    if (System.getProperty("partial") != null) {
        partial = new Boolean(System.getProperty("partial"));

    }//from  w w  w. j  ava2  s . co m
    for (QueryAssessment qa : assessment) {
        SolrQuery query = new SolrQuery(qa.getQuery());
        List<String> topDocId = results.results(query, N);
        double score = measure.getScore(topDocId, qa);
        if (partial) {
            System.out.println(String.format("%s\t%s\t%s\t%f", qa.getQuery(), results.getName(),
                    measure.getName(), score));
        }

        totalScore += score;
        queries++;
    }
    double avgScore = totalScore / queries;
    logger.info(String.format("[%s] %s = %f", results.getName(), measure.getName(), avgScore));
    return avgScore;
}

From source file:es.itecban.deployment.executionmanager.DefaultPlanExecutor.java

private boolean isAssetCheckingActive(String environmentName) {

    EnvironmentPropertyType property = null;
    try {//from w  w  w.  j  a v a 2s.  c  o  m
        property = this.configurationProvider.getEnvironmentProperty(environmentName,
                "es.itecban.ilabrys.ram.checkAssetsStatus");

    } catch (ServiceUnavailableException e) {
        logger.info("Error ocurred while communicating with the configuratioProvider. "
                + "Maybe this module is not available as it is optional for the " + "Execution Manager system");
    }
    if (property != null)
        return new Boolean(property.getValue());
    else
        // return true;
        return false;
}

From source file:org.openmeetings.app.remote.PollService.java

public int vote(int pollvalue, int pollTypeId) {
    int returnVal = 0;
    try {//from  w  w w . j  a v a 2s. c o  m
        log.debug("PollService::vote: Enter");
        IConnection current = Red5.getConnectionLocal();
        String streamid = current.getClient().getId();
        RoomClient rc = clientListManager.getClientByStreamId(streamid);

        if (rc == null) {
            log.error("RoomClient IS NULL for ClientID: " + current.getClient().getId());
            return -1;
        }
        long roomId = rc.getRoom_id();
        if (!pollManagement.hasPoll(roomId)) {
            log.error("POLL IS NULL for RoomId: " + rc.getRoom_id());
            return -1;
        }
        if (pollManagement.hasVoted(roomId, rc.getUser_id())) {
            log.debug("hasVoted: true");
            return -1;
        }
        // get Poll
        RoomPoll roomP = pollManagement.getPoll(roomId);

        log.debug("vote: " + pollvalue + " " + pollTypeId + " " + roomP.getPollQuestion());

        log.debug("hasVoted: false");
        RoomPollAnswers rpA = new RoomPollAnswers();
        if (roomP.getPollType().getIsNumericAnswer()) {
            log.debug("numeric");
            rpA.setPointList(pollvalue);
        } else {
            log.debug("boolean");
            // Is boolean Question
            rpA.setAnswer(new Boolean(pollvalue == 1));
        }
        rpA.setVotedUser(usermanagement.getUserById(rc.getUser_id()));
        rpA.setVoteDate(new Date());
        rpA.setRoomPoll(roomP);
        roomP.getRoomPollAnswerList().add(rpA);
        pollManagement.updatePoll(roomP);
        return 1;
    } catch (Exception err) {
        log.error("[vote]", err);
    }
    return returnVal;
}

From source file:es.caib.seycon.ng.servei.XarxaServiceImpl.java

protected Boolean handleTeAccesAXarxa(String codiUsuari, String codiXarxa) throws Exception {
    Collection codiXarxes = getCodiXarxesAmbAcces(codiUsuari);
    return new Boolean(codiXarxes.contains(codiXarxa));
}