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

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

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

Tag.getTagName介绍

[英]Return the name of this tag.

Note: This value is converted to uppercase and does not begin with "/" if it is an end tag. Nor does it end with a slash in the case of an XML type tag. The conversion to uppercase is performed with an ENGLISH locale.
[中]返回此标记的名称。
注意:此值转换为大写,如果是结束标记,则不以“/”开头。对于XML类型标记,它也不会以斜杠结尾。转换为大写是在英语区域设置下执行的

代码示例

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

/**
 * @see org.htmlparser.Tag#getTagName()
 */
public String getTagName() {
  return m_decorated.getTagName();
}

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

/**
 * @see org.htmlparser.Tag#getTagName()
 */
public String getTagName() {
  return m_decorated.getTagName();
}

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

@Override
public String toString() {
 if (tag == null) {
  return "*root*";
 }
 return tag.getTagName();
}

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

/**
 * @see org.htmlparser.Tag#getTagName()
 */
public String getTagName() {
  return m_decorated.getTagName();
}

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

/** Is the tag space-preserving? */
private boolean isPreformattingTag(Tag tag) {
  String tagname = tag.getTagName();
  return tagname.equals("PRE") || tagname.equals("TEXTAREA");
}

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

private boolean isParagraphTag(Tag tag) {
  String tagname = tag.getTagName();
  return tagname.equals("HTML") || tagname.equals("HEAD") || tagname.equals("BODY");
}

代码示例来源:origin: org.apache.uima/ruta-core

@Override
public void visitEndTag(Tag tag) {
 String tagname = tag.getTagName().toLowerCase().trim();
 if (tagname.equals("body")) {
  this.inBody = false;
 } else if (tagname.equals("script") || tag instanceof ScriptTag) {
  this.inScript = false;
 }
}

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

/**
 * Resets the state of the PRE and SCRIPT flags.
 * @param tag The end tag to process.
 */
public void visitEndTag (Tag tag)
{
  String name;
  name = tag.getTagName ();
  if (name.equalsIgnoreCase ("PRE"))
    mIsPre = false;
  else if (name.equalsIgnoreCase ("SCRIPT"))
    mIsScript = false;
  else if (name.equalsIgnoreCase ("STYLE"))
    mIsStyle = false;
}

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

private void appendAttribute(Tag tag, String text) {
  if (tag.getTagName().equals("IMG")) {
    appendText(text);
  } else {
    String current = (String)m_attributeMap.get(tag);
    if (current != null) {
      text = current + text;
    }
    m_attributeMap.put(tag, text);
  }
}

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

/** Should a contents of this tag be kept intact? */
private boolean isIntactTag(Tag tag) {
  String tagname = tag.getTagName();
  return tagname.equals("!DOCTYPE")
      || tagname.equals("STYLE")
      || tagname.equals("SCRIPT")
      || tagname.equals("OBJECT")
      || tagname.equals("EMBED")
      || (tagname.equals("META") && "content-type".equalsIgnoreCase(tag.getAttribute("http-equiv")));
}

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

public void visitTag(Tag tag)
{
  for (int i=0;i<tagsToBeFound.length;i++)
    if (tag.getTagName().equalsIgnoreCase(tagsToBeFound[i])) {
      count[i]++;
      tags[i].add(tag);
    }
}

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

public void visitEndTag(Tag tag)
{
  if (!endTagCheck) return;
  for (int i=0;i<tagsToBeFound.length;i++)
    if (tag.getTagName().equalsIgnoreCase(tagsToBeFound[i]))
    {
      endTagCount[i]++;
      endTags[i].add(tag);
    }
}

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

public void visitTag(Tag tag)
{
  for (int i=0;i<tagsToBeFound.length;i++)
    if (tag.getTagName().equalsIgnoreCase(tagsToBeFound[i])) {
      count[i]++;
      tags[i].add(tag);
    }
}

代码示例来源:origin: org.apache.uima/ruta-ep-ide-ui

public void visitTag(Tag tag) {
 String name = tag.getTagName().toLowerCase();
 if ("div".equals(name)) {
  divDepth++;
  if (divDepth == 1) {
   elementStart = tag.getStartPosition();
  }
 }
}

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

public void visitEndTag(Tag tag)
{
  if (!endTagCheck) return;
  for (int i=0;i<tagsToBeFound.length;i++)
    if (tag.getTagName().equalsIgnoreCase(tagsToBeFound[i]))
    {
      endTagCount[i]++;
      endTags[i].add(tag);
    }
}

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

private void appendAttribute(Tag tag, String text) {
  if (tag.getTagName().equals("IMG")) {
    appendText(text);
  } else {
    String current = (String)m_attributeMap.get(tag);
    if (current != null) {
      text = current + text;
    }
    m_attributeMap.put(tag, text);
  }
}

代码示例来源:origin: org.apache.uima/ruta-ep-ide-ui

public void visitEndTag(Tag tag) {
 String name = tag.getTagName().toLowerCase();
 if ("div".equals(name)) {
  if (divDepth == 1) {
   String section = document.substring(elementStart, tag.getEndPosition());
   processSection(section);
  }
  divDepth--;
 }
}

代码示例来源:origin: oaqa/knn4qa

@Override
public void visitTag(Tag tag) {
 String lcName = tag.getTagName().toLowerCase();
 
 setFlags(lcName, true);
 processParagraphs(lcName, true);
}

代码示例来源:origin: oaqa/knn4qa

@Override
public void visitEndTag(Tag tag) {
 String Name = tag.getTagName().toLowerCase();
  
 setFlags(Name, false);
 processParagraphs(Name, false);
}

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

@Override
public void visitTag(Tag tag) {
  if (isParagraphTag(tag) && text) {
    endup();
  }
  if ("PARAM".equals(tag.getTagName()) && "Name".equalsIgnoreCase(tag.getAttribute("name"))) {
    maybeTranslateAttribute(tag, "value");
  }
  queuePrefix(tag);
}

相关文章