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

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

本文整理了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

  1. public String getText() {
  2. return internal.getText();
  3. }

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

  1. @Override
  2. protected boolean matchesSafely(Element element, Description mismatchDescription)
  3. {
  4. if (!matcher.matches(element.getText()))
  5. {
  6. mismatchDescription.appendText("title ");
  7. matcher.describeMismatch(element.getText(), mismatchDescription);
  8. return false;
  9. }
  10. return true;
  11. }

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

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

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

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

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

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

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

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

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

  1. public StreamBuilder writeElementText(String value) {
  2. if (!(current instanceof Element))
  3. throw new IllegalStateException("Not currently an element");
  4. Element element = (Element)current;
  5. String text = element.getText();
  6. element.setText(text + value);
  7. return this;
  8. }

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

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

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

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

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

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

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

  1. @Override
  2. protected boolean matchesSafely(Entry entry, Description mismatchDescription)
  3. {
  4. List<Element> verbs = entry.getExtensions(ACTIVITY_VERB);
  5. for (Element verb : verbs)
  6. {
  7. if (matcher.matches(verb.getText()))
  8. {
  9. return true;
  10. }
  11. mismatchDescription.appendText("activity:verb ");
  12. matcher.describeMismatch(verb.getText(), mismatchDescription);
  13. }
  14. return false;
  15. }

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

  1. /**
  2. * Gets the text.
  3. *
  4. * @param elName the el name
  5. *
  6. * @return the text
  7. */
  8. protected String getText(QName elName)
  9. {
  10. Element el = getExtension(elName);
  11. if (el != null)
  12. return el.getText();
  13. return null;
  14. }

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

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

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

  1. private static String getRunId(final Entry entry) {
  2. final Element runIdElement = entry.getFirstChild(AtomUtils
  3. .getRunIdQName());
  4. if (runIdElement == null) {
  5. return null;
  6. }
  7. return runIdElement.getText();
  8. }

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

  1. private static String getReplyTo(final Entry entry) {
  2. final Element replyTo = entry.getFirstChild(AtomUtils
  3. .getInReplyToQName());
  4. if (replyTo == null) {
  5. return null;
  6. }
  7. return replyTo.getText();
  8. }

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

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

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

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

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

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

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

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

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

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

相关文章