コード例 #1
0
  /*--------------------------------------------------------------------------*/
  public static boolean attributeIsTrue(IXMLElement element, String name) {
    String value = element.getAttribute(name, "").toUpperCase();

    if (value.equals(YES)) {
      return (true);
    } else if (value.equals(TRUE)) {
      return (true);
    } else if (value.equals(ON)) {
      return (true);
    } else if (value.equals(_1)) {
      return (true);
    }

    return (false);
  }
コード例 #2
0
  /**
   * The Opposit of AttributeIsTrue()
   *
   * @param element the element to inspect
   * @param name the attribute to inspect
   * @return returns true if name attribute of the given element contains "false"
   */
  public static boolean attributeIsFalse(IXMLElement element, String name) {
    String value = element.getAttribute(name, "").toUpperCase();

    if (value.equals("NO")) {
      return (true);
    } else if (value.equals("FALSE")) {
      return (true);
    } else if (value.equals("OFF")) {
      return (true);
    } else if (value.equals("0")) {
      return (true);
    }

    return (false);
  }