本文整理汇总了Java中org.htmlcleaner.TagNode.getChildTags方法的典型用法代码示例。如果您正苦于以下问题:Java TagNode.getChildTags方法的具体用法?Java TagNode.getChildTags怎么用?Java TagNode.getChildTags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.htmlcleaner.TagNode
的用法示例。
在下文中一共展示了TagNode.getChildTags方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readNode
import org.htmlcleaner.TagNode; //导入方法依赖的package包/类
private void readNode(Object node, Table table) {
if (node instanceof TagNode) {
TagNode tagNode = (TagNode) node;
if (tagNode.getName().equals("td") || tagNode.getName().equals("th")) {
Spanned result = this.getSpanner().fromTagNode(tagNode);
table.addCell(result);
return;
}
if (tagNode.getName().equals("tr")) {
table.addRow();
}
for (Object child : tagNode.getChildTags()) {
readNode(child, table);
}
}
}
示例2: recursiveArchive
import org.htmlcleaner.TagNode; //导入方法依赖的package包/类
final private void recursiveArchive(TagNode node, Set<TagNode> disableScriptNodeSet,
Map<TagNode, WebElement> iframeNodeMap)
throws ClientProtocolException, IllegalStateException, IOException, SearchLibException, URISyntaxException,
ParserConfigurationException, SAXException {
if (node == null)
return;
checkBaseHref(node);
if (!downloadObjectIframe(node, iframeNodeMap))
if (!downloadObjectSrc(node))
downloadObjectLink(node);
checkStyleCSS(node);
checkScriptContent(node, disableScriptNodeSet);
checkStyleAttribute(node);
TagNode[] nodes = node.getChildTags();
if (nodes == null)
return;
for (TagNode n : nodes)
recursiveArchive(n, disableScriptNodeSet, iframeNodeMap);
}
示例3: beforeChildren
import org.htmlcleaner.TagNode; //导入方法依赖的package包/类
@Override public void beforeChildren(TagNode node, SpannableStringBuilder builder) {
TodoItems todoItem = null;
if (node.getChildTags() != null && node.getChildTags().length > 0) {
for (TagNode tagNode : node.getChildTags()) {
Logger.e(tagNode.getName(), tagNode.getText());
if (tagNode.getName() != null && tagNode.getName().equals("input")) {
todoItem = new TodoItems();
todoItem.isChecked = tagNode.getAttributeByName("checked") != null;
break;
}
}
}
if ("ol".equals(getParentName(node))) {
builder.append(String.valueOf(getMyIndex(node))).append(". ");
} else if ("ul".equals(getParentName(node))) {
if (todoItem != null) {
if (checked == null || unchecked == null) {
builder.append(todoItem.isChecked ? "☑" : "☐");
} else {
builder.append(SpannableBuilder.builder()
.append(todoItem.isChecked ? checked : unchecked))
.append(" ");
}
} else {
builder.append("\u2022 ");
}
}
}
示例4: process
import org.htmlcleaner.TagNode; //导入方法依赖的package包/类
public ArrayList<TimeformResult> process(ResultsTable resultsTable) {
ArrayList<TagNode> runnerResults =
getTagsEquals(resultsTable.root, "tr", attributes);
ArrayList<TimeformResult> toRet = new ArrayList<TimeformResult>();
for (TagNode tn2 : runnerResults) {
TagNode[] nodes = tn2.getChildTags();
String positionStr = getContents(nodes[0]);
String drawStr = getContents(nodes[1]);
String distStr = getContents(nodes[2]);
String horseName = getContents(nodes[3]);
String ageStr = getContents(nodes[4]);
String weightStr = getContents(nodes[5]);
String eqp = getContents(nodes[6]);
TagNode[] jtNodes = nodes[7].getChildTags();
String jockey = getContents(jtNodes[0]);
String trainer = getContents(jtNodes[1]);
String inPlayHighStr = getContents(nodes[8]);
String inPlayLowStr = getContents(nodes[9]);
String bspStr = getContents(nodes[10]);
String ispStr = getContents(nodes[11]);
String placeStr = getContents(nodes[13]);
Integer position = getPosition(positionStr);
Integer draw = safeParseInt(drawStr);
Integer dist = getDist(distStr);
Integer age = safeParseInt(ageStr);
Integer weight = getWeight(weightStr);
Double inPlayHigh = safeParseDouble(inPlayHighStr);
Double inPlayLow = safeParseDouble(inPlayLowStr);
Double bsp = safeParseDouble(bspStr);
Double isp = safeParseDouble(ispStr);
Double place = safeParseDouble(placeStr);
Horse horse = HorseFactory.getFactory().getFromNameAndAgeOnDate(
horseName, age, resultsTable.race.getScheduled());
if (position == null) {
LOG.error("Not processed due to null position: "
+ resultsTable.race.getRacecourse()
+ " " + sdf.format(resultsTable.race.getScheduled()));
return new ArrayList<TimeformResult>();
}
toRet.add(new TimeformResult(resultsTable.race, position, draw,
dist, horse, weight, eqp, jockey, trainer, inPlayHigh,
inPlayLow, bsp, isp, place));
}
int count = TimeformResultFactory.getFactory(
).getResultCount(resultsTable.race);
if (count == 0) {
try {
for (TimeformResult tr : toRet)
TimeformResultFactory.getFactory().save(tr);
}
catch (SQLException sqle) {
DatabaseConduit.printSQLException(sqle);
}
}
return toRet;
}