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.OutputFormatTag.java

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

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

    if (value != null) {
        if (isValueReference(value)) {
            ValueBinding vb = Util.getValueBinding(value);
            output.setValueBinding("value", vb);
        } else {
            output.setValue(value);
        }
    }
    if (escape != null) {
        if (isValueReference(escape)) {
            ValueBinding vb = Util.getValueBinding(escape);
            output.setValueBinding("escape", vb);
        } else {
            boolean _escape = new Boolean(escape).booleanValue();
            output.getAttributes().put("escape", _escape ? Boolean.TRUE : Boolean.FALSE);
        }
    }
    if (style != null) {
        if (isValueReference(style)) {
            ValueBinding vb = Util.getValueBinding(style);
            output.setValueBinding("style", vb);
        } else {
            output.getAttributes().put("style", style);
        }
    }
    if (styleClass != null) {
        if (isValueReference(styleClass)) {
            ValueBinding vb = Util.getValueBinding(styleClass);
            output.setValueBinding("styleClass", vb);
        } else {
            output.getAttributes().put("styleClass", styleClass);
        }
    }
    if (title != null) {
        if (isValueReference(title)) {
            ValueBinding vb = Util.getValueBinding(title);
            output.setValueBinding("title", vb);
        } else {
            output.getAttributes().put("title", title);
        }
    }
}

From source file:edu.caltechUcla.sselCassel.projects.jMarkets.frontdesk.web.actions.EditJoinExpAction.java

/**
 * Process the specified HTTP request, and create the corresponding HTTP
 * response (or forward to another web component that will create it).
 * Return an <code>ActionForward</code> instance describing where and how
 * control should be forwarded, or <code>null</code> if the response has
 * already been completed./*from www.ja va2s  . c o  m*/
 *
 * @param mapping The ActionMapping used to select this instance
 * @param actionForm The optional ActionForm bean for this request (if any)
 * @param request The HTTP request we are processing
 * @param response The HTTP response we are creating
 *
 * @exception Exception if the application business logic throws
 *  an exception
 */
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {

    // Extract attributes we will need
    MessageResources messages = getResources(request);
    HttpSession session = request.getSession();

    if ("request".equals(mapping.getScope())) {
        request.setAttribute(mapping.getAttribute(), form);
    } else {
        session.setAttribute(mapping.getAttribute(), form);
    }

    if (!isClient(session)) {
        session.setAttribute("joiningExp", new Boolean(true));
        return (mapping.findForward("login_fail"));
    }

    int clientId = this.getClientId(session);
    String name = ControlServ.dbw.getSubjNameById(clientId);

    if (name != null) {
        session.setAttribute("clientName", name);
    } else {
        ActionMessages errors = new ActionMessages();
        errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.client.notRegistered"));
        saveErrors(request, errors);
        return (mapping.findForward("login_fail"));
    }

    return (mapping.findForward("success"));
}

From source file:net.ostis.scpdev.debug.ui.actions.BreakpointRulerAction.java

public static void addBreakpointMarker(IDocument document, int lineNumber, ITextEditor textEditor) {
    try {//from   w w  w  .  j  a va  2  s.c o  m
        if (lineNumber < 0)
            return;

        // just to validate it
        try {
            document.getLineInformation(lineNumber - 1);
        } catch (Exception e) {
            return; // ignore
        }
        final IResource resource = getResourceForDebugMarkers(textEditor);

        // The map containing the marker attributes
        final Map<String, Object> map = new HashMap<String, Object>();

        map.put(IMarker.MESSAGE, "PM breakpoint");
        map.put(IMarker.LINE_NUMBER, new Integer(lineNumber));
        map.put(IBreakpoint.ENABLED, new Boolean(true));
        map.put(IBreakpoint.ID, IDebugCoreConstants.ID_DEBUG_MODEL);

        IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
            @Override
            public void run(IProgressMonitor monitor) throws CoreException {
                IMarker marker = resource.createMarker(SCPLineBreakpoint.ID_MARKER);
                marker.setAttributes(map);
                SCPLineBreakpoint br = new SCPLineBreakpoint();
                br.setMarker(marker);
                IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
                breakpointManager.addBreakpoint(br);
            }
        };

        resource.getWorkspace().run(runnable, null);
    } catch (Exception e) {
        log.error("Unexpected exception", e);
    }
}

From source file:modelibra.designer.metaneighbor.GenMetaNeighbor.java

/**
 * Sets id.
 * 
 * @param id
 *            id
 */
public void setId(boolean id) {
    setId(new Boolean(id));
}

From source file:modelibra.designer.metaconcept.GenMetaConcept.java

/**
 * Sets entry.
 * 
 * @param entry
 *            entry
 */
public void setEntry(boolean entry) {
    setEntry(new Boolean(entry));
}

From source file:org.zht.framework.data.ParamObject.java

public void initType(POType initType) {
    switch (initType) {
    case S_O_C:/*from  ww w .j  a va 2 s.co  m*/
        this.isSql = new Boolean(true);
        this.isOffset = new Boolean(true);
        this.isNeedCount = new Boolean(true);
        break;
    case S_O_NC:
        this.isSql = new Boolean(true);
        this.isOffset = new Boolean(true);
        this.isNeedCount = new Boolean(false);
        break;
    case S_NO_C:
        this.isSql = new Boolean(true);
        this.isOffset = new Boolean(false);
        this.isNeedCount = new Boolean(true);
        break;
    case S_NO_NC:
        this.isSql = new Boolean(true);
        this.isOffset = new Boolean(false);
        this.isNeedCount = new Boolean(false);
        break;
    case H_O_C:
        this.isSql = new Boolean(false);
        this.isOffset = new Boolean(true);
        this.isNeedCount = new Boolean(true);
        break;
    case H_O_NC:
        this.isSql = new Boolean(false);
        this.isOffset = new Boolean(true);
        this.isNeedCount = new Boolean(false);
        break;
    case H_NO_C:
        this.isSql = new Boolean(false);
        this.isOffset = new Boolean(false);
        this.isNeedCount = new Boolean(true);
        break;
    case H_NO_NC:
        this.isSql = new Boolean(false);
        this.isOffset = new Boolean(false);
        this.isNeedCount = new Boolean(false);
        break;
    default:
        this.isSql = new Boolean(false);
        this.isOffset = new Boolean(true);
        this.isNeedCount = new Boolean(true);
    }
}

From source file:com.flagleader.builder.BuilderConfig.java

private void a() {
    Properties localProperties = null;
    try {/* w w w . j  a  va 2s.  c  om*/
        localProperties = new Properties();
        File localFile = new File(SystemUtils.USER_HOME + File.separator + ".visualrules", "builder.conf");
        if (localFile.exists()) {
            localProperties.load(new FileInputStream(localFile));
            this.c = localFile;
        } else if (BuilderConfig.class.getClassLoader().getResource("builder.conf") != null) {
            localProperties.load(BuilderConfig.class.getClassLoader().getResourceAsStream("builder.conf"));
            this.c = localFile;
            localFile.getParentFile().mkdirs();
        }
        this.h = new Boolean(localProperties.getProperty("autosave", "true")).booleanValue();
        setAutosaveTime(Long.parseLong(localProperties.getProperty("autosaveTime", "60")));
        setDemoKey(localProperties.getProperty("demoKey", this.j));
        this.k = localProperties.getProperty("userName", this.k);
        this.l = localProperties.getProperty("licenseKey", this.l);
        this.q = localProperties.getProperty("projPath", this.q);
        this.s = new Boolean(localProperties.getProperty("firstLogin", "false")).booleanValue();
        this.t = new Boolean(localProperties.getProperty("loadDefault", "true")).booleanValue();
        this.w = localProperties.getProperty("emailServer", this.w);
        this.x = localProperties.getProperty("emailUser", this.x);
        this.y = ConnectionFactory.decrypt(
                localProperties.getProperty("emailPasswd", "3rJHpofQIy/Tv/y2l8OShKEZ8a3alNI/ZndukVoup8A="));
        this.z = localProperties.getProperty("emailAuthor", this.z);
        this.A = localProperties.getProperty("emailAuthorName", this.A);
        this.B = localProperties.getProperty("emailTo", this.B);
        this.C = localProperties.getProperty("emailToName", this.C);
        this.n = localProperties.getProperty("tomcatLogFile", this.n);
        this.r = localProperties.getProperty("updateUrl", this.r);
        this.d = localProperties.getProperty("fontname", this.d);
        this.e = Integer.parseInt(localProperties.getProperty("fontheight", String.valueOf(this.e)));
        this.f = Integer.parseInt(localProperties.getProperty("fontstyle", String.valueOf(this.f)));
        this.g = new Font(null, this.d, this.e, this.f);
        this.m = Integer.parseInt(localProperties.getProperty("compositeBuffer", "80"));
        this.u = new Boolean(localProperties.getProperty("autoCheckVersion", "true")).booleanValue();
        setAutoCheckVersionTime(Long.parseLong(localProperties.getProperty("autoCheckVersionTime", "60")));
        if (this.m > 100)
            this.m = 100;
        if (this.m < 20)
            this.m = 20;
    } catch (Exception localException) {
    }
}

From source file:AIR.Common.Configuration.AppSettings.java

public static Object parseString(String type, String value) {
    switch (type.toLowerCase()) {
    case "boolean":
        return new Boolean(value);
    case "integer":
        return new Integer(value);
    default:/* ww w .j ava2  s  .  c  om*/
        return value; // default also covers "string"
    }
}

From source file:com.robonobo.common.util.BeanPropertyAccessor.java

public void setProperty(String name, boolean value) throws Exception {
    setProperty(name, boolean.class, new Boolean(value));
}

From source file:de.vandermeer.skb.commons.utils.CLIApache.java

@Override
public Com_Coin getOptions(PropertyTable prop) {
    CC_Warning ret = null;//from   w w w.j a v  a2s.co m
    String val;
    for (String key : this.optionList.keySet()) {
        val = this.optionList.get(key);
        if (this.cmdLine.hasOption(val)) {

            switch (this.typeMap.getPair4Source(prop.get(key, EAttributeKeys.CLI_PARAMETER_TYPE).toString())) {
            case JAVA_STRING:
                prop.setPropertyValueCli(key, new String(cmdLine.getOptionValue(val, "")));
                break;
            case JAVA_BOOLEAN:
                prop.setPropertyValueCli(key, new Boolean(true));
                break;
            case JAVA_INTEGER:
                Integer i = Skb_ObjectUtils.CONVERT(cmdLine.getOptionValue(val), Integer.class, new Integer(0),
                        new Integer(0));
                prop.setPropertyValueCli(key, i);
                break;
            case JAVA_DOUBLE:
                Double d = Skb_ObjectUtils.CONVERT(cmdLine.getOptionValue(val), Double.class, 0.0, 0.0);
                prop.setPropertyValueCli(key, d);
                break;
            case JAVA_LONG:
                Long l = Skb_ObjectUtils.CONVERT(cmdLine.getOptionValue(val), Long.class, new Long(0),
                        new Long(0));
                prop.setPropertyValueCli(key, l);
                break;
            default:
                if (ret == null) {
                    ret = new CC_Warning();
                }
                ret.add(new Message5WH_Builder().addWhat("unknown type <")
                        .addWhat(prop.get(key, EAttributeKeys.CLI_PARAMETER_TYPE)).addWhat("> for <")
                        .addWhat(key).addWhat(">").build());
            }

        }
    }
    if (ret == null) {
        return NOSuccess.get;
    }
    return ret;
}