org.apache.abdera.model.Element.getText()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(131)

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

Element.getText介绍

[英]Returns the Text value of this element
[中]返回此元素的文本值

代码示例

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

public String getText() {
  return internal.getText();
}

代码示例来源:origin: com.atlassian.streams/streams-testing

@Override
protected boolean matchesSafely(Element element, Description mismatchDescription)
{
  if (!matcher.matches(element.getText()))
  {
    mismatchDescription.appendText("title ");
    matcher.describeMismatch(element.getText(), mismatchDescription);
    return false;
  }
  return true;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera

public StreamBuilder writeElementText(String value) {
 if (!(current instanceof Element)) throw new IllegalStateException("Not currently an element");
 Element element = (Element) current;
 String text = element.getText();
 element.setText(text + value);
 return this;
}

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

public String getName() {
  Element name = getNameElement();
  return (name != null) ? name.getText() : null;
}

代码示例来源:origin: org.apache.abdera/abdera-parser

public String getSimpleExtension(QName qname) {
  Element el = getExtension(qname);
  return (el != null) ? el.getText() : null;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera

public String getEmail() {
 Element email = getEmailElement();
 return (email != null) ? email.getText() : null;
}

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

public StreamBuilder writeElementText(String value) {
  if (!(current instanceof Element))
    throw new IllegalStateException("Not currently an element");
  Element element = (Element)current;
  String text = element.getText();
  element.setText(text + value);
  return this;
}

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

public String getEmail() {
  Element email = getEmailElement();
  return (email != null) ? email.getText() : null;
}

代码示例来源:origin: org.apache.abdera/abdera-parser

public String getEmail() {
  Element email = getEmailElement();
  return (email != null) ? email.getText() : null;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera

public String getName() {
 Element name = getNameElement();
 return (name != null) ? name.getText() : null;
}

代码示例来源:origin: com.atlassian.streams/streams-testing

@Override
protected boolean matchesSafely(Entry entry, Description mismatchDescription)
{
  List<Element> verbs = entry.getExtensions(ACTIVITY_VERB);
  for (Element verb : verbs)
  {
    if (matcher.matches(verb.getText()))
    {
      return true;
    }
    mismatchDescription.appendText("activity:verb ");
    matcher.describeMismatch(verb.getText(), mismatchDescription);
  }
  return false;
}

代码示例来源:origin: org.xcmis/xcmis-restatom

/**
* Gets the text.
* 
* @param elName the el name
* 
* @return the text
*/
protected String getText(QName elName)
{
 Element el = getExtension(elName);
 if (el != null)
   return el.getText();
 return null;
}

代码示例来源:origin: org.apache.abdera/abdera-parser

public String getName() {
  Element name = getNameElement();
  return (name != null) ? name.getText() : null;
}

代码示例来源:origin: net.sf.taverna.t2.activities/interaction-activity

private static String getRunId(final Entry entry) {
  final Element runIdElement = entry.getFirstChild(AtomUtils
      .getRunIdQName());
  if (runIdElement == null) {
    return null;
  }
  return runIdElement.getText();
}

代码示例来源:origin: net.sf.taverna.t2.activities/interaction-activity

private static String getReplyTo(final Entry entry) {
  final Element replyTo = entry.getFirstChild(AtomUtils
      .getInReplyToQName());
  if (replyTo == null) {
    return null;
  }
  return replyTo.getText();
}

代码示例来源:origin: org.apache.abdera/abdera-extensions-main

/**
 * Return the textual content of the specified element
 * 
 * @param element An element containing directionally-sensitive text
 * @return The directionally-wrapped text of the element
 */
public static <T extends Element> String getBidiElementText(T element) {
  return getBidiText(getDirection(element), element.getText());
}

代码示例来源:origin: org.apache.ws.commons.axiom/fom-testsuite

@Override
  protected void runTest() throws Throwable {
    Collection collection = abdera.getFactory().newCollection();
    collection.setAccept("image/png", "image/jpeg");
    List<Element> children = collection.getElements();
    assertThat(children).hasSize(2);
    assertThat(children.get(0).getQName()).isEqualTo(Constants.ACCEPT);
    assertThat(children.get(0).getText()).isEqualTo("image/png");
    assertThat(children.get(1).getQName()).isEqualTo(Constants.ACCEPT);
    assertThat(children.get(1).getText()).isEqualTo("image/jpeg");
  }
}

代码示例来源:origin: org.apache.abdera/abdera-extensions-main

/**
 * Return the textual content of a child element using the in-scope directionality
 * 
 * @param element The parent element
 * @param child The XML QName of the child element
 * @return The directionally-wrapped text of the child element
 */
public static <T extends Element> String getBidiChildText(T element, QName child) {
  Element el = element.getFirstChild(child);
  return (el != null) ? getBidiText(getDirection(el), el.getText()) : null;
}

代码示例来源:origin: org.apache.abdera/abdera-extensions-main

/**
 * Use Java's built in support for bidi text to determine the base directionality of the element's text. The
 * response to this only indicates the *base* directionality, it does not indicate whether or not there are any RTL
 * characters in the text. According to the Atom Bidi spec, if the dir attribute is set explicitly, we should not do
 * language guessing. This restriction can be bypassed by setting ignoredir to true.
 */
public static <T extends Element> Direction guessDirectionFromJavaBidi(T element, boolean ignoredir) {
  if (!ignoredir && hasDirection(element))
    return getDirection(element);
  return Bidi.guessDirectionFromJavaBidi(element.getText());
}

代码示例来源:origin: org.apache.abdera/abdera-extensions-main

/**
 * Attempt to guess the base direction of an element using an analysis of the directional properties of the
 * characters used. This is a brute-force style approach that can achieve fairly reasonable results when the element
 * text consists primarily of characters with the same bidi properties. This approach is implemented by the Snarfer
 * feed reader as is documented at http://www.xn--8ws00zhy3a.com/blog/2006/12/right-to-left-rss According to the
 * Atom Bidi spec, if the dir attribute is set explicitly, we should not do language guessing. This restriction can
 * be bypassed by setting ignoredir to true.
 */
public static <T extends Element> Direction guessDirectionFromTextProperties(T element, boolean ignoredir) {
  if (!ignoredir && hasDirection(element))
    return getDirection(element);
  return Bidi.guessDirectionFromTextProperties(element.getText());
}

相关文章