本文整理了Java中org.apache.abdera.model.Element.discard()
方法的一些代码示例,展示了Element.discard()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.discard()
方法的具体详情如下:
包路径:org.apache.abdera.model.Element
类名称:Element
方法名:discard
[英]Removes this element from its current document
[中]从当前文档中删除此元素
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera
public void discard() {
internal.discard();
}
代码示例来源:origin: org.apache.abdera/abdera-core
public void discard() {
internal.discard();
}
代码示例来源:origin: org.apache.abdera/abdera-core
public Person setEmailElement(Element element) {
ExtensibleElement internal = getExtInternal();
Element el = getEmailElement();
if (el != null)
el.discard();
if (element != null)
internal.addExtension(element);
return this;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera
public Person setEmailElement(Element element) {
ExtensibleElement internal = getExtInternal();
Element el = getEmailElement();
if (el != null) el.discard();
if (element != null)
internal.addExtension(element);
return this;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera
public Person setUriElement(IRIElement element) {
ExtensibleElement internal = getExtInternal();
Element el = getUriElement();
if (el != null) el.discard();
if (element != null)
internal.addExtension(element);
return this;
}
代码示例来源:origin: org.apache.abdera/abdera-core
public Person setUriElement(IRIElement element) {
ExtensibleElement internal = getExtInternal();
Element el = getUriElement();
if (el != null)
el.discard();
if (element != null)
internal.addExtension(element);
return this;
}
代码示例来源:origin: org.apache.abdera/abdera-core
public Person setNameElement(Element element) {
ExtensibleElement internal = getExtInternal();
Element el = getNameElement();
if (el != null)
el.discard();
if (element != null)
internal.addExtension(element);
return this;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera
public Person setNameElement(Element element) {
ExtensibleElement internal = getExtInternal();
Element el = getNameElement();
if (el != null) el.discard();
if (element != null)
internal.addExtension(element);
return this;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera
/**
* The code should typically match the HTTP status code; however, certain
* application scenarios may require the use of a different code
*/
public Error setCode(int code) {
if (code > -1) {
Element element = getExtension(CODE);
if (element != null) {
element.setText(Integer.toString(code));
} else {
addSimpleExtension(CODE,Integer.toString(code));
}
} else {
Element element = getExtension(CODE);
if (element != null) element.discard();
}
return this;
}
代码示例来源:origin: org.apache.abdera/abdera-core
/**
* The code should typically match the HTTP status code; however, certain application scenarios may require the use
* of a different code
*/
public Error setCode(int code) {
if (code > -1) {
Element element = getExtension(CODE);
if (element != null) {
element.setText(Integer.toString(code));
} else {
addSimpleExtension(CODE, Integer.toString(code));
}
} else {
Element element = getExtension(CODE);
if (element != null)
element.discard();
}
return this;
}
代码示例来源:origin: org.apache.abdera/abdera-extensions-geo
private static void addW3CPosition(ExtensibleElement element, Position position) {
if (!(position instanceof Point))
throw new IllegalArgumentException("The W3C Encoding only supports Points");
Element el = element.getExtension(QNAME_W3C_LAT);
if (el != null)
el.discard();
el = element.getExtension(QNAME_W3C_LONG);
if (el != null)
el.discard();
Point point = (Point)position;
ExtensibleElement p = element.addExtension(QNAME_W3C_POINT);
p.addSimpleExtension(QNAME_W3C_LAT, Double.toString(point.getCoordinate().getLatitude()));
p.addSimpleExtension(QNAME_W3C_LONG, Double.toString(point.getCoordinate().getLongitude()));
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera
/**
* Human-readable, language-sensitive description of the error
*/
public Error setMessage(String message) {
if (message != null) {
Element element = getExtension(MESSAGE);
if (element != null) {
element.setText(message);
} else {
addSimpleExtension(MESSAGE,message);
}
} else {
Element element = getExtension(MESSAGE);
if (element != null) element.discard();
}
return this;
}
代码示例来源:origin: org.apache.abdera/abdera-core
/**
* Human-readable, language-sensitive description of the error
*/
public Error setMessage(String message) {
if (message != null) {
Element element = getExtension(MESSAGE);
if (element != null) {
element.setText(message);
} else {
addSimpleExtension(MESSAGE, message);
}
} else {
Element element = getExtension(MESSAGE);
if (element != null)
element.discard();
}
return this;
}
代码示例来源:origin: org.apache.abdera/abdera-extensions-main
/**
* Flag the feed as being an archive.
*
* @param feed The Feed to mark as an archive
* @param archive True if the feed is an archive
*/
public static void setArchive(Source feed, boolean archive) {
if (archive) {
if (!isArchive(feed))
feed.addExtension(ARCHIVE);
} else {
if (isArchive(feed)) {
Element ext = feed.getExtension(ARCHIVE);
ext.discard();
}
}
}
代码示例来源:origin: org.apache.abdera/abdera-extensions-main
/**
* Flag the feed as being complete. According to the Feed Paging and Archiving specification, in a complete feed,
* "any entry not actually in the feed document SHOULD NOT be considered to be part of that feed."
*
* @param feed The Feed to mark as complete
* @param complete True if the feed is complete
*/
public static void setComplete(Source feed, boolean complete) {
if (complete) {
if (!isComplete(feed))
feed.addExtension(COMPLETE);
} else {
if (isComplete(feed)) {
Element ext = feed.getExtension(COMPLETE);
ext.discard();
}
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera
public Element setEmail(String email) {
ExtensibleElement internal = getExtInternal();
Element el = getEmailElement();
if (email != null) {
if (el == null)
el = internal.getFactory().newEmail(internal);
el.setText(email);
return el;
} else {
if (el != null) el.discard();
return null;
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera
public Element setName(String name) {
ExtensibleElement internal = getExtInternal();
Element el = getNameElement();
if (name != null) {
if (el == null)
el = internal.getFactory().newName(internal);
el.setText(name);
return el;
} else {
if (el != null) el.discard();
return null;
}
}
代码示例来源:origin: org.apache.abdera/abdera-core
public Element setEmail(String email) {
ExtensibleElement internal = getExtInternal();
Element el = getEmailElement();
if (email != null) {
if (el == null)
el = internal.getFactory().newEmail(internal);
el.setText(email);
return el;
} else {
if (el != null)
el.discard();
return null;
}
}
代码示例来源:origin: org.apache.abdera/abdera-core
public Element setName(String name) {
ExtensibleElement internal = getExtInternal();
Element el = getNameElement();
if (name != null) {
if (el == null)
el = internal.getFactory().newName(internal);
el.setText(name);
return el;
} else {
if (el != null)
el.discard();
return null;
}
}
内容来源于网络,如有侵权,请联系作者删除!