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.liferay.portlet.JSPPortlet.java

public void init() throws PortletException {
    _editJSP = getInitParameter("edit-jsp");
    _helpJSP = getInitParameter("help-jsp");
    _viewJSP = getInitParameter("view-jsp");
    useWEBINFDIR = new Boolean(getInitParameter("useWEBINFDIR"));

    _copyRequestParameters = GetterUtil.get(getInitParameter("copy-request-parameters"), true);
}

From source file:com.zjy.utils.propertyset.BaseCachingPropertySet.java

public void init() {
    if (logger.isDebugEnabled()) {
        logger.debug("RuntimeCachingPropertySet.init......");
    }/*w  w  w .  j av  a  2  s  .com*/
    PropertySetConfig psc = PropertySetConfig.getConfig();
    Map<?, ?> cacheConfig = psc.getArgs("cached");
    Map<String, Object> cacheArgs = new HashMap<String, Object>();

    bjps.setString("dbhost", "");
    bjps.setString("dbport", "");
    bjps.setString("dbtype", "");
    bjps.setString("dbname", "");
    bjps.setString("dbuser", "");
    bjps.setString("dbpasswd", "");

    bjps.setString("ldaphost", "");
    bjps.setString("ldapport", "");
    bjps.setString("ldapdn", "");
    bjps.setString("ldappasswd", "");

    bjps.setString("newdbhost", "");
    bjps.setString("newdbport", "");
    bjps.setString("newdbtype", "");
    bjps.setString("newdbname", "");
    bjps.setString("newdbuser", "");
    bjps.setString("newdbpasswd", "");

    bjps.setString("newldaphost", "");
    bjps.setString("newldapport", "");
    bjps.setString("newldapdn", "");
    bjps.setString("newldappasswd", "");

    cacheArgs.put("PropertySet", bjps);
    cacheArgs.put("bulkload", new Boolean("true"));

    super.init(cacheConfig, cacheArgs);

}

From source file:com.netflix.simianarmy.janitor.TestBasicJanitorMonkeyContext.java

@Test
public void testAddRuleWithUntaggedRuleResource() {
    JanitorRuleEngine ruleEngine = new BasicJanitorRuleEngine();
    Boolean untaggedRuleEnabled = new Boolean(true);

    Rule rule = new UntaggedRule(monkeyCalendar, SIMIANARMY_JANITOR_RULE_UNTAGGEDRULE_REQUIREDTAGS,
            SIMIANARMY_JANITOR_RULE_UNTAGGEDRULE_RETENTIONDAYSWITHOWNER,
            SIMIANARMY_JANITOR_RULE_UNTAGGEDRULE_RETENTIONDAYSWITHOUTOWNER);
    if (untaggedRuleEnabled && getUntaggedRuleResourceSet().contains("INSTANCE")) {
        ruleEngine.addRule(rule);//from  w ww .  ja v  a2 s.  c o  m
    }
    Assert.assertTrue(ruleEngine.getRules().contains(rule));
}

From source file:com.fredck.FCKeditor.connector.ConnectorServlet.java

/**
 * Initialize the servlet.<br>/*from  w w w. java  2s .  c  om*/
 * 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.
 * 
 */
public void init() throws ServletException {
    System.out.println("ConnectorServlet.init");
    baseDir = getInitParameter("baseDir");
    debug = (new Boolean(getInitParameter("debug"))).booleanValue();
    if (baseDir == null)
        baseDir = "/UserFiles/";
    String realBaseDir = getServletContext().getRealPath(baseDir);
    File baseFile = new File(realBaseDir);
    if (!baseFile.exists()) {
        baseFile.mkdir();
    }
}

From source file:org.openmrs.web.controller.concept.ConceptProposalListController.java

/**
 * This is called prior to displaying a form for the first time. It tells Spring the
 * form/command object to load into the request
 *
 * @see org.springframework.web.servlet.mvc.AbstractFormController#formBackingObject(javax.servlet.http.HttpServletRequest)
 *///w  w  w.  jav a2 s.c  o m
protected Object formBackingObject(HttpServletRequest request) throws ServletException {

    //default empty Object
    List<ConceptProposal> cpList = new Vector<ConceptProposal>();
    Map<String, List<ConceptProposal>> origText = new HashMap<String, List<ConceptProposal>>();

    //only fill the Object is the user has authenticated properly
    if (Context.isAuthenticated()) {
        ConceptService cs = Context.getConceptService();
        log.debug("tmp value: " + request.getParameter("includeCompleted"));
        boolean b = new Boolean(request.getParameter("includeCompleted"));
        log.debug("b value: " + b);
        cpList = cs.getAllConceptProposals(b);
    }

    // create map of distinct OriginalText->#occurences
    for (ConceptProposal cp : cpList) {
        List<ConceptProposal> matchingProposals = origText.get(cp.getOriginalText());
        if (matchingProposals == null) {
            matchingProposals = new Vector<ConceptProposal>();
        }
        matchingProposals.add(cp);
        origText.put(cp.getOriginalText(), matchingProposals);
    }

    boolean asc = new Boolean("asc".equals(request.getParameter("sortOrder")));
    String sortOn = request.getParameter("sortOn");
    if (sortOn == null) {
        sortOn = "occurences";
    }

    Map<List<ConceptProposal>, Integer> cpMap = new TreeMap<List<ConceptProposal>, Integer>();

    if (sortOn.equals("occurences")) {
        cpMap = new TreeMap<List<ConceptProposal>, Integer>(new CompareListSize(asc));
    } else {
        //if (sortOn.equals("text"))
        cpMap = new TreeMap<List<ConceptProposal>, Integer>(new CompareListText(asc));
    }

    // loop over that map to sort on size or text
    for (List<ConceptProposal> matchingProposals : origText.values()) {
        cpMap.put(matchingProposals, matchingProposals.size());
    }

    return cpMap;
}

From source file:components.SimpleTableDemo.java

public SimpleTableDemo() {
    super(new GridLayout(1, 0));

    String[] columnNames = { "First Name", "Last Name", "Sport", "# of Years", "Vegetarian" };

    Object[][] data = { { "Kathy", "Smith", "Snowboarding", new Integer(5), new Boolean(false) },
            { "John", "Doe", "Rowing", new Integer(3), new Boolean(true) },
            { "Sue", "Black", "Knitting", new Integer(2), new Boolean(false) },
            { "Jane", "White", "Speed reading", new Integer(20), new Boolean(true) },
            { "Joe", "Brown", "Pool", new Integer(10), new Boolean(false) } };

    final JTable table = new JTable(data, columnNames);
    table.setPreferredScrollableViewportSize(new Dimension(500, 70));
    table.setFillsViewportHeight(true);/*from w  ww. j av a2 s .c  o m*/

    if (DEBUG) {
        table.addMouseListener(new MouseAdapter() {
            public void mouseClicked(MouseEvent e) {
                printDebugData(table);
            }
        });
    }

    //Create the scroll pane and add the table to it.
    JScrollPane scrollPane = new JScrollPane(table);

    //Add the scroll pane to this panel.
    add(scrollPane);
}

From source file:main.java.refinement_class.Useful.java

public static void mashal(Object o, String xml_file, Class c) {

    Marshaller marshaller;/*from   w w  w  .  j av a2s.c  om*/
    // create a JAXBContext
    JAXBContext jaxbContext;

    try {
        jaxbContext = JAXBContext.newInstance(c);

        marshaller = jaxbContext.createMarshaller();
        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, new Boolean(true));
        marshaller.marshal(o, new FileOutputStream(xml_file));
    } catch (JAXBException e) {
        e.printStackTrace();
        LOG.error(e.toString());
    } catch (FileNotFoundException e) {
        e.printStackTrace();
        LOG.error(e.toString());
    }
}

From source file:crds.pub.FCKeditor.uploader.SimpleUploaderServlet.java

/**
 * Initialize the servlet.<br>//w w w  .j a  v  a  2s  .  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", 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")));

}

From source file:com.cyclopsgroup.tornado.ui.view.user.LookAndFeel.java

/**
 * Override method execute in class LookAndFeel
 *
 * @see com.cyclopsgroup.waterview.Module#execute(com.cyclopsgroup.waterview.RuntimeData, com.cyclopsgroup.waterview.Context)
 *///from  w ww  . j ava2  s. c o m
public void execute(RuntimeData data, Context context) throws Exception {
    String userId = (String) context.get("userId");
    if (StringUtils.isEmpty(userId)) {
        userId = RuntimeUser.getInstance(data).getId();
    }

    context.put("userId", userId);

    PortalService portal = (PortalService) lookup(PortalService.ROLE);
    UserPreference up = portal.findUserPreference(userId);
    context.put("noPreference", new Boolean(up == null));
    if (up == null) {
        return;
    }
    context.put("pref", up);

    LookAndFeelService laf = (LookAndFeelService) lookup(LookAndFeelService.ROLE);
    List themeSelection = new ArrayList();
    String[] themeNames = laf.getThemeNames();
    for (int i = 0; i < themeNames.length; i++) {
        String themeName = themeNames[i];
        Theme theme = laf.getTheme(themeName);
        DefaultSelectOption dso = new DefaultSelectOption(themeName, theme.getDescription());
        themeSelection.add(dso);
    }
    context.put("themes", themeSelection);

    String[] iconSetNames = laf.getIconSetNames();
    List iconSets = new ArrayList();
    for (int i = 0; i < iconSetNames.length; i++) {
        String name = iconSetNames[i];
        DefaultSelectOption dso = new DefaultSelectOption(name, laf.getIconSet(name).getDescription());
        iconSets.add(dso);
    }
    context.put("iconSets", iconSets);

    String[] styleSheetNames = laf.getStyleNames();
    List styleSheets = new ArrayList();
    for (int i = 0; i < styleSheetNames.length; i++) {
        String name = styleSheetNames[i];
        DefaultSelectOption dso = new DefaultSelectOption(name, laf.getStyle(name).getDescription());
        styleSheets.add(dso);
    }
    context.put("styleSheets", styleSheets);
}

From source file:net.sourceforge.buildmonitor.monitors.BambooProperties.java

public BambooProperties() {
    this.serverBaseUrl = "http://localhost:8085";
    this.username = "";
    this.password = "";
    this.updatePeriodInSeconds = 300;
    this.favouriteProjectsOnly = new Boolean(false);
}