Java Reference
In-Depth Information
int ch;
while ((ch = parse.read()) != -1)
{
if (ch == 0)
{
HTMLTag tag = parse.getTag();
if (tag.getName().equalsIgnoreCase("li"))
{
if (buffer.length() > 0)
processItem(buffer.toString());
buffer.setLength(0);
capture = true;
} else if (tag.getName().equalsIgnoreCase("/li"))
{
processItem(buffer.toString());
buffer.setLength(0);
capture = false;
} else if (tag.getName().equalsIgnoreCase(listTypeEnd))
{
processItem(buffer.toString());
break;
}
} else
{
if (capture)
buffer.append((char) ch);
}
}
}
/**
* The main method, create a new instance of the object and call
* process.
* @param args not used.
*/
public static void main(String args[])
{
try
{
FormGET parse = new FormGET();
parse.process("Mi", "s");
} catch (Exception e)
{
e.printStackTrace();
}
Search WWH ::




Custom Search