| java.lang.Object au.id.jericho.lib.html.Segment au.id.jericho.lib.html.CharacterReference au.id.jericho.lib.html.NumericCharacterReference
NumericCharacterReference | public class NumericCharacterReference extends CharacterReference (Code) | | Represents an HTML Numeric Character Reference.
A numeric character reference can be one of two types:
- Decimal Character Reference
- A numeric character reference specifying the unicode code point in decimal notation.
This is signified by the absence of an 'x ' character after the '# ', (eg "> ").
- Hexadecimal Character Reference
- A numeric character reference specifying the unicode code point in hexadecimal notation.
This is signified by the presence of an 'x ' character after the '# ', (eg "> ").
Static methods to
and
strings
and single characters can be found in the
CharacterReference superclass.
NumericCharacterReference instances are obtained using one of the following methods:
See Also: CharacterReference See Also: CharacterEntityReference |
Method Summary | |
static CharacterReference | construct(Source source, int begin, Config.UnterminatedCharacterReferenceSettings unterminatedCharacterReferenceSettings) | public static String | encode(CharSequence unencodedText) Encodes the specified text, escaping special characters into numeric character references.
Each character is encoded only if the
NumericCharacterReference.requiresEncoding(char) requiresEncoding(char) method would return true for that character.
This method encodes all character references in decimal format, and is exactly the same as calling
NumericCharacterReference.encodeDecimal(CharSequence) .
To encode text using both character entity references and numeric character references, use the
CharacterReference.encode(CharSequence) method instead.
To encode text using hexadecimal character references only,
use the
NumericCharacterReference.encodeHexadecimal(CharSequence) method instead.
Parameters: unencodedText - the text to encode. | public static String | encodeDecimal(CharSequence unencodedText) Encodes the specified text, escaping special characters into decimal character references.
Each character is encoded only if the
NumericCharacterReference.requiresEncoding(char) requiresEncoding(char) method would return true for that character.
To encode text using both character entity references and numeric character references, use the
CharacterReference.encode(CharSequence) method instead.
To encode text using hexadecimal character references only,
use the
NumericCharacterReference.encodeHexadecimal(CharSequence) method instead.
Parameters: unencodedText - the text to encode. | public static String | encodeHexadecimal(CharSequence unencodedText) Encodes the specified text, escaping special characters into hexadecimal character references.
Each character is encoded only if the
NumericCharacterReference.requiresEncoding(char) requiresEncoding(char) method would return true for that character.
To encode text using both character entity references and numeric character references, use the
CharacterReference.encode(CharSequence) method instead.
To encode text using decimal character references only,
use the
NumericCharacterReference.encodeDecimal(CharSequence) method instead.
Parameters: unencodedText - the text to encode. | public String | getCharacterReferenceString() Returns the correct encoded form of this numeric character reference.
The returned string uses the same radix as the original character reference in the source document,
i.e. | public static String | getCharacterReferenceString(int codePoint) Returns the numeric character reference encoded form of the specified unicode code point. | public String | getDebugInfo() | public boolean | isDecimal() Indicates whether this numeric character reference specifies the unicode code point in decimal format. | public boolean | isHexadecimal() Indicates whether this numeric character reference specifies the unicode code point in hexadecimal format. |
isDecimal | public boolean isDecimal()(Code) | | Indicates whether this numeric character reference specifies the unicode code point in decimal format.
A numeric character reference in decimal format is referred to in this library as a
decimal character reference.
true if this numeric character reference specifies the unicode code point in decimal format, otherwise false . See Also: NumericCharacterReference.isHexadecimal() |
isHexadecimal | public boolean isHexadecimal()(Code) | | Indicates whether this numeric character reference specifies the unicode code point in hexadecimal format.
A numeric character reference in hexadecimal format is referred to in this library as a
hexadecimal character reference.
true if this numeric character reference specifies the unicode code point in hexadecimal format, otherwise false . See Also: NumericCharacterReference.isDecimal() |
|
|