Package org.jsoup.nodes
Class Entities
java.lang.Object
org.jsoup.nodes.Entities
HTML entities, and escape routines. Source: W3C
HTML named character references.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enumstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final char[](package private) static final intprivate static Document.OutputSettingsprivate static final intprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidappendEncoded(Appendable accum, Entities.EscapeMode escapeMode, int codePoint) private static booleancanEncode(Entities.CoreCharset charset, char c, CharsetEncoder fallback) static intcodepointsForName(String name, int[] codepoints) (package private) static voidescape(Appendable accum, String string, Document.OutputSettings out, boolean inAttribute, boolean normaliseWhite, boolean stripLeadingWhite, boolean trimTrailing) static StringHTML escape an input string, using the default settings (UTF-8, base entities).static Stringescape(String string, Document.OutputSettings out) HTML escape an input string.static StringGet the character(s) represented by the named entitystatic booleanisBaseNamedEntity(String name) Check if the input is a known named entity in the base entity set.static booleanisNamedEntity(String name) Check if the input is a known named entityprivate static voidload(Entities.EscapeMode e, String pointsData, int size) static StringUn-escape an HTML escaped string.(package private) static StringUnescape the input string.
-
Field Details
-
empty
private static final int empty- See Also:
-
emptyName
- See Also:
-
codepointRadix
static final int codepointRadix- See Also:
-
codeDelims
private static final char[] codeDelims -
multipoints
-
DefaultOutput
-
-
Constructor Details
-
Entities
private Entities()
-
-
Method Details
-
isNamedEntity
Check if the input is a known named entity- Parameters:
name- the possible entity name (e.g. "lt" or "amp")- Returns:
- true if a known named entity
-
isBaseNamedEntity
Check if the input is a known named entity in the base entity set.- Parameters:
name- the possible entity name (e.g. "lt" or "amp")- Returns:
- true if a known named entity in the base set
- See Also:
-
getByName
Get the character(s) represented by the named entity- Parameters:
name- entity (e.g. "lt" or "amp")- Returns:
- the string value of the character(s) represented by this entity, or "" if not defined
-
codepointsForName
-
escape
HTML escape an input string. That is,<is returned as<- Parameters:
string- the un-escaped string to escapeout- the output settings to use- Returns:
- the escaped string
-
escape
HTML escape an input string, using the default settings (UTF-8, base entities). That is,<is returned as<- Parameters:
string- the un-escaped string to escape- Returns:
- the escaped string
-
escape
static void escape(Appendable accum, String string, Document.OutputSettings out, boolean inAttribute, boolean normaliseWhite, boolean stripLeadingWhite, boolean trimTrailing) throws IOException - Throws:
IOException
-
appendEncoded
private static void appendEncoded(Appendable accum, Entities.EscapeMode escapeMode, int codePoint) throws IOException - Throws:
IOException
-
unescape
Un-escape an HTML escaped string. That is,<is returned as<.- Parameters:
string- the HTML string to un-escape- Returns:
- the unescaped string
-
unescape
Unescape the input string.- Parameters:
string- to un-HTML-escapestrict- if "strict" (that is, requires trailing ';' char, otherwise that's optional)- Returns:
- unescaped string
-
canEncode
-
load
-