Here you can find the source of getAttributeAsBoolean(Element elem, String attribName)
Parameter | Description |
---|---|
elem | a parameter |
attribName | a parameter |
public static boolean getAttributeAsBoolean(Element elem, String attribName)
//package com.java2s; /**//from w w w .j a v a2s. c o m * Copyright (c) 1999-2007, Fiorano Software Technologies Pvt. Ltd. and affiliates. * Copyright (c) 2008-2015, Fiorano Software Pte. Ltd. and affiliates. * * All rights reserved. * * This software is the confidential and proprietary information * of Fiorano Software ("Confidential Information"). You * shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement * enclosed with this product or entered into with Fiorano. */ import org.w3c.dom.Element; public class Main { /** * Returns attribute as boolean for class * * @param elem * @param attribName * @return */ public static boolean getAttributeAsBoolean(Element elem, String attribName) { String atribVal = elem.getAttribute(attribName); boolean retVal = false; try { retVal = Boolean.valueOf(atribVal).booleanValue(); } catch (Exception e) { } return retVal; } /** * Returns attribute as boolean for class * * @param elem * @param attribName * @param defaultVal * @return */ public static boolean getAttributeAsBoolean(Element elem, String attribName, boolean defaultVal) { String atribVal = elem.getAttribute(attribName); boolean retVal = defaultVal; try { retVal = Boolean.valueOf(atribVal).booleanValue(); } catch (Exception e) { } return retVal; } }