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

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

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

Tag.setAttribute介绍

[英]Set attribute with given key, value pair. Figures out a quote character to use if necessary.
[中]使用给定的键、值对设置属性。如有必要,找出要使用的引号字符。

代码示例

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

/**
 * @see org.htmlparser.Tag#setAttribute(java.lang.String, java.lang.String)
 */
public void setAttribute(String arg0, String arg1) {
  m_decorated.setAttribute(arg0, arg1);
}

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

/**
 * @see org.htmlparser.Tag#setAttribute(java.lang.String, java.lang.String, char)
 */
public void setAttribute(String arg0, String arg1, char arg2) {
  m_decorated.setAttribute(arg0, arg1, arg2);
}

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

/**
 * @see org.htmlparser.Tag#setAttribute(java.lang.String, java.lang.String)
 */
public void setAttribute(String arg0, String arg1) {
  m_decorated.setAttribute(arg0, arg1);
}

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

/**
 * @see org.htmlparser.Tag#setAttribute(java.lang.String, java.lang.String, char)
 */
public void setAttribute(String arg0, String arg1, char arg2) {
  m_decorated.setAttribute(arg0, arg1, arg2);
}

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

/**
 * @see org.htmlparser.Tag#setAttribute(java.lang.String, java.lang.String)
 */
public void setAttribute(String arg0, String arg1) {
  m_decorated.setAttribute(arg0, arg1);
}

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

/**
 * @see org.htmlparser.Tag#setAttribute(java.lang.String, java.lang.String, char)
 */
public void setAttribute(String arg0, String arg1, char arg2) {
  m_decorated.setAttribute(arg0, arg1, arg2);
}

代码示例来源:origin: CloudSlang/cs-actions

public void visitTag(Tag tag) {
  if (tag.getRawTagName().equalsIgnoreCase("img")) {
    String imageValue = tag.getAttribute("src");
    if (imageValue.contains("base64")) {
      String contentId = getContentId();
      tag.setAttribute("src", "cid:" + contentId);
      base64ImagesMap.put(contentId,
          imageValue.substring(imageValue.indexOf("base64") + 7, imageValue.length()));
    }
  }
}

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

/**
 * 处理style属性中应用的链接和图片,对于有些图片已经用<cms:uri>标签处理过时,是不需要再进行处理的
 * @param tag
 */
protected void processStylePropertyOfTag(Tag tag)
{
  String style = tag.getAttribute("style");
  int linkhandletype = needProcessStyleAtrribute(style);
  if(linkhandletype == LINK_NO_PARSER_NO_DISTRIBUTE)
    return ;
  
  style = this.handleStyleCode(style);
  if(style != null)
    tag.setAttribute("style",style);		
}

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

private void setExecutionResult(ExecutionResult executionResult) {
  NodeList cells = rowNode.getChildren();
  for (int i = 0; i < cells.size(); i++) {
   Node cell = cells.elementAt(i);
   if (cell instanceof Tag) {
    Tag tag = (Tag) cell;
    tag.setAttribute("class", executionResult.toString(), '"');
   }
  }
 }
}

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

private void setExecutionResult(ExecutionResult executionResult) {
  NodeList cells = rowNode.getChildren();
  for (int i = 0; i < cells.size(); i++) {
   Node cell = cells.elementAt(i);
   if (cell instanceof Tag) {
    Tag tag = (Tag) cell;
    tag.setAttribute("class", executionResult.toString(), '"');
   }
  }
 }
}

代码示例来源:origin: omegat-org/omegat

/**
   * If the attribute of the tag is not empty, it translates it as a separate
   * segment.
   *
   * @param tag
   *            the tag object
   * @param key
   *            the name of the attribute
   */
  @Override
  protected void maybeTranslateAttribute(Tag tag, String key) {
    String attr = tag.getAttribute(key);
    if (attr != null) {
      String trans = filter.privateProcessEntry(HTMLUtils.entitiesToChars(attr), null);
      tag.setAttribute(key, HTMLUtils.charsToEntities(trans, filter.getTargetEncoding(), sShortcuts));
    }
  }
}

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

tag.setAttribute(attr, CmsEncoder.escapeXml(l));
  tag.setAttribute(attr, CmsMacroResolver.formatMacro(link.getName()));

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

tag.setAttribute(attr, CmsEncoder.escapeXml(l));
  tag.setAttribute(attr, CmsMacroResolver.formatMacro(link.getName()));

代码示例来源:origin: omegat-org/omegat

/**
 * If the attribute of the tag is not empty, it translates it as a separate
 * segment.
 *
 * @param tag
 *            the tag object
 * @param key
 *            the name of the attribute
 */
protected void maybeTranslateAttribute(Tag tag, String key) {
  String attr = tag.getAttribute(key);
  if (attr != null) {
    String comment = OStrings.getString("HTMLFILTER_TAG") + " " + tag.getTagName() + " "
        + OStrings.getString("HTMLFILTER_ATTRIBUTE") + " " + key;
    String trans = filter.privateProcessEntry(HTMLUtils.entitiesToChars(attr), comment);
    tag.setAttribute(key, HTMLUtils.charsToEntities(trans, filter.getTargetEncoding(), sShortcuts));
  }
}

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

if (link != null) {
  tag.setAttribute("background",link.getHref());
    tag.setAttribute("background",link.getHref());
if (link != null) {
  tag.setAttribute("background",link.getHref());
    tag.setAttribute("background",link.getHref());

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

if (link != null) {
  tag.setAttribute("src",link.getHref());
    tag.setAttribute("src",link.getHref());
if (link != null) {
  tag.setAttribute("src",link.getHref());
    tag.setAttribute("src",link.getHref());

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

if (link != null) {
  tag.setAttribute("src",link.getHref());
    tag.setAttribute("src",link.getHref());
if (link != null) {
  tag.setAttribute("background",link.getHref());
    tag.setAttribute("src",link.getHref());

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

if (link != null) {
  tag.setAttribute("href",link.getHref());
} else {
  if (this.baseUrl != null)
    tag.setAttribute("href",link.getHref());
if (link != null) {
  tag.setAttribute("href",link.getHref());
    tag.setAttribute("href",link.getHref());

相关文章