org.jdom.Namespace.equals()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(121)

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

Namespace.equals介绍

[英]This tests for equality - Two Namespaces are equal if and only if their URIs are byte-for-byte equals.
[中]这个测试是否相等——两个Namespaces当且仅当它们的URI是字节对字节相等时才相等。

代码示例

代码示例来源:origin: jaxen/jaxen

if (!Namespace.getNamespace(namespacePrefix, namespaceURI).equals(el.getNamespace())) {
  return JaxenConstants.EMPTY_ITERATOR;

代码示例来源:origin: org.jdom/jdom-legacy

/**
 * Returns whether the two filters are equivalent (i.e. the
 * matching names and namespace are equivalent).
 *
 * @param  obj                   the object to compare against
 * @return                     whether the two filters are equal
 */
public boolean equals(Object obj) {
  // Generated by IntelliJ
  if (this == obj) return true;
  if (!(obj instanceof ElementFilter)) return false;
  final ElementFilter filter = (ElementFilter) obj;
  if (name != null ? !name.equals(filter.name) : filter.name != null) return false;
  if (namespace != null ? !namespace.equals(filter.namespace) : filter.namespace != null) return false;
  return true;
}

代码示例来源:origin: net.bpelunit/framework

public static List<Element> getTargets(Element child) {
  Namespace ns = getProcessNamespace();
  List<Element> targets = new ArrayList<Element>();
  if (ns.equals(NAMESPACE_BPEL_1_1)) {
    targets.addAll(child.getChildren(TARGET_ELEMENT, ns));
  } else if (ns.equals(NAMESPACE_BPEL_2_0)) {
    Element target = child.getChild(TARGETS_ELEMENT, ns);
    if (target != null) {
      targets.add(target);
    }
  }
  return targets;
}

代码示例来源:origin: rome/rome

private boolean hasElementsFrom(Element root, Namespace namespace) {
    boolean hasElements = false;
//        boolean hasElements = namespace.equals(root.getNamespace());

    if (!hasElements) {
      List children = root.getChildren();
      for (int i=0;!hasElements && i < children.size();i++) {
        Element child = (Element) children.get(i);
        hasElements = namespace.equals(child.getNamespace());
      }
    }
    return hasElements;
  }
}

代码示例来源:origin: com.sun.syndication/com.springsource.com.sun.syndication

private boolean hasElementsFrom(Element root, Namespace namespace) {
    boolean hasElements = false;
//        boolean hasElements = namespace.equals(root.getNamespace());

    if (!hasElements) {
      List children = root.getChildren();
      for (int i=0;!hasElements && i < children.size();i++) {
        Element child = (Element) children.get(i);
        hasElements = namespace.equals(child.getNamespace());
      }
    }
    return hasElements;
  }
}

代码示例来源:origin: org.codehaus.xfire/xfire-core

public List getAny()
{
  List any = new ArrayList();
  for (Iterator iter = element.getChildren().iterator(); iter.hasNext();)
  {
    Element elem = (Element) iter.next();
    if (!element.getNamespace().equals(elem.getNamespace()))
    {
      any.add(elem);
    }
  }
  return any;
}

代码示例来源:origin: org.jdom/jdom-legacy

/**
 * Check to see if the object matches a predefined set of rules.
 *
 * @param obj The object to verify.
 * @return <code>true</code> if the objected matched a predfined
 *           set of rules.
 */
public boolean matches(Object obj) {
  if (obj instanceof Element) {
    Element el = (Element) obj;
    return
     (this.name == null || this.name.equals(el.getName())) &&
     (this.namespace == null || this.namespace.equals(el.getNamespace()));
  }
  return false;
}

代码示例来源:origin: rome/rome

public boolean isMyType(Document document) {
  Element rssRoot = document.getRootElement();
  Namespace defaultNS = rssRoot.getNamespace();
  return (defaultNS!=null) && defaultNS.equals(getAtomNamespace());
}

代码示例来源:origin: rome/rome

public boolean isMyType(Document document) {
  Element rssRoot = document.getRootElement();
  Namespace defaultNS = rssRoot.getNamespace();
  return (defaultNS!=null) && defaultNS.equals(getAtomNamespace());
}

代码示例来源:origin: com.sun.syndication/com.springsource.com.sun.syndication

public boolean isMyType(Document document) {
  Element rssRoot = document.getRootElement();
  Namespace defaultNS = rssRoot.getNamespace();
  return (defaultNS!=null) && defaultNS.equals(getAtomNamespace());
}

代码示例来源:origin: com.sun.syndication/com.springsource.com.sun.syndication

public boolean isMyType(Document document) {
  Element rssRoot = document.getRootElement();
  Namespace defaultNS = rssRoot.getNamespace();
  return (defaultNS!=null) && defaultNS.equals(getAtomNamespace());
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-aal

private SecurityAuthority importAuthority(Element element) {
  if (getTns().equals(element.getNamespace())) {
    
    if ("loginEntry".equals(element.getName())) {
      return new LoginIdentity(element.getAttributeValue("login"));				
    }              
    
  } 
  /* TODO output warning that the authority cannot be imported */
  return null;
}

代码示例来源:origin: DSpace/DSpace

private static void applyDim(Context context, List<Element> dimList, Item item, boolean createMissingMetadataFields)
  throws CrosswalkException, SQLException, AuthorizeException {
  for (Element elt : dimList) {
    if ("field".equals(elt.getName()) && DIM_NS.equals(elt.getNamespace())) {
      applyDimField(context, elt, item, createMissingMetadataFields);
    } else if ("dim".equals(elt.getName()) && DIM_NS.equals(elt.getNamespace())) {
      // if it's a <dim> container, apply its guts
      applyDim(context, elt.getChildren(), item, createMissingMetadataFields);
    } else {
      log.error("Got unexpected element in DIM list: " + elt.toString());
      throw new MetadataValidationException("Got unexpected element in DIM list: " + elt.toString());
    }
  }
}

代码示例来源:origin: rome/rome

public boolean isMyType(Document document) {
  Element rssRoot = document.getRootElement();
  Namespace defaultNS = rssRoot.getNamespace();
  boolean ok = defaultNS!=null && defaultNS.equals(getRSSNamespace());
  if (ok) {
    ok = super.isMyType(document);
  }
  return ok;
}

代码示例来源:origin: com.sun.syndication/com.springsource.com.sun.syndication

public boolean isMyType(Document document) {
  Element rssRoot = document.getRootElement();
  Namespace defaultNS = rssRoot.getNamespace();
  boolean ok = defaultNS!=null && defaultNS.equals(getRSSNamespace());
  if (ok) {
    ok = super.isMyType(document);
  }
  return ok;
}

代码示例来源:origin: rome/modules

public void generate(Module module, Element element) {
Element root = element;
while( root.getParentElement() != null ){
  root = root.getParentElement();
}
if( root.getNamespace().equals( RDF )|| root.getNamespace().equals( RSS )){
  generateRSS1( (CreativeCommons) module, element);
} else {
  generateRSS2( (CreativeCommons) module, element);
}
}

代码示例来源:origin: org.rometools/rome-modules

public void generate(Module module, Element element) {
Element root = element;
while( root.getParentElement() != null ){
  root = root.getParentElement();
}
if( root.getNamespace().equals( RDF )|| root.getNamespace().equals( RSS )){
  generateRSS1( (CreativeCommons) module, element);
} else {
  generateRSS2( (CreativeCommons) module, element);
}
}

代码示例来源:origin: de.smartics.properties/smartics-properties-config

private static void checkNamespace(final String systemId,
  final Document document)
{
 final Namespace actualNamespace = document.getRootElement().getNamespace();
 if (!NS.equals(actualNamespace))
 {
  throw new ConfigException(namespace(systemId, NS.getURI(),
    actualNamespace.getURI()));
 }
}

代码示例来源:origin: de.smartics.properties/smartics-properties-config

private static void checkNamespace(final String systemId,
  final Document document)
{
 final Namespace actualNamespace = document.getRootElement().getNamespace();
 if (!NS.equals(actualNamespace))
 {
  throw new ConfigException(namespace(systemId, NS.getURI(),
    actualNamespace.getURI()));
 }
}

代码示例来源:origin: net.bpelunit/framework

private void createMarkerForLink2(Element link, Element sourceElement,
    String transitionCondition) {
  Element sourceActivity = null;
  if (getProcessNamespace().equals(NAMESPACE_BPEL_2_0)) {
    sourceActivity = sourceElement.getParentElement()
        .getParentElement();
  } else if (getProcessNamespace().equals(NAMESPACE_BPEL_1_1)) {
    sourceActivity = sourceElement.getParentElement();
  }
  Element enclosedFlow = encloseElementInFlow(sourceActivity);
  Element newLink = insertPostivLink(enclosedFlow, sourceElement, link,
      transitionCondition);
  insertLoggingMarker(newLink, enclosedFlow, true);
  newLink = insertNegativLink(enclosedFlow, sourceElement, link,
      transitionCondition);
  insertLoggingMarker(newLink, enclosedFlow, false);
}

相关文章