Here you can find the source of parseBoolean(String xmlAttributeValue, Boolean invalidValue)
public static Boolean parseBoolean(String xmlAttributeValue, Boolean invalidValue)
//package com.java2s; //License from project: Apache License import org.w3c.dom.*; public class Main { public static Boolean parseBoolean(String xmlAttributeValue, Boolean invalidValue) { if (xmlAttributeValue == null) return invalidValue; if (xmlAttributeValue.equals(Boolean.TRUE.toString())) { return Boolean.TRUE; } else if (xmlAttributeValue.equals(Boolean.FALSE.toString())) { return Boolean.FALSE; } else {//ww w . j a v a2s. c o m return invalidValue; } } public static Boolean parseBoolean(Node xmlAttribute, boolean invalidValue) { if (xmlAttribute == null) return invalidValue ? Boolean.TRUE : Boolean.FALSE; return parseBoolean(xmlAttribute.getNodeValue(), invalidValue); } public static Boolean parseBoolean(Node xmlAttribute, Boolean invalidValue) { if (xmlAttribute == null) return invalidValue; return parseBoolean(xmlAttribute.getNodeValue(), invalidValue); } public static Boolean parseBoolean(String xmlAttributeValue, boolean invalidValue) { return parseBoolean(xmlAttributeValue, invalidValue ? Boolean.TRUE : Boolean.FALSE); } }