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

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

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

Tag.getStartPosition介绍

暂无

代码示例

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

/**
 * @see org.htmlparser.Node#getStartPosition()
 */
public int getStartPosition() {
  return m_decorated.getStartPosition();
}

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

/**
 * @see org.htmlparser.Node#getStartPosition()
 */
public int getStartPosition() {
  return m_decorated.getStartPosition();
}

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

/**
 * @see org.htmlparser.Node#getStartPosition()
 */
public int getStartPosition() {
  return m_decorated.getStartPosition();
}

代码示例来源: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: org.apache.uima/ruta-core

@Override
public void visitTag(Tag tag) {
 super.visitTag(tag);
 String trimmedTagnameLowercase = tag.getTagName().toLowerCase().trim();
 if (trimmedTagnameLowercase.equals("body")) {
  inBody = true;
 } else if (trimmedTagnameLowercase.equals("script")) {
  inScript = true;
 }
 boolean matchedByPattern = false;
 if (newlineInducingTagPattern != null) {
  Matcher matcher = newlineInducingTagPattern.matcher(trimmedTagnameLowercase);
  if (matcher.matches()) {
   matchedByPattern = true;
  }
 }
 if (matchedByPattern
     || (newlineInducingTags != null && newlineInducingTags
         .contains(trimmedTagnameLowercase))) {
  int begin = tag.getStartPosition();
  linebreaksFromHtmlTags.add(new HtmlConverterPSpanReplacement(begin, begin + 1,
      HtmlConverter.LINEBREAK));
 }
 if (gapInducingTags != null && gapInducingTags.contains(trimmedTagnameLowercase)) {
  int begin = tag.getStartPosition();
  gapsFromHtmlTags.add(new HtmlConverterPSpanReplacement(begin, begin + gapText.length(),
      gapText));
 }
}

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

private void handleFakeTag(final Tag tag) {
 if (visitMode != VisitMode.NONE) {
  currentSB.append(tag.getPage().getText(tag.getStartPosition(), tag.getEndPosition()));
 }
}

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

/**
 * Return the text between the start tag and the end tag.
 * @return The contents of the CompositeTag.
 */
public String getStringText ()
{
  String ret;
  int start = getEndPosition ();
  int end = mEndTag.getStartPosition ();
  ret = getPage ().getText (start, end);
  
  return (ret);
}

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

/**
  * Constructor.
  *
  * @param tag
  *          The tag that we want to store information about.
  */
 public TagInfo(final Tag tag) {
  Page page = tag.getPage();
  startPosition = tag.getStartPosition();
  int endPosition = tag.getEndPosition();
  chars = new char[endPosition - startPosition];
  page.getText(chars, 0, startPosition, endPosition);
 }
}

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

int beginTagEnd = endTag.getStartPosition ();
int endTagEnd = endTag.getEndPosition ();

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

int beginTagEnd = endTag.getStartPosition ();
int endTagEnd = endTag.getEndPosition ();

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

int beginTagEnd = endTag.getStartPosition ();
int endTagEnd = endTag.getEndPosition ();

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

int beginTagEnd = endTag.getStartPosition ();
int endTagEnd = endTag.getEndPosition ();

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

/**
 * Constructor.
 *
 * @param tag
 *          The tag that this node definition belongs to.
 * @param templateFileName
 *          the name of the template file.
 */
public TagNode(final Tag tag, final String templateFileName) {
 emptyTag = tag.isEmptyXmlTag();
 Page page = tag.getPage();
 startPositionInTemplate = tag.getStartPosition();
 int endPosition = tag.getEndPosition();
 int length = endPosition - startPositionInTemplate;
 textRepresentation = new char[length];
 page.getText(textRepresentation, 0, startPositionInTemplate, endPosition);
 this.templateFileName = templateFileName;
}

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

final boolean positionOfAttributeValue, final Coordinate startPosition) {
Page page = tag.getPage();
int tagStartPosition = tag.getStartPosition();
int tagEndPosition = tag.getEndPosition();

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

lexer.setPosition (next.getStartPosition ());
node = null;
  attributes.add (new Attribute (name, null));
  Tag opener = lexer.getNodeFactory ().createTagNode (
    lexer.getPage (), next.getStartPosition (), next.getEndPosition (),
    attributes);

相关文章