Java Doc for CharacterReference.java in  » HTML-Parser » jericho-html » au » id » jericho » lib » html » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » HTML Parser » jericho html » au.id.jericho.lib.html 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   au.id.jericho.lib.html.Segment
      au.id.jericho.lib.html.CharacterReference

All known Subclasses:   au.id.jericho.lib.html.NumericCharacterReference,  au.id.jericho.lib.html.CharacterEntityReference,
CharacterReference
abstract public class CharacterReference extends Segment (Code)
Represents an HTML Character Reference, implemented by the subclasses CharacterEntityReference and NumericCharacterReference .

This class, together with its subclasses, contains static methods to perform most required operations without having to instantiate an object.

Instances of this class are useful when the positions of character references in a source document are required, or to replace the found character references with customised text.

CharacterReference instances are obtained using one of the following methods:



Field Summary
final public static  intINVALID_CODE_POINT
     Represents an invalid unicode code point.
final static  intMAX_CODE_POINT
     The maximum codepoint allowed by unicode, 0x10FFFF (decimal 1114111).
static  intMAX_ENTITY_REFERENCE_LENGTH
    
 intcodePoint
    

Constructor Summary
 CharacterReference(Source source, int begin, int end, int codePoint)
    

Method Summary
final static  StringBufferappendDecimalCharacterReferenceString(StringBuffer sb, int codePoint)
    
static  StringBufferappendEncode(StringBuffer sb, CharSequence unencodedText, boolean whiteSpaceFormatting)
    
final static  StringBufferappendHexadecimalCharacterReferenceString(StringBuffer sb, int codePoint)
    
final static  StringBufferappendUnicodeText(StringBuffer sb, int codePoint)
    
public static  Stringdecode(CharSequence encodedText)
     Decodes the specified HTML encoded text into normal text.

All and are converted to their respective characters.

This is equivalent to CharacterReference.decode(CharSequence,boolean) decode(encodedText,false) .

Unterminated character references are dealt with according to the rules for text outside of attribute values in the .

Although character entity reference names are case sensitive, and in some cases differ from other entity references only by their case, some browsers also recognise them in a case-insensitive way. For this reason, all decoding methods in this library recognise character entity reference names even if they are in the wrong case.
Parameters:
  encodedText - the text to decode.

public static  Stringdecode(CharSequence encodedText, boolean insideAttributeValue)
     Decodes the specified HTML encoded text into normal text.

All and are converted to their respective characters.

Unterminated character references are dealt with according to the value of the insideAttributeValue parameter and the .

Although character entity reference names are case sensitive, and in some cases differ from other entity references only by their case, some browsers also recognise them in a case-insensitive way. For this reason, all decoding methods in this library recognise character entity reference names even if they are in the wrong case.
Parameters:
  encodedText - the text to decode.
Parameters:
  insideAttributeValue - specifies whether the encoded text is inside an attribute value.

public static  StringdecodeCollapseWhiteSpace(CharSequence text)
     the specified text after collapsing its .
static  StringdecodeCollapseWhiteSpace(CharSequence text, boolean convertNonBreakingSpaces)
    
public static  Stringencode(CharSequence unencodedText)
     Encodes the specified text, escaping special characters into character references.

Each character is encoded only if the CharacterReference.requiresEncoding(char) method would return true for that character, using its CharacterEntityReference if available, or a decimal NumericCharacterReference if its unicode code point is greater than U+007F.

The only exception to this is an (U+0027), which depending on the current setting of the static Config.IsApostropheEncoded property, is either left unencoded (default setting), or encoded as the numeric character reference "'".

This method never encodes an apostrophe into its character entity reference CharacterEntityReference._apos ' as this entity is not defined for use in HTML.

public static  Stringencode(char ch)
     Encodes the specified character into a character reference if .

The encoding of the character follows the same rules as for each character in the CharacterReference.encode(CharSequence unencodedText) method.
Parameters:
  ch - the character to encode.

public static  StringencodeWithWhiteSpaceFormatting(CharSequence unencodedText)
     the specified text, preserving line breaks, tabs and spaces for rendering by converting them to markup.

This performs the same encoding as the CharacterReference.encode(CharSequence) method, but also performs the following conversions:

  • Line breaks, being Carriage Return (U+000D) or Line Feed (U+000A) characters, and Form Feed characters (U+000C) are converted to "<br />".
static  CharacterReferencefindPreviousOrNext(Source source, int pos, boolean previous)
    
public  chargetChar()
     Returns the character represented by this character reference.
abstract public  StringgetCharacterReferenceString()
     Returns the encoded form of this character reference.
public static  StringgetCharacterReferenceString(int codePoint)
     Returns the encoded form of the specified unicode code point.

This method returns the encoded form of the unicode code point if one exists, otherwise it returns the encoded form.

The only exception to this is an (U+0027), which is encoded as the numeric character reference "&#39;" instead of its character entity reference "&apos;".

Examples:
CharacterReference.getCharacterReferenceString(62) returns "&gt;"
CharacterReference.getCharacterReferenceString('>') returns "&gt;"
CharacterReference.getCharacterReferenceString('☺') returns "&#9786;"

Parameters:
  codePoint - the unicode code point to encode.
public  intgetCodePoint()
     Returns the unicode code point represented by this character reference.
public static  intgetCodePointFromCharacterReferenceString(CharSequence characterReferenceText)
     Parses a single encoded character reference text into a unicode code point.

The character reference must be at the start of the given text, but may contain other characters at the end.

If the text does not represent a valid character reference, this method returns CharacterReference.INVALID_CODE_POINT .

This is equivalent to CharacterReference.parse(CharSequence) parse(characterReferenceText) . CharacterReference.getCodePoint() , except that it returns CharacterReference.INVALID_CODE_POINT if an invalid character reference is specified instead of throwing a NullPointerException.

Example:
CharacterReference.getCodePointFromCharacterReferenceString("&gt;") returns 38

Parameters:
  characterReferenceText - the text containing a single encoded character reference.
public  StringgetDecimalCharacterReferenceString()
     Returns the decimal encoded form of this character reference.
public static  StringgetDecimalCharacterReferenceString(int codePoint)
     Returns the decimal encoded form of the specified unicode code point.

Example:
CharacterReference.getDecimalCharacterReferenceString('>') returns "&#62;"

Parameters:
  codePoint - the unicode code point to encode.
public static  WritergetEncodingFilterWriter(Writer writer)
     Returns a filter Writer that all text before passing it through to the specified Writer.
public  StringgetHexadecimalCharacterReferenceString()
     Returns the hexadecimal encoded form of this character reference.
public static  StringgetHexadecimalCharacterReferenceString(int codePoint)
     Returns the hexadecimal encoded form of the specified unicode code point.

Example:
CharacterReference.getHexadecimalCharacterReferenceString('>') returns "&#x3e;"

Parameters:
  codePoint - the unicode code point to encode.
public  StringgetUnicodeText()
     Returns the unicode code point of this character reference in U+ notation.
public static  StringgetUnicodeText(int codePoint)
     Returns the specified unicode code point in U+ notation.

Example:
CharacterReference.getUnicodeText('>') returns "U+003E"

Parameters:
  codePoint - the unicode code point.
public  booleanisTerminated()
     Indicates whether this character reference is terminated by a semicolon (;).
public static  CharacterReferenceparse(CharSequence characterReferenceText)
     Parses a single encoded character reference text into a CharacterReference object.

The character reference must be at the start of the given text, but may contain other characters at the end. The CharacterReference.getEnd() getEnd() method can be used on the resulting object to determine at which character position the character reference ended.

If the text does not represent a valid character reference, this method returns null.

Unterminated character references are always accepted, regardless of the settings in the .

To decode all character references in a given text, use the CharacterReference.decode(CharSequence) method instead.

Example:
CharacterReference.parse("&gt;").getChar() returns '>'

Parameters:
  characterReferenceText - the text containing a single encoded character reference.
public static  Stringreencode(CharSequence encodedText)
     Re-encodes the specified text, equivalent to and then again.

This process ensures that the specified encoded text does not contain any remaining unencoded characters.

IMPLEMENTATION NOTE: At present this method simply calls the CharacterReference.decode(CharSequence) decode method followed by the CharacterReference.encode(CharSequence) encode method, but a more efficient implementation may be used in future.
Parameters:
  encodedText - the text to re-encode.

final public static  booleanrequiresEncoding(char ch)
     Indicates whether the specified character would need to be encoded in HTML text.

This is the case if a exists for the character, or the unicode code point is greater than U+007F.

The only exception to this is an (U+0027), which only returns true if the static Config.IsApostropheEncoded property is currently set to true.
Parameters:
  ch - the character to test.


Field Detail
INVALID_CODE_POINT
final public static int INVALID_CODE_POINT(Code)
Represents an invalid unicode code point.

This can be the result of parsing a numeric character reference outside of the valid unicode range of 0x000000-0x10FFFF, or any other invalid character reference.




MAX_CODE_POINT
final static int MAX_CODE_POINT(Code)
The maximum codepoint allowed by unicode, 0x10FFFF (decimal 1114111). This can be replaced by Character.MAX_CODE_POINT in java 1.5



MAX_ENTITY_REFERENCE_LENGTH
static int MAX_ENTITY_REFERENCE_LENGTH(Code)



codePoint
int codePoint(Code)




Constructor Detail
CharacterReference
CharacterReference(Source source, int begin, int end, int codePoint)(Code)




Method Detail
appendDecimalCharacterReferenceString
final static StringBuffer appendDecimalCharacterReferenceString(StringBuffer sb, int codePoint)(Code)



appendEncode
static StringBuffer appendEncode(StringBuffer sb, CharSequence unencodedText, boolean whiteSpaceFormatting)(Code)



appendHexadecimalCharacterReferenceString
final static StringBuffer appendHexadecimalCharacterReferenceString(StringBuffer sb, int codePoint)(Code)



appendUnicodeText
final static StringBuffer appendUnicodeText(StringBuffer sb, int codePoint)(Code)



decode
public static String decode(CharSequence encodedText)(Code)
Decodes the specified HTML encoded text into normal text.

All and are converted to their respective characters.

This is equivalent to CharacterReference.decode(CharSequence,boolean) decode(encodedText,false) .

Unterminated character references are dealt with according to the rules for text outside of attribute values in the .

Although character entity reference names are case sensitive, and in some cases differ from other entity references only by their case, some browsers also recognise them in a case-insensitive way. For this reason, all decoding methods in this library recognise character entity reference names even if they are in the wrong case.
Parameters:
  encodedText - the text to decode. the decoded string.
See Also:   CharacterReference.encode(CharSequence)




decode
public static String decode(CharSequence encodedText, boolean insideAttributeValue)(Code)
Decodes the specified HTML encoded text into normal text.

All and are converted to their respective characters.

Unterminated character references are dealt with according to the value of the insideAttributeValue parameter and the .

Although character entity reference names are case sensitive, and in some cases differ from other entity references only by their case, some browsers also recognise them in a case-insensitive way. For this reason, all decoding methods in this library recognise character entity reference names even if they are in the wrong case.
Parameters:
  encodedText - the text to decode.
Parameters:
  insideAttributeValue - specifies whether the encoded text is inside an attribute value. the decoded string.
See Also:   CharacterReference.decode(CharSequence)
See Also:   CharacterReference.encode(CharSequence)




decodeCollapseWhiteSpace
public static String decodeCollapseWhiteSpace(CharSequence text)(Code)
the specified text after collapsing its .

All leading and trailing white space is omitted, and any sections of internal white space are replaced by a single space.

The result is how the text would normally be rendered by a user agent, assuming it does not contain any tags.

Unterminated character references are dealt with according to the rules for text outside of attribute values in the . See the discussion of the insideAttributeValue parameter of the #decode(CharSequence, boolean insideAttributeValue) method for a more detailed explanation of this topic.
Parameters:
  text - the source text the decoded text with collapsed white space.
See Also:   FormControl.getPredefinedValues




decodeCollapseWhiteSpace
static String decodeCollapseWhiteSpace(CharSequence text, boolean convertNonBreakingSpaces)(Code)



encode
public static String encode(CharSequence unencodedText)(Code)
Encodes the specified text, escaping special characters into character references.

Each character is encoded only if the CharacterReference.requiresEncoding(char) method would return true for that character, using its CharacterEntityReference if available, or a decimal NumericCharacterReference if its unicode code point is greater than U+007F.

The only exception to this is an (U+0027), which depending on the current setting of the static Config.IsApostropheEncoded property, is either left unencoded (default setting), or encoded as the numeric character reference "&#39;".

This method never encodes an apostrophe into its character entity reference CharacterEntityReference._apos &apos; as this entity is not defined for use in HTML. See the comments in the CharacterEntityReference class for more information.

To encode text using only numeric character references, use the
NumericCharacterReference.encode(CharSequence) method instead.
Parameters:
  unencodedText - the text to encode. the encoded string.
See Also:   CharacterReference.decode(CharSequence)




encode
public static String encode(char ch)(Code)
Encodes the specified character into a character reference if .

The encoding of the character follows the same rules as for each character in the CharacterReference.encode(CharSequence unencodedText) method.
Parameters:
  ch - the character to encode. a character reference if appropriate, otherwise a string containing the original character.




encodeWithWhiteSpaceFormatting
public static String encodeWithWhiteSpaceFormatting(CharSequence unencodedText)(Code)
the specified text, preserving line breaks, tabs and spaces for rendering by converting them to markup.

This performs the same encoding as the CharacterReference.encode(CharSequence) method, but also performs the following conversions:

  • Line breaks, being Carriage Return (U+000D) or Line Feed (U+000A) characters, and Form Feed characters (U+000C) are converted to "<br />". CR/LF pairs are treated as a single line break.
  • Multiple consecutive spaces are converted so that every second space is converted to "&nbsp;" while ensuring the last is always a normal space.
  • Tab characters (U+0009) are converted as if they were four consecutive spaces.

The conversion of multiple consecutive spaces to alternating space/non-breaking-space allows the correct number of spaces to be rendered, but also allows the line to wrap in the middle of it.

Note that zero-width spaces (U+200B) are converted to the numeric character reference "&#x200B;" through the normal encoding process, but IE6 does not render them properly either encoded or unencoded.

There is no method provided to reverse this encoding.
Parameters:
  unencodedText - the text to encode. the encoded string with whitespace formatting converted to markup.
See Also:   CharacterReference.encode(CharSequence)




findPreviousOrNext
static CharacterReference findPreviousOrNext(Source source, int pos, boolean previous)(Code)



getChar
public char getChar()(Code)
Returns the character represented by this character reference.

If this character reference represents a unicode supplimentary code point, any bits outside of the least significant 16 bits of the code point are truncated, yielding an incorrect result. the character represented by this character reference.




getCharacterReferenceString
abstract public String getCharacterReferenceString()(Code)
Returns the encoded form of this character reference.

The exact behaviour of this method depends on the class of this object. See the CharacterEntityReference.getCharacterReferenceString and NumericCharacterReference.getCharacterReferenceString methods for more details.

Examples:
CharacterReference.parse("&GT;").getCharacterReferenceString() returns "&gt;"
CharacterReference.parse("&#x3E;").getCharacterReferenceString() returns "&#3e;"
the encoded form of this character reference.
See Also:   CharacterReference.getCharacterReferenceString(int codePoint)
See Also:   CharacterReference.getDecimalCharacterReferenceString()



getCharacterReferenceString
public static String getCharacterReferenceString(int codePoint)(Code)
Returns the encoded form of the specified unicode code point.

This method returns the encoded form of the unicode code point if one exists, otherwise it returns the encoded form.

The only exception to this is an (U+0027), which is encoded as the numeric character reference "&#39;" instead of its character entity reference "&apos;".

Examples:
CharacterReference.getCharacterReferenceString(62) returns "&gt;"
CharacterReference.getCharacterReferenceString('>') returns "&gt;"
CharacterReference.getCharacterReferenceString('☺') returns "&#9786;"

Parameters:
  codePoint - the unicode code point to encode. the encoded form of the specified unicode code point.
See Also:   CharacterReference.getHexadecimalCharacterReferenceString(int codePoint)



getCodePoint
public int getCodePoint()(Code)
Returns the unicode code point represented by this character reference. the unicode code point represented by this character reference.



getCodePointFromCharacterReferenceString
public static int getCodePointFromCharacterReferenceString(CharSequence characterReferenceText)(Code)
Parses a single encoded character reference text into a unicode code point.

The character reference must be at the start of the given text, but may contain other characters at the end.

If the text does not represent a valid character reference, this method returns CharacterReference.INVALID_CODE_POINT .

This is equivalent to CharacterReference.parse(CharSequence) parse(characterReferenceText) . CharacterReference.getCodePoint() , except that it returns CharacterReference.INVALID_CODE_POINT if an invalid character reference is specified instead of throwing a NullPointerException.

Example:
CharacterReference.getCodePointFromCharacterReferenceString("&gt;") returns 38

Parameters:
  characterReferenceText - the text containing a single encoded character reference. the unicode code point representing representing the specified text, or CharacterReference.INVALID_CODE_POINT if the text does not represent a valid character reference.



getDecimalCharacterReferenceString
public String getDecimalCharacterReferenceString()(Code)
Returns the decimal encoded form of this character reference.

This is equivalent to CharacterReference.getDecimalCharacterReferenceString(int) getDecimalCharacterReferenceString ( CharacterReference.getCodePoint() ).

Example:
CharacterReference.parse("&gt;").getDecimalCharacterReferenceString() returns "&#62;"
the decimal encoded form of this character reference.
See Also:   CharacterReference.getCharacterReferenceString()
See Also:   CharacterReference.getHexadecimalCharacterReferenceString()



getDecimalCharacterReferenceString
public static String getDecimalCharacterReferenceString(int codePoint)(Code)
Returns the decimal encoded form of the specified unicode code point.

Example:
CharacterReference.getDecimalCharacterReferenceString('>') returns "&#62;"

Parameters:
  codePoint - the unicode code point to encode. the decimal encoded form of the specified unicode code point.
See Also:   CharacterReference.getCharacterReferenceString(int codePoint)
See Also:   CharacterReference.getHexadecimalCharacterReferenceString(int codePoint)



getEncodingFilterWriter
public static Writer getEncodingFilterWriter(Writer writer)(Code)
Returns a filter Writer that all text before passing it through to the specified Writer.
Parameters:
  writer - the destination for the encoded text a filter Writer that all text before passing it through to the specified Writer.
See Also:   CharacterReference.encode(CharSequence unencodedText)



getHexadecimalCharacterReferenceString
public String getHexadecimalCharacterReferenceString()(Code)
Returns the hexadecimal encoded form of this character reference.

This is equivalent to CharacterReference.getHexadecimalCharacterReferenceString(int) getHexadecimalCharacterReferenceString ( CharacterReference.getCodePoint() ).

Example:
CharacterReference.parse("&gt;").getHexadecimalCharacterReferenceString() returns "&#x3e;"
the hexadecimal encoded form of this character reference.
See Also:   CharacterReference.getCharacterReferenceString()
See Also:   CharacterReference.getDecimalCharacterReferenceString()



getHexadecimalCharacterReferenceString
public static String getHexadecimalCharacterReferenceString(int codePoint)(Code)
Returns the hexadecimal encoded form of the specified unicode code point.

Example:
CharacterReference.getHexadecimalCharacterReferenceString('>') returns "&#x3e;"

Parameters:
  codePoint - the unicode code point to encode. the hexadecimal encoded form of the specified unicode code point.
See Also:   CharacterReference.getCharacterReferenceString(int codePoint)
See Also:   CharacterReference.getDecimalCharacterReferenceString(int codePoint)



getUnicodeText
public String getUnicodeText()(Code)
Returns the unicode code point of this character reference in U+ notation.

This is equivalent to CharacterReference.getUnicodeText(int) getUnicodeText(getCodePoint()) .

Example:
CharacterReference.parse("&gt;").getUnicodeText() returns "U+003E"
the unicode code point of this character reference in U+ notation.
See Also:   CharacterReference.getUnicodeText(int codePoint)



getUnicodeText
public static String getUnicodeText(int codePoint)(Code)
Returns the specified unicode code point in U+ notation.

Example:
CharacterReference.getUnicodeText('>') returns "U+003E"

Parameters:
  codePoint - the unicode code point. the specified unicode code point in U+ notation.



isTerminated
public boolean isTerminated()(Code)
Indicates whether this character reference is terminated by a semicolon (;).

Conversely, this library defines an unterminated character reference as one which does not end with a semicolon.

The SGML specification allows unterminated character references in some circumstances, and because the HTML 4.01 specification states simply that "authors may use SGML character references", it follows that they are also valid in HTML documents, although their use is strongly discouraged.

Unterminated character references are not allowed in XHTML documents. true if this character reference is terminated by a semicolon, otherwise false.
See Also:   CharacterReference.decode(CharSequence encodedText,boolean insideAttributeValue)




parse
public static CharacterReference parse(CharSequence characterReferenceText)(Code)
Parses a single encoded character reference text into a CharacterReference object.

The character reference must be at the start of the given text, but may contain other characters at the end. The CharacterReference.getEnd() getEnd() method can be used on the resulting object to determine at which character position the character reference ended.

If the text does not represent a valid character reference, this method returns null.

Unterminated character references are always accepted, regardless of the settings in the .

To decode all character references in a given text, use the CharacterReference.decode(CharSequence) method instead.

Example:
CharacterReference.parse("&gt;").getChar() returns '>'

Parameters:
  characterReferenceText - the text containing a single encoded character reference. a CharacterReference object representing the specified text, or null if the text does not represent a valid character reference.
See Also:   CharacterReference.decode(CharSequence)



reencode
public static String reencode(CharSequence encodedText)(Code)
Re-encodes the specified text, equivalent to and then again.

This process ensures that the specified encoded text does not contain any remaining unencoded characters.

IMPLEMENTATION NOTE: At present this method simply calls the CharacterReference.decode(CharSequence) decode method followed by the CharacterReference.encode(CharSequence) encode method, but a more efficient implementation may be used in future.
Parameters:
  encodedText - the text to re-encode. the re-encoded string.




requiresEncoding
final public static boolean requiresEncoding(char ch)(Code)
Indicates whether the specified character would need to be encoded in HTML text.

This is the case if a exists for the character, or the unicode code point is greater than U+007F.

The only exception to this is an (U+0027), which only returns true if the static Config.IsApostropheEncoded property is currently set to true.
Parameters:
  ch - the character to test. true if the specified character would need to be encoded in HTML text, otherwise false.




Fields inherited from au.id.jericho.lib.html.Segment
final int begin(Code)(Java Doc)
List childElements(Code)(Java Doc)
final int end(Code)(Java Doc)
final Source source(Code)(Java Doc)

Methods inherited from au.id.jericho.lib.html.Segment
final static StringBuffer appendCollapseWhiteSpace(StringBuffer sb, CharSequence text)(Code)(Java Doc)
final public char charAt(int index)(Code)(Java Doc)
public int compareTo(Object o)(Code)(Java Doc)
final public boolean encloses(Segment segment)(Code)(Java Doc)
final public boolean encloses(int pos)(Code)(Java Doc)
final public boolean equals(Object object)(Code)(Java Doc)
public String extractText()(Code)(Java Doc)
public String extractText(boolean includeAttributes)(Code)(Java Doc)
public List findAllCharacterReferences()(Code)(Java Doc)
public List findAllElements()(Code)(Java Doc)
public List findAllElements(String name)(Code)(Java Doc)
public List findAllElements(StartTagType startTagType)(Code)(Java Doc)
public List findAllElements(String attributeName, String value, boolean valueCaseSensitive)(Code)(Java Doc)
public List findAllStartTags()(Code)(Java Doc)
public List findAllStartTags(String name)(Code)(Java Doc)
public List findAllStartTags(String attributeName, String value, boolean valueCaseSensitive)(Code)(Java Doc)
public List findAllTags()(Code)(Java Doc)
public List findAllTags(TagType tagType)(Code)(Java Doc)
public List findFormControls()(Code)(Java Doc)
public FormFields findFormFields()(Code)(Java Doc)
final public int getBegin()(Code)(Java Doc)
public List getChildElements()(Code)(Java Doc)
public String getDebugInfo()(Code)(Java Doc)
final public int getEnd()(Code)(Java Doc)
public Renderer getRenderer()(Code)(Java Doc)
public TextExtractor getTextExtractor()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public void ignoreWhenParsing()(Code)(Java Doc)
final public boolean isWhiteSpace()(Code)(Java Doc)
final public static boolean isWhiteSpace(char ch)(Code)(Java Doc)
final public int length()(Code)(Java Doc)
public Attributes parseAttributes()(Code)(Java Doc)
final public CharSequence subSequence(int beginIndex, int endIndex)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.