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

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

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

Element.discard介绍

[英]Removes this element from its current document
[中]从当前文档中删除此元素

代码示例

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

  1. public void discard() {
  2. internal.discard();
  3. }

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

  1. public void discard() {
  2. internal.discard();
  3. }

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

  1. public Person setEmailElement(Element element) {
  2. ExtensibleElement internal = getExtInternal();
  3. Element el = getEmailElement();
  4. if (el != null)
  5. el.discard();
  6. if (element != null)
  7. internal.addExtension(element);
  8. return this;
  9. }

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

  1. public Person setEmailElement(Element element) {
  2. ExtensibleElement internal = getExtInternal();
  3. Element el = getEmailElement();
  4. if (el != null) el.discard();
  5. if (element != null)
  6. internal.addExtension(element);
  7. return this;
  8. }

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

  1. public Person setUriElement(IRIElement element) {
  2. ExtensibleElement internal = getExtInternal();
  3. Element el = getUriElement();
  4. if (el != null) el.discard();
  5. if (element != null)
  6. internal.addExtension(element);
  7. return this;
  8. }

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

  1. public Person setUriElement(IRIElement element) {
  2. ExtensibleElement internal = getExtInternal();
  3. Element el = getUriElement();
  4. if (el != null)
  5. el.discard();
  6. if (element != null)
  7. internal.addExtension(element);
  8. return this;
  9. }

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

  1. public Person setNameElement(Element element) {
  2. ExtensibleElement internal = getExtInternal();
  3. Element el = getNameElement();
  4. if (el != null)
  5. el.discard();
  6. if (element != null)
  7. internal.addExtension(element);
  8. return this;
  9. }

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

  1. public Person setNameElement(Element element) {
  2. ExtensibleElement internal = getExtInternal();
  3. Element el = getNameElement();
  4. if (el != null) el.discard();
  5. if (element != null)
  6. internal.addExtension(element);
  7. return this;
  8. }

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

  1. /**
  2. * The code should typically match the HTTP status code; however, certain
  3. * application scenarios may require the use of a different code
  4. */
  5. public Error setCode(int code) {
  6. if (code > -1) {
  7. Element element = getExtension(CODE);
  8. if (element != null) {
  9. element.setText(Integer.toString(code));
  10. } else {
  11. addSimpleExtension(CODE,Integer.toString(code));
  12. }
  13. } else {
  14. Element element = getExtension(CODE);
  15. if (element != null) element.discard();
  16. }
  17. return this;
  18. }

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

  1. /**
  2. * The code should typically match the HTTP status code; however, certain application scenarios may require the use
  3. * of a different code
  4. */
  5. public Error setCode(int code) {
  6. if (code > -1) {
  7. Element element = getExtension(CODE);
  8. if (element != null) {
  9. element.setText(Integer.toString(code));
  10. } else {
  11. addSimpleExtension(CODE, Integer.toString(code));
  12. }
  13. } else {
  14. Element element = getExtension(CODE);
  15. if (element != null)
  16. element.discard();
  17. }
  18. return this;
  19. }

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

  1. private static void addW3CPosition(ExtensibleElement element, Position position) {
  2. if (!(position instanceof Point))
  3. throw new IllegalArgumentException("The W3C Encoding only supports Points");
  4. Element el = element.getExtension(QNAME_W3C_LAT);
  5. if (el != null)
  6. el.discard();
  7. el = element.getExtension(QNAME_W3C_LONG);
  8. if (el != null)
  9. el.discard();
  10. Point point = (Point)position;
  11. ExtensibleElement p = element.addExtension(QNAME_W3C_POINT);
  12. p.addSimpleExtension(QNAME_W3C_LAT, Double.toString(point.getCoordinate().getLatitude()));
  13. p.addSimpleExtension(QNAME_W3C_LONG, Double.toString(point.getCoordinate().getLongitude()));
  14. }

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

  1. /**
  2. * Human-readable, language-sensitive description of the error
  3. */
  4. public Error setMessage(String message) {
  5. if (message != null) {
  6. Element element = getExtension(MESSAGE);
  7. if (element != null) {
  8. element.setText(message);
  9. } else {
  10. addSimpleExtension(MESSAGE,message);
  11. }
  12. } else {
  13. Element element = getExtension(MESSAGE);
  14. if (element != null) element.discard();
  15. }
  16. return this;
  17. }

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

  1. /**
  2. * Human-readable, language-sensitive description of the error
  3. */
  4. public Error setMessage(String message) {
  5. if (message != null) {
  6. Element element = getExtension(MESSAGE);
  7. if (element != null) {
  8. element.setText(message);
  9. } else {
  10. addSimpleExtension(MESSAGE, message);
  11. }
  12. } else {
  13. Element element = getExtension(MESSAGE);
  14. if (element != null)
  15. element.discard();
  16. }
  17. return this;
  18. }

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

  1. /**
  2. * Flag the feed as being an archive.
  3. *
  4. * @param feed The Feed to mark as an archive
  5. * @param archive True if the feed is an archive
  6. */
  7. public static void setArchive(Source feed, boolean archive) {
  8. if (archive) {
  9. if (!isArchive(feed))
  10. feed.addExtension(ARCHIVE);
  11. } else {
  12. if (isArchive(feed)) {
  13. Element ext = feed.getExtension(ARCHIVE);
  14. ext.discard();
  15. }
  16. }
  17. }

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

  1. /**
  2. * Flag the feed as being complete. According to the Feed Paging and Archiving specification, in a complete feed,
  3. * "any entry not actually in the feed document SHOULD NOT be considered to be part of that feed."
  4. *
  5. * @param feed The Feed to mark as complete
  6. * @param complete True if the feed is complete
  7. */
  8. public static void setComplete(Source feed, boolean complete) {
  9. if (complete) {
  10. if (!isComplete(feed))
  11. feed.addExtension(COMPLETE);
  12. } else {
  13. if (isComplete(feed)) {
  14. Element ext = feed.getExtension(COMPLETE);
  15. ext.discard();
  16. }
  17. }
  18. }

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

  1. public Element setEmail(String email) {
  2. ExtensibleElement internal = getExtInternal();
  3. Element el = getEmailElement();
  4. if (email != null) {
  5. if (el == null)
  6. el = internal.getFactory().newEmail(internal);
  7. el.setText(email);
  8. return el;
  9. } else {
  10. if (el != null) el.discard();
  11. return null;
  12. }
  13. }

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

  1. public Element setName(String name) {
  2. ExtensibleElement internal = getExtInternal();
  3. Element el = getNameElement();
  4. if (name != null) {
  5. if (el == null)
  6. el = internal.getFactory().newName(internal);
  7. el.setText(name);
  8. return el;
  9. } else {
  10. if (el != null) el.discard();
  11. return null;
  12. }
  13. }

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

  1. public Element setEmail(String email) {
  2. ExtensibleElement internal = getExtInternal();
  3. Element el = getEmailElement();
  4. if (email != null) {
  5. if (el == null)
  6. el = internal.getFactory().newEmail(internal);
  7. el.setText(email);
  8. return el;
  9. } else {
  10. if (el != null)
  11. el.discard();
  12. return null;
  13. }
  14. }

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

  1. public Element setName(String name) {
  2. ExtensibleElement internal = getExtInternal();
  3. Element el = getNameElement();
  4. if (name != null) {
  5. if (el == null)
  6. el = internal.getFactory().newName(internal);
  7. el.setText(name);
  8. return el;
  9. } else {
  10. if (el != null)
  11. el.discard();
  12. return null;
  13. }
  14. }

相关文章