本文整理了Java中org.jdom2.Element.equals()
方法的一些代码示例,展示了Element.equals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.equals()
方法的具体详情如下:
包路径:org.jdom2.Element
类名称:Element
方法名:equals
暂无
代码示例来源:origin: org.codehaus.plexus/plexus-component-metadata
/** {@inheritDoc} */
public boolean equals( Object obj )
{
return element.equals( obj );
}
代码示例来源:origin: com.cerner.ccl.whitenoise/whitenoise-rules-core
private boolean isUsed(final String variableName, final Element scope, final Set<Element> previouslyCheckedScopes,
final boolean allowDeclaration) throws JDOMException {
if (!allowDeclaration) {
List<Element> localDeclarations = selectNodes(scope, ".//Z_DECLARE./NAME[@text='" + variableName + "']");
if (localDeclarations.size() > 0) {
return false;
}
}
List<Element> uses = selectNodes(scope, ".//NAME[@text='" + variableName
+ "' and not(parent::Z_DECLARE.) and not(ancestor::Z_SET.[NAME[position()=1 and @text='" + variableName
+ "']]) and not(ancestor::IS.[NAME[position()=1 and @text='" + variableName + "']])]");
for (Element use : uses) {
if (getScope(use).equals(scope)) {
return true;
}
}
Set<Element> calledScopes = getCallGraph().get(scope);
if (calledScopes != null) {
for (Element calledScope : calledScopes) {
if (!previouslyCheckedScopes.contains(calledScope)) {
previouslyCheckedScopes.add(calledScope);
if (isUsed(variableName, calledScope, previouslyCheckedScopes, false)) {
return true;
}
}
}
}
return false;
}
代码示例来源:origin: org.apache.marmotta/sesame-tools-rio-rss
/** Use feed links and/or xml:base attribute to determine baseURI of feed */
private static URL findBaseURI(Element root) {
URL baseURI = null;
List linksList = root.getChildren("link", OS_NS);
if (linksList != null) {
for (Iterator links = linksList.iterator(); links.hasNext(); ) {
Element link = (Element)links.next();
if (!root.equals(link.getParent())) break;
String href = link.getAttribute("href").getValue();
if ( link.getAttribute("rel", OS_NS) == null
|| link.getAttribute("rel", OS_NS).getValue().equals("alternate")) {
href = resolveURI(null, link, href);
try {
baseURI = new URL(href);
break;
} catch (MalformedURLException e) {
System.err.println("Base URI is malformed: " + href);
}
}
}
}
return baseURI;
}
}
代码示例来源:origin: apache/marmotta
/** Use feed links and/or xml:base attribute to determine baseURI of feed */
private static URL findBaseURI(Element root) {
URL baseURI = null;
List linksList = root.getChildren("link", OS_NS);
if (linksList != null) {
for (Object aLinksList : linksList) {
Element link = (Element) aLinksList;
if (!root.equals(link.getParent())) break;
String href = link.getAttribute("href").getValue();
if (link.getAttribute("rel", OS_NS) == null
|| link.getAttribute("rel", OS_NS).getValue().equals("alternate")) {
href = resolveURI(null, link, href);
try {
baseURI = new URL(href);
break;
} catch (MalformedURLException e) {
System.err.println("Base URI is malformed: " + href);
}
}
}
}
return baseURI;
}
}
代码示例来源:origin: org.mycore/mycore-restapi
if (eRoot.equals(eRoot.getDocument().getRootElement())) {
writeChildrenAsJSON(eRoot.getChild("categories"), writer, lang);
} else {
代码示例来源:origin: rometools/rome
/** Use feed links and/or xml:base attribute to determine baseURI of feed */
private static URL findBaseURI(final Element root) {
URL baseURI = null;
final List<Element> linksList = root.getChildren("link", OS_NS);
if (linksList != null) {
for (final Element element : linksList) {
final Element link = element;
if (!root.equals(link.getParent())) {
break;
}
String href = link.getAttribute("href").getValue();
if (link.getAttribute("rel", OS_NS) == null || link.getAttribute("rel", OS_NS).getValue().equals("alternate")) {
href = resolveURI(null, link, href);
try {
baseURI = new URL(href);
break;
} catch (final MalformedURLException e) {
System.err.println("Base URI is malformed: " + href);
}
}
}
}
return baseURI;
}
}
代码示例来源:origin: com.rometools/rome-modules
/** Use feed links and/or xml:base attribute to determine baseURI of feed */
private static URL findBaseURI(final Element root) {
URL baseURI = null;
final List<Element> linksList = root.getChildren("link", OS_NS);
if (linksList != null) {
for (final Element element : linksList) {
final Element link = element;
if (!root.equals(link.getParent())) {
break;
}
String href = link.getAttribute("href").getValue();
if (link.getAttribute("rel", OS_NS) == null || link.getAttribute("rel", OS_NS).getValue().equals("alternate")) {
href = resolveURI(null, link, href);
try {
baseURI = new URL(href);
break;
} catch (final MalformedURLException e) {
System.err.println("Base URI is malformed: " + href);
}
}
}
}
return baseURI;
}
}
代码示例来源:origin: org.apache.jspwiki/jspwiki-main
if ( constraint.equals( roleConstraint ) )
代码示例来源:origin: Unidata/thredds
NcmlCollectionReader(String ncmlLocation, Element netcdfElem) {
if (netcdfElem.equals(Catalog.ncmlNSHttps)) {
this.ncmlNS = Catalog.ncmlNSHttps;
} else {
内容来源于网络,如有侵权,请联系作者删除!