org.htmlparser.Tag.getAttributeEx()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(191)

本文整理了Java中org.htmlparser.Tag.getAttributeEx()方法的一些代码示例,展示了Tag.getAttributeEx()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tag.getAttributeEx()方法的具体详情如下:
包路径:org.htmlparser.Tag
类名称:Tag
方法名:getAttributeEx

Tag.getAttributeEx介绍

[英]Returns the attribute with the given name.
[中]返回具有给定名称的属性。

代码示例

代码示例来源:origin: com.bbossgroups.pdp/pdp-cms

/**
 * @see org.htmlparser.Tag#getAttributeEx(java.lang.String)
 */
public Attribute getAttributeEx(String arg0) {
  return m_decorated.getAttributeEx(arg0);
}

代码示例来源:origin: org.opencms/opencms-core

/**
 * @see org.htmlparser.Tag#getAttributeEx(java.lang.String)
 */
public Attribute getAttributeEx(String arg0) {
  return m_decorated.getAttributeEx(arg0);
}

代码示例来源:origin: org.opencms/opencms-solr

/**
 * @see org.htmlparser.Tag#getAttributeEx(java.lang.String)
 */
public Attribute getAttributeEx(String arg0) {
  return m_decorated.getAttributeEx(arg0);
}

代码示例来源:origin: org.fitnesse/fitnesse

@Override
 public boolean accept(Node node) {
  if (!(node instanceof Tag)) {
   return false;
  }
  if (mValue == null) {
   return false;
  }
  Tag tag = (Tag) node;
  if (tag.getAttributeEx(mAttribute) == null) {
   return false;
  }
  return tag.getAttributeEx(mAttribute).getValue().startsWith(mValue);
 }
}

代码示例来源:origin: com.github.tcnh/fitnesse

@Override
 public boolean accept(Node node) {
  if (!(node instanceof Tag)) {
   return false;
  }
  if (mValue == null) {
   return false;
  }
  Tag tag = (Tag) node;
  if (tag.getAttributeEx(mAttribute) == null) {
   return false;
  }
  return tag.getAttributeEx(mAttribute).getValue().startsWith(mValue);
 }
}

代码示例来源:origin: riotfamily/riot

/**
   * Accept tags with a certain attribute.
   * 
   * @param node The node to check.
   * @return <code>true</code> if the node has the attribute (and value if
   *         that is being checked too), <code>false</code> otherwise.
   */
  public boolean accept(Node node) {
    if (node instanceof Tag) {
      Tag tag = (Tag) node;
      Attribute attribute = tag.getAttributeEx(name);
      if (attribute != null) {
        if (this.value == null) {
          return true;
        }
        return this.value.equalsIgnoreCase(attribute.getValue());
      }
    }
    return false;
  }
}

代码示例来源:origin: org.htmlparser/htmlparser

/**
   * Accept tags with a certain attribute.
   * @param node The node to check.
   * @return <code>true</code> if the node has the attribute
   * (and value if that is being checked too), <code>false</code> otherwise.
   */
  public boolean accept (Node node)
  {
    Tag tag;
    Attribute attribute;
    boolean ret;

    ret = false;
    if (node instanceof Tag)
    {
      tag = (Tag)node;
      attribute = tag.getAttributeEx (mAttribute);
      ret = null != attribute;
      if (ret && (null != mValue))
        ret = mValue.equals (attribute.getValue ());
    }

    return (ret);
  }
}

代码示例来源:origin: com.bbossgroups/bboss-htmlparser

/**
   * Accept tags with a certain attribute.
   * @param node The node to check.
   * @return <code>true</code> if the node has the attribute
   * (and value if that is being checked too), <code>false</code> otherwise.
   */
  public boolean accept (Node node)
  {
    Tag tag;
    Attribute attribute;
    boolean ret;

    ret = false;
    if (node instanceof Tag)
    {
      tag = (Tag)node;
      attribute = tag.getAttributeEx (mAttribute);
      ret = null != attribute;
      if (ret && (null != mValue))
        ret = mValue.equals (attribute.getValue ());
    }

    return (ret);
  }
}

代码示例来源:origin: org.everit.templating/org.everit.templating.html

private TemplateCompiler resolveInlineCompiler(final Tag tag) {
 String inlineAttributeName = ehtAttributePrefix + "inline";
 Attribute attribute = tag.getAttributeEx(inlineAttributeName);
 if (attribute == null) {
  return null;
 }
 if (!(attribute instanceof PageAttribute)) {
  throw new RuntimeException(
    getTemplateFileName() + "attribute must be an instance of PageAttribute");
 }
 PageAttribute inlineAttribute = (PageAttribute) attribute;
 CompiledExpression compiledExpression =
   compileExpression(inlineAttribute, new TagInfo(tag)).compiledExpression;
 Object evaluatedInline = compiledExpression.eval(EMPTY_VAR_MAP);
 if (evaluatedInline != null) {
  TemplateCompiler inlineCompiler = inlineCompilers.get(evaluatedInline);
  if (inlineCompiler == null) {
   HTMLTemplatingUtil.throwCompileExceptionForAttribute(getTemplateFileName(),
     "No compiler found for inline type: " + evaluatedInline, tag, inlineAttribute, true,
     startPosition);
  }
  return inlineCompiler;
 }
 return null;
}

相关文章