kom.tools.web
Class HTMLTools

java.lang.Object
  |
  +--kom.tools.web.HTMLTools

public class HTMLTools
extends java.lang.Object

This class contains helpful HTML methods


Constructor Summary
HTMLTools()
           
 
Method Summary
private static byte ascii2Hex(char c)
          Converts an ASCII char [0-9a-fA-F] to binary equivalent (0-15)
static java.lang.String ascii2html(java.lang.String asciiString)
          Converts string to HTML format by replacing special characters with entities.
static java.lang.String ascii2url(java.lang.String s)
          Converts ASCII string to URL
static java.lang.String url2ascii(java.lang.String us)
          Converts the URL-encoded input to ASCII
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

HTMLTools

public HTMLTools()
Method Detail

ascii2Hex

private static final byte ascii2Hex(char c)
Converts an ASCII char [0-9a-fA-F] to binary equivalent (0-15)
Parameters:
c - The ASCII character
Returns:
The integer representation of the input character as a byte
Throws:
Error("ascii - to hex failed: dd")

ascii2url

public static java.lang.String ascii2url(java.lang.String s)
Converts ASCII string to URL
Parameters:
s - The ASCII input string
Returns:
The converted string as URL-encoded data

url2ascii

public static java.lang.String url2ascii(java.lang.String us)
Converts the URL-encoded input to ASCII
Parameters:
us - The URL-encoded input data
Returns:
The ASCII representation

ascii2html

public static java.lang.String ascii2html(java.lang.String asciiString)
Converts string to HTML format by replacing special characters with entities.
Parameters:
asciiString - The ASCII input string
Returns:
The converted string (null if input is null)