當前位置: 首頁>>代碼示例>>Java>>正文


Java Element.attributes方法代碼示例

本文整理匯總了Java中org.jsoup.nodes.Element.attributes方法的典型用法代碼示例。如果您正苦於以下問題:Java Element.attributes方法的具體用法?Java Element.attributes怎麽用?Java Element.attributes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jsoup.nodes.Element的用法示例。


在下文中一共展示了Element.attributes方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isIllegalStringInTag

import org.jsoup.nodes.Element; //導入方法依賴的package包/類
private boolean isIllegalStringInTag(final Element tag){
	final String[] illegalWords = {"advert", "werbung", "anzeige", "adsense"};
	
	if (tag == null){
		return false;
	}
	
	for (final String word : illegalWords) {
		final Attributes tagAttrs = tag.attributes();
		if (tagAttrs != null){
			for(final Attribute attr : tagAttrs){
				if(attr.toString().toLowerCase().contains(word.toLowerCase())){
					return true;
				}
			}
		}else{
			return false;
		}
	}
	return false;
}
 
開發者ID:XMBomb,項目名稱:InComb,代碼行數:22,代碼來源:JSoupTest.java

示例2: readDesign

import org.jsoup.nodes.Element; //導入方法依賴的package包/類
@Override
public void readDesign(Element design, DesignContext designContext) {
  super.readDesign(design, designContext);

  for (Element child : design.children()) {
    Component childComponent = designContext.readDesign(child);
    if (!(childComponent instanceof Step)) {
      throw new IllegalArgumentException("Only implementations of " + Step.class.getName() +
                                         " are allowed as children of " + getClass().getName());
    }

    stepIterator.add(((Step) childComponent));
  }

  boolean linear = false;

  Attributes attributes = design.attributes();
  if (attributes.hasKey(DESIGN_ATTRIBUTE_LINEAR)) {
    linear = DesignAttributeHandler.getFormatter()
                                   .parse(design.attr(DESIGN_ATTRIBUTE_LINEAR), Boolean.class);
  }

  stepIterator.setLinear(linear);
}
 
開發者ID:Juchar,項目名稱:md-stepper,代碼行數:25,代碼來源:AbstractStepper.java

示例3: handle

import org.jsoup.nodes.Element; //導入方法依賴的package包/類
@Override
public void handle(boolean allAttr, String attrKey, Element element, List<SIPNode> ret) {
    if (allAttr) {
        for (Attribute attribute : element.attributes()) {
            ret.add(SIPNode.t(element.absUrl(attribute.getKey())));
        }
    } else {
        String value = element.absUrl(attrKey);
        if (StringUtils.isNotBlank(value)) {
            ret.add(SIPNode.t(value));
        }
    }
}
 
開發者ID:virjar,項目名稱:sipsoup,代碼行數:14,代碼來源:AbsUrlFunction.java

示例4: readDesign

import org.jsoup.nodes.Element; //導入方法依賴的package包/類
@Override
public void readDesign(Element design, DesignContext designContext) {
    super.readDesign(design, designContext);

    Attributes attr = design.attributes();

    if (design.hasAttr("time-zone")) {
        setZoneId(ZoneId.of(DesignAttributeHandler.readAttribute("end-date", attr, String.class)));
    }

    if (design.hasAttr("time-format")) {
        setTimeFormat(TimeFormat.valueOf(
                "Format" + design.attr("time-format").toUpperCase()));
    }

    if (design.hasAttr("start-date")) {
        setStartDate(
                ZonedDateTime.ofInstant(DesignAttributeHandler.readAttribute("start-date", attr, Date.class)
                        .toInstant(), getZoneId()));
    }

    if (design.hasAttr("end-date")) {
        setEndDate(
                ZonedDateTime.ofInstant(DesignAttributeHandler.readAttribute("end-date", attr, Date.class)
                        .toInstant(), getZoneId()));
    }
}
 
開發者ID:blackbluegl,項目名稱:calendar-component,代碼行數:28,代碼來源:Calendar.java


注:本文中的org.jsoup.nodes.Element.attributes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。