Java Doc for TidyUtils.java in  » HTML-Parser » JTidy » org » w3c » tidy » 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 » JTidy » org.w3c.tidy 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.w3c.tidy.TidyUtils

TidyUtils
final public class TidyUtils (Code)
Utility class with handy methods, mainly for String handling or for reproducing c behaviours.
author:
   Fabrizio Giustina
version:
   $Revision $ ($Author $)




Method Summary
public static  booleanfindBadSubString(String s, String p, int len)
     Return true if substring s is in p and isn't all in upper case.
public static  charfoldCase(char c, boolean tocaps, boolean xmlTags)
     Fold case of a char.
public static  byte[]getBytes(String str)
     Should always be able convert to/from UTF-8, so encoding exceptions are converted to an Error to avoid adding throws declarations in lots of methods.
public static  StringgetString(byte[] bytes, int offset, int length)
     Should always be able convert to/from UTF-8, so encoding exceptions are converted to an Error to avoid adding throws declarations in lots of methods.
public static  booleanisCharEncodingSupported(String name)
    
public static  booleanisDigit(char c)
    
static  booleanisInValuesIgnoreCase(String[] validValues, String valueToCheck)
     Check if the string valueToCheck is contained in validValues array (case insesitie comparison).
public static  booleanisLetter(char c)
    
public static  booleanisLower(char c)
     Determines if the specified character is a lowercase character.
public static  booleanisNamechar(char c)
    
static  booleanisQuote(int c)
    
public static  booleanisUpper(char c)
     Determines if the specified character is a uppercase character.
public static  booleanisWhite(char c)
     Determines if the specified character is whitespace.
static  booleanisXMLLetter(char c)
    
static  booleanisXMLNamechar(char c)
    
static  booleanisxdigit(char c)
    
public static  intlastChar(String str)
     Return the last char in string.
static  booleantoBoolean(int value)
     Converts a int to a boolean.
public static  chartoLower(char c)
     Maps the given character to its lowercase equivalent.
static  inttoUnsigned(int c)
     convert an int to unsigned (& 0xFF).
public static  chartoUpper(char c)
     Maps the given character to its uppercase equivalent.
static  intwstrnchr(String s1, int len1, char cc)
     return offset of cc from beginning of s1, -1 if not found.
static  booleanwsubstr(String s1, String s2)
     Same as wsubstrn, but without a specified length.
static  booleanwsubstrn(String s1, int len1, String s2)
     check if the first String contains the second one.
static  booleanwsubstrncase(String s1, int len1, String s2)
     check if the first String contains the second one (ignore case).



Method Detail
findBadSubString
public static boolean findBadSubString(String s, String p, int len)(Code)
Return true if substring s is in p and isn't all in upper case. This is used to check the case of SYSTEM, PUBLIC, DTD and EN.
Parameters:
  s - substring
Parameters:
  p - full string
Parameters:
  len - how many chars to check in p true if substring s is in p and isn't all in upper case



foldCase
public static char foldCase(char c, boolean tocaps, boolean xmlTags)(Code)
Fold case of a char.
Parameters:
  c - char
Parameters:
  tocaps - convert to caps
Parameters:
  xmlTags - use xml tags? If true no change will be performed folded char



getBytes
public static byte[] getBytes(String str)(Code)
Should always be able convert to/from UTF-8, so encoding exceptions are converted to an Error to avoid adding throws declarations in lots of methods.
Parameters:
  str - String utf8 bytes
See Also:   String.getBytes



getString
public static String getString(byte[] bytes, int offset, int length)(Code)
Should always be able convert to/from UTF-8, so encoding exceptions are converted to an Error to avoid adding throws declarations in lots of methods.
Parameters:
  bytes - byte array
Parameters:
  offset - starting offset in byte array
Parameters:
  length - length in byte array starting from offset same as new String(bytes, offset, length, "UTF8")



isCharEncodingSupported
public static boolean isCharEncodingSupported(String name)(Code)
Is the given character encoding supported?
Parameters:
  name - character encoding name true if encoding is supported, false otherwhise.



isDigit
public static boolean isDigit(char c)(Code)
Is the given char a digit?
Parameters:
  c - char true if the given char is a digit



isInValuesIgnoreCase
static boolean isInValuesIgnoreCase(String[] validValues, String valueToCheck)(Code)
Check if the string valueToCheck is contained in validValues array (case insesitie comparison).
Parameters:
  validValues - array of valid values
Parameters:
  valueToCheck - value to search for true if valueToCheck is found in validValues



isLetter
public static boolean isLetter(char c)(Code)
Is the given char a letter?
Parameters:
  c - char true if the given char is a letter



isLower
public static boolean isLower(char c)(Code)
Determines if the specified character is a lowercase character.
Parameters:
  c - char true if char is lower case.



isNamechar
public static boolean isNamechar(char c)(Code)
Is the given char valid in name? (letter, digit or "-", ".", ":", "_")
Parameters:
  c - char true if char is a name char.



isQuote
static boolean isQuote(int c)(Code)
Is the given character a single or double quote?
Parameters:
  c - char true if c is " or '



isUpper
public static boolean isUpper(char c)(Code)
Determines if the specified character is a uppercase character.
Parameters:
  c - char true if char is upper case.



isWhite
public static boolean isWhite(char c)(Code)
Determines if the specified character is whitespace.
Parameters:
  c - char true if char is whitespace.



isXMLLetter
static boolean isXMLLetter(char c)(Code)
Is the given char a valid xml letter?
Parameters:
  c - char true if the char is a valid xml letter



isXMLNamechar
static boolean isXMLNamechar(char c)(Code)
Is the given char valid in xml name?
Parameters:
  c - char true if the char is a valid xml name char



isxdigit
static boolean isxdigit(char c)(Code)
Is the character a hex digit?
Parameters:
  c - char true if he given character is a hex digit



lastChar
public static int lastChar(String str)(Code)
Return the last char in string. This is useful when trailing quotemark is missing on an attribute
Parameters:
  str - String last char in String



toBoolean
static boolean toBoolean(int value)(Code)
Converts a int to a boolean.
Parameters:
  value - int value true if value is != 0



toLower
public static char toLower(char c)(Code)
Maps the given character to its lowercase equivalent.
Parameters:
  c - char lowercase char.



toUnsigned
static int toUnsigned(int c)(Code)
convert an int to unsigned (& 0xFF).
Parameters:
  c - signed int unsigned int



toUpper
public static char toUpper(char c)(Code)
Maps the given character to its uppercase equivalent.
Parameters:
  c - char uppercase char.



wstrnchr
static int wstrnchr(String s1, int len1, char cc)(Code)
return offset of cc from beginning of s1, -1 if not found.
Parameters:
  s1 - String
Parameters:
  len1 - maximum offset (values > than lenl are ignored and returned as -1)
Parameters:
  cc - character to search for index of cc in s1



wsubstr
static boolean wsubstr(String s1, String s2)(Code)
Same as wsubstrn, but without a specified length.
Parameters:
  s1 - full String
Parameters:
  s2 - String to search for true if s2 is found in s2 (case insensitive search)



wsubstrn
static boolean wsubstrn(String s1, int len1, String s2)(Code)
check if the first String contains the second one.
Parameters:
  s1 - full String
Parameters:
  len1 - maximum position in String
Parameters:
  s2 - String to search for true if s1 contains s2 in the range 0-len1



wsubstrncase
static boolean wsubstrncase(String s1, int len1, String s2)(Code)
check if the first String contains the second one (ignore case).
Parameters:
  s1 - full String
Parameters:
  len1 - maximum position in String
Parameters:
  s2 - String to search for true if s1 contains s2 in the range 0-len1



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.