Java Swing HTML hasClass(AttributeSet attr, String className)

Here you can find the source of hasClass(AttributeSet attr, String className)

Description

has Class

License

LGPL

Declaration

public static boolean hasClass(AttributeSet attr, String className) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import javax.swing.text.AttributeSet;

import javax.swing.text.html.HTML.Attribute;

public class Main {
    public static boolean hasClass(AttributeSet attr, String className) {

        String classValue = (String) attr.getAttribute(Attribute.CLASS);

        if (classValue == null) {
            return false;
        }// w w w.jav a2 s . c  o  m

        String[] classNames = classValue.split(" ");
        for (String c : classNames) {
            if (c.equals(className)) {
                return true;
            }
        }

        return false;
    }
}

Related

  1. findLinkElementUp(Element elem)
  2. findLinkUp(Element elem)
  3. getHTMLFromXML(String xml, URL xsl)
  4. getImgs(final String html)
  5. getRowIndex(final Element cell)
  6. htmlToPlain(String html)
  7. isUnderline(Element element)
  8. loadStyleSheet(URL url)
  9. makeStyleSheet(String name)