本文整理了Java中org.apache.abdera.model.Element.getParentElement()
方法的一些代码示例,展示了Element.getParentElement()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getParentElement()
方法的具体详情如下:
包路径:org.apache.abdera.model.Element
类名称:Element
方法名:getParentElement
[英]Return this Element's parent element or document
[中]返回此元素的父元素或文档
代码示例来源:origin: org.apache.abdera/abdera-core
public StreamBuilder endElement() {
current = current instanceof Element ? ((Element)current).getParentElement() : null;
return this;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera
public StreamBuilder endElement() {
current = current instanceof Element ? ((Element)current).getParentElement() : null;
return this;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera
@SuppressWarnings("unchecked")
public <T extends Base> T getParentElement() {
return (T) internal.getParentElement();
}
代码示例来源:origin: org.apache.abdera/abdera-core
public <T extends Base> T getParentElement() {
return (T)internal.getParentElement();
}
代码示例来源:origin: org.apache.abdera/abdera-extensions-json
private static boolean needToWriteLang(Element element) {
String parentlang = null;
if (element.getParentElement() != null) {
Base parent = element.getParentElement();
parentlang =
parent instanceof Document ? ((Document)parent).getLanguage() : ((Element)parent).getLanguage();
}
String lang = element.getLanguage();
return (parentlang == null && lang != null) || (lang != null && parentlang != null && !parentlang
.equalsIgnoreCase(lang));
}
代码示例来源:origin: org.apache.abdera/abdera-extensions-json
private static boolean needToWriteDir(Element element) {
Direction parentdir = Direction.UNSPECIFIED;
Direction dir = BidiHelper.getDirection(element);
if (element.getParentElement() != null) {
Base parent = element.getParentElement();
if (parent instanceof Element)
parentdir = BidiHelper.getDirection((Element)parent);
}
return dir != Direction.UNSPECIFIED && !dir.equals(parentdir);
}
代码示例来源:origin: org.apache.abdera/abdera-extensions-main
private static <T extends Element> boolean hasDirection(T element) {
String dir = element.getAttributeValue("dir");
if (dir != null && dir.length() > 0)
return true;
else if (dir == null) {
// if the direction is unspecified on this element,
// let's see if we've inherited it
Base parent = element.getParentElement();
if (parent != null && parent instanceof Element)
return hasDirection((Element)parent);
}
return false;
}
}
代码示例来源:origin: org.apache.abdera/abdera-extensions-main
/**
* Get the in-scope direction for an element.
*/
public static <T extends Element> Direction getDirection(T element) {
Direction direction = Direction.UNSPECIFIED;
String dir = element.getAttributeValue("dir");
if (dir != null && dir.length() > 0)
direction = Direction.valueOf(dir.toUpperCase());
else if (dir == null) {
// if the direction is unspecified on this element,
// let's see if we've inherited it
Base parent = element.getParentElement();
if (parent != null && parent instanceof Element)
direction = getDirection((Element)parent);
}
return direction;
}
代码示例来源:origin: org.apache.abdera/abdera-extensions-json
private static boolean isSameAsParentBase(Element element) {
IRI parentbase = null;
if (element.getParentElement() != null) {
parentbase =
element instanceof Document ? ((Document)element).getBaseUri() : ((Element)element)
.getResolvedBaseUri();
}
IRI base = element.getResolvedBaseUri();
if (parentbase == null && base != null) {
return false;
}
if (parentbase == null && base == null) {
return true;
}
return parentbase.equals(element.getResolvedBaseUri());
}
内容来源于网络,如有侵权,请联系作者删除!