当前位置: 首页>>代码示例>>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;未经允许,请勿转载。