Java Reference
In-Depth Information
System.out.println("Tag:" + getTag());
} else if (ch != -1)
{
text.append((char) ch);
}
} while (ch != -1);
if (text.length() > 0)
{
System.out.println("Text:" + text.toString().trim());
}
return result.toString();
} catch (IOException e)
{
return "[IO Error]";
}
}
/**
* Parse any special characters(i.e. &nbsp);
*
* @return The character that was parsed.
* @throws IOException
* If a read error occurs
*/
private char parseSpecialCharacter() throws IOException
{
char result = (char) this.source.read();
int advanceBy = 0;
// is there a special character?
if (result == '&')
{
int ch = 0;
StringBuilder buffer = new StringBuilder();
// loop through and read special character
do
{
ch = this.source.peek(advanceBy++);
if ((ch != '&') && (ch != ';')
&& !Character.isWhitespace(ch))
{
buffer.append((char) ch);
}
} while ((ch != ';') && (ch != -1) &&
Search WWH ::




Custom Search