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:fedora.server.security.servletfilters.Base.java

public static final boolean booleanValue(String string) throws Exception {
    if (Boolean.TRUE.toString().equals(string) || Boolean.FALSE.toString().equals(string)) {
        return (new Boolean(string)).booleanValue();
    } else {//from   ww w. j  a  va 2 s . c  o m
        throw new Exception("does not represent a boolean");
    }
}

From source file:net.sourceforge.fenixedu.presentationTier.Action.utils.RequestUtils.java

public static Collection buildExecutionDegreeLabelValueBean(Collection executionDegrees) {
    final Map duplicateDegreesMap = new HashMap();
    for (Iterator iterator = executionDegrees.iterator(); iterator.hasNext();) {
        InfoExecutionDegree infoExecutionDegree = (InfoExecutionDegree) iterator.next();
        InfoDegree infoDegree = infoExecutionDegree.getInfoDegreeCurricularPlan().getInfoDegree();
        String degreeName = infoDegree.getNome();

        if (duplicateDegreesMap.get(degreeName) == null) {
            duplicateDegreesMap.put(degreeName, new Boolean(false));
        } else {/*from  w  ww  . j  a va2  s . c  o m*/
            duplicateDegreesMap.put(degreeName, new Boolean(true));
        }
    }

    Collection lableValueList = CollectionUtils.collect(executionDegrees, new Transformer() {

        @Override
        public Object transform(Object arg0) {
            InfoExecutionDegree infoExecutionDegree = (InfoExecutionDegree) arg0;

            String label = infoExecutionDegree.getInfoDegreeCurricularPlan().getDegreeCurricularPlan()
                    .getPresentationName(infoExecutionDegree.getInfoExecutionYear().getExecutionYear());

            String value = infoExecutionDegree.getExternalId().toString();

            return new LabelValueBean(label, value);
        }

    });

    Comparator comparator = new BeanComparator("label", Collator.getInstance());
    Collections.sort((List) lableValueList, comparator);

    return lableValueList;
}

From source file:com.tonbeller.wcf.convert.BooleanConverter.java

/**
 * sets the selected attribute of the DOM element. If a modelReference
 * is specified, it must point to a boolean bean-property that will be updated.
 *
 * @param fmt Formatter for i18n string-object conversion
 * @param params parameters of http request
 * @param elem the target element./* w  w  w .  ja  v a 2 s.c  o m*/
 * @param bean the target bean
 */
public void convert(Formatter fmt, Map params, Map fileParams, Element elem, Object bean)
        throws FormatException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {

    int state = isSelected(elem, params);
    if (state == UNKNOWN)
        return;

    // was the checkbox checked?
    Boolean value = new Boolean(state == TRUE);

    // set into elem and bean
    DomUtils.removeAttribute(elem, "error");
    Item.setSelected(elem, value.booleanValue());

    // update bean
    String modelReference = Item.getModelReference(elem);
    if (bean != null && modelReference.length() > 0)
        PropertyUtils.setProperty(bean, Item.getModelReference(elem), value);
}

From source file:MainClass.java

public void setFileStats(File dir) {
    String files[] = dir.list();/*from   w w w .  j a  v a2s  .com*/
    data = new Object[files.length][titles.length];

    for (int i = 0; i < files.length; i++) {
        File tmp = new File(files[i]);
        data[i][0] = new Boolean(tmp.isDirectory());
        data[i][1] = tmp.getName();
        data[i][2] = new Boolean(tmp.canRead());
        data[i][3] = new Boolean(tmp.canWrite());
        data[i][4] = new Long(tmp.length());
        data[i][5] = new Date(tmp.lastModified());
    }

    fireTableDataChanged();
}

From source file:com.signavio.warehouse.business.util.jpdl4.Sql.java

public Sql(JSONObject sql) {

    this.name = JsonToJpdl.getAttribute(sql, "name");
    this.var = JsonToJpdl.getAttribute(sql, "var");
    this.unique = new Boolean(JsonToJpdl.getAttribute(sql, "unique"));
    this.query = JsonToJpdl.getAttribute(sql, "query");
    try {//  w  w  w .  j  a va2  s  . c  o  m
        this.parameters = new Parameters(sql.getJSONObject("properties").getJSONObject("parameters"));
    } catch (JSONException e) {
        this.parameters = null;
    }

    this.bounds = JsonToJpdl.getBounds(sql);

    this.outgoings = JsonToJpdl.getOutgoings(sql);

}

From source file:Clock.java

public void setDigital(boolean digital) {
    propertyChangeSupport.firePropertyChange("digital", new Boolean(isDigital), new Boolean(digital));
    isDigital = digital;//from ww  w.  j ava 2s.c  o  m
    repaint();
}

From source file:com.redhat.rhn.frontend.action.LoginSetupAction.java

/** {@inheritDoc} */
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) {// w ww  .  j  av  a  2  s .c  o  m

    CertificateManager man = CertificateManager.getInstance();
    if (man.isSatelliteCertExpired()) {
        addMessage(request, "satellite.expired");
        request.setAttribute(HAS_EXPIRED, new Boolean(true));
        return mapping.findForward("default");
    } else if (man.isSatelliteCertInGracePeriod()) {
        long daysUntilExpiration = man.getDaysLeftBeforeCertExpiration();
        createSuccessMessage(request, "satellite.graceperiod", String.valueOf(daysUntilExpiration));
    } else if (!UserManager.satelliteHasUsers()) {
        return mapping.findForward("needuser");
    }

    if (AclManager.hasAcl("user_authenticated()", request, null)) {
        return mapping.findForward("loggedin");
    }

    // ok handle the case where we're doing the ReLogin page
    String urlBounce = (String) request.getAttribute("url_bounce");

    if (!StringUtils.isEmpty(urlBounce)) {

        if (log.isDebugEnabled()) {
            log.debug("request.getAttribute(url_bounce): " + urlBounce);
        }

        DynaActionForm f = (DynaActionForm) form;
        f.set("url_bounce", urlBounce);
    }

    return mapping.findForward("default");
}

From source file:com.fredck.FCKeditor.uploader.SimpleUploaderServlet.java

/**
 * Initialize the servlet.<br>/*from w  w  w. java 2 s.co  m*/
 * Retrieve from the servlet configuration the "baseDir" which is the root
 * of the file repository:<br>
 * If not specified the value of "/UserFiles/" will be used.<br>
 * Also it retrieve all allowed and denied extensions to be handled.
 * 
 */
public void init() throws ServletException {
    debug = (new Boolean(getInitParameter("debug"))).booleanValue();
    if (debug) {
        System.out.println("\r\n---- SimpleUploaderServlet initialization started ----");
    }
    baseDir = getInitParameter("baseDir");
    enabled = (new Boolean(getInitParameter("enabled"))).booleanValue();
    if (baseDir == null) {
        baseDir = "/UserFiles/";
    }
    String realBaseDir = getServletContext().getRealPath(baseDir);
    File baseFile = new File(realBaseDir);
    if (!baseFile.exists()) {
        baseFile.mkdir();
    }
    allowedExtensions = new Hashtable(3);
    deniedExtensions = new Hashtable(3);
    allowedExtensions.put("File", stringToArrayList(getInitParameter("AllowedExtensionsFile")));
    deniedExtensions.put("File", stringToArrayList(getInitParameter("DeniedExtensionsFile")));
    allowedExtensions.put("Image", stringToArrayList(getInitParameter("AllowedExtensionsImage")));
    deniedExtensions.put("Image", stringToArrayList(getInitParameter("DeniedExtensionsImage")));
    allowedExtensions.put("Flash", stringToArrayList(getInitParameter("AllowedExtensionsFlash")));
    deniedExtensions.put("Flash", stringToArrayList(getInitParameter("DeniedExtensionsFlash")));
    if (debug) {
        System.out.println("---- SimpleUploaderServlet initialization completed ----\r\n");
    }
}

From source file:org.openmrs.module.sync.SyncUtilTest.java

@Test
public void getSetterMethod_shouldReturnMethodForPrimitiveBoolean() {
    Method m = SyncUtil.getSetterMethod(new Xform().getClass(), "booleanField", new Boolean(true).getClass());
    Assert.notNull(m);//from  w w w  .  j a  v  a  2  s .c o  m
}

From source file:com.meikai.common.web.servlet.FCKeditorUploadServlet.java

/**
 * Initialize the servlet.<br>//from w ww.ja  v a  2 s. c o m
 * Retrieve from the servlet configuration the "baseDir" which is the root of the file repository:<br>
 * If not specified the value of "/UserFiles/" will be used.<br>
 * Also it retrieve all allowed and denied extensions to be handled.
 *
 */
public void init() throws ServletException {

    debug = (new Boolean(getInitParameter("debug"))).booleanValue();

    baseDir = getInitParameter("baseDir");
    enabled = (new Boolean(getInitParameter("enabled"))).booleanValue();
    if (baseDir == null)
        baseDir = "/UserFiles/";
    String realBaseDir = getServletContext().getRealPath(baseDir);
    File baseFile = new File(realBaseDir);
    if (!baseFile.exists()) {
        baseFile.mkdir();
    }

    allowedExtensions = new Hashtable(3);
    deniedExtensions = new Hashtable(3);

    allowedExtensions.put("File", FckeditorUtil.stringToArrayList(getInitParameter("AllowedExtensionsFile")));
    deniedExtensions.put("File", FckeditorUtil.stringToArrayList(getInitParameter("DeniedExtensionsFile")));

    allowedExtensions.put("Image", FckeditorUtil.stringToArrayList(getInitParameter("AllowedExtensionsImage")));
    deniedExtensions.put("Image", FckeditorUtil.stringToArrayList(getInitParameter("DeniedExtensionsImage")));

    allowedExtensions.put("Flash", FckeditorUtil.stringToArrayList(getInitParameter("AllowedExtensionsFlash")));
    deniedExtensions.put("Flash", FckeditorUtil.stringToArrayList(getInitParameter("DeniedExtensionsFlash")));

}