-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHtmlUtils.java
More file actions
26 lines (24 loc) · 757 Bytes
/
Copy pathHtmlUtils.java
File metadata and controls
26 lines (24 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
* Classe utilitária para operações relacionadas a tags HTML.
*/
public class HtmlUtils {
/**
* Verifica se a linha representa uma tag de abertura (ex: <div>).
* @param line Linha do HTML.
* @return true se for uma tag de abertura.
*/
public static boolean isOpeningTag(String line) {
return line.startsWith("<") &&
line.endsWith(">") &&
!line.startsWith("</");
}
/**
* Verifica se a linha representa uma tag de fechamento (ex: </div>).
* @param line Linha do HTML.
* @return true se for uma tag de fechamento.
*/
public static boolean isClosingTag(String line) {
return line.startsWith("</") &&
line.endsWith(">");
}
}