org.apache.axiom.om.OMElement.getChildElements()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(127)

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

OMElement.getChildElements介绍

[英]Returns a filtered list of children - just the elements.
[中]返回一个经过筛选的子元素列表——仅返回元素。

代码示例

代码示例来源:origin: org.apache.neethi/neethi

@SuppressWarnings("unchecked")
  public Iterator<OMElement> getChildren(OMElement el) {
    return el.getChildElements();
  }
}

代码示例来源:origin: org.apache.axis2/axis2-transport-testkit

private static int countChildren(OMElement element) {
    int count = 0;
    for (Iterator<?> it = element.getChildElements(); it.hasNext(); count++) {
      it.next();
    }
    return count;
  }
}

代码示例来源:origin: org.wso2.carbon.commons/org.wso2.carbon.reporting.template.core

private int getColumnsCount() {
  Iterator iterator = tableReportElement.getChildElements();
  int count = 0;
  while (iterator.hasNext()) {
    count++;
    iterator.next();
  }
  return count;
}

代码示例来源:origin: org.apache.axis2/axis2-saaj

public void removeContents() {
  //We will get all the children and iteratively call the detach() on all of 'em.
  Iterator childIter = omTarget.getChildElements();
  while (childIter.hasNext()) {
    childIter.next();
    childIter.remove();
  }
}

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions

public void setSmartLifecycleLinks(OMElement locationConfiguration) throws RegistryException {
  Iterator confElements = locationConfiguration.getChildElements();
  while (confElements.hasNext()) {
    OMElement confElement = (OMElement)confElements.next();
    if (confElement.getQName().equals(new QName("key"))) {
      smartLifecycleLinks.add(confElement.getText());
    }
  }
}

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions

public void setSmartLifecycleLinks(OMElement locationConfiguration) throws RegistryException {
  Iterator confElements = locationConfiguration.getChildElements();
  while (confElements.hasNext()) {
    OMElement confElement = (OMElement)confElements.next();
    if (confElement.getQName().equals(new QName("key"))) {
      smartLifecycleLinks.add(confElement.getText());
    }
  }
}

代码示例来源:origin: org.apache.axis2/axis2-kernel

public static Iterator<OMElement> getPolicyRefChildren(OMElement parent) {
    List<OMElement> policyRefs = new ArrayList<OMElement>();
    Iterator children = parent.getChildElements();
    while (children.hasNext()) {
      OMElement child = (OMElement)children.next();
      if (Constants.isPolicyRef(child.getQName())) {
        policyRefs.add(child);
      }
    }
    return policyRefs.iterator();
  }
}

代码示例来源:origin: org.apache.axis2/axis2-kernel

public static Iterator<OMElement> getPolicyChildren(OMElement parent) {
  List<OMElement> policies = new ArrayList<OMElement>();
  Iterator children = parent.getChildElements();
  while (children.hasNext()) {
    OMElement child = (OMElement)children.next();
    if (Constants.isPolicyElement(child.getQName())) {
      policies.add(child);
    }
  }
  return policies.iterator();
}

代码示例来源:origin: org.wso2.carbon.appmgt/org.wso2.carbon.appmgt.impl

private void populate(OMElement configRoot) {
  Iterator<OMElement> rootLevelChildren = configRoot.getChildElements();
  while(rootLevelChildren.hasNext()){
    addProperties(rootLevelChildren.next(), null);
  }
}

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

/**
 * Construct from owning elements with local name filter.
 * 
 * @param ele
 *            the owning element
 * @param filter
 *            the local name filter
 */
public Elements(final OMElement ele, final String filter) {
  super(filter == null ? ele.getChildElements() : ele.getChildrenWithLocalName(filter));
}

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions

public void setStates(OMElement locationConfiguration) throws RegistryException {
  Iterator confElements = locationConfiguration.getChildElements();
  while (confElements.hasNext()) {
    OMElement confElement = (OMElement)confElements.next();
    if (confElement.getQName().equals(new QName("state"))) {
      states.put(confElement.getAttributeValue(new QName("key")), confElement.getText());
    }
  }
}

代码示例来源:origin: org.apache.axis2/axis2-adb

private void readallChildElements() {
  Iterator childs = parent.getChildElements();
  while (childs.hasNext()) {
    OMElement omElement = (OMElement)childs.next();
    OMAttribute id = omElement.getAttribute(new QName("id"));
    if (id != null) {
      childs.remove();
      elementMap.put(id.getAttributeValue(), omElement);
    }
  }
  filledTable = true;
}

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

private static void findPrefixNamespaces(OMElement e, Set<OMNamespace> results) {
  Iterator iterator = e.getAllDeclaredNamespaces();
  if (iterator != null) {
    while (iterator.hasNext())
      results.add((OMNamespace)iterator.next());
  }
  Iterator children = e.getChildElements();
  while (children.hasNext()) {
    findPrefixNamespaces((OMElement) children.next(), results);
  }
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.common

public static ApplicationPermission build(OMElement applicationPermissionOM) {
  ApplicationPermission applicationPermission = new ApplicationPermission();
  Iterator<?> iter = applicationPermissionOM.getChildElements();
  while (iter.hasNext()) {
    OMElement element = (OMElement) (iter.next());
    String elementName = element.getLocalName();
    if ("value".equals(elementName)) {
      applicationPermission.setValue(element.getText());
    }
  }
  return applicationPermission;
}

代码示例来源:origin: org.apache.axis2/axis2-transport-testkit

public RESTMessage decode(ContentType contentType, AxisMessage message) throws Exception {
    List<Parameter> parameters = new LinkedList<Parameter>();
    OMElement content = message.getEnvelope().getBody().getFirstElement();
    for (Iterator<?> it = content.getChildElements(); it.hasNext(); ) {
      OMElement child = (OMElement)it.next();
      parameters.add(new Parameter(child.getLocalName(), child.getText()));
    }
    return new RESTMessage(parameters.toArray(new Parameter[parameters.size()]));
  }
};

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.authentication.framework

private void readExtensionPoints(OMElement documentElement) {
  OMElement extensionsElem = documentElement.getFirstChildWithName(IdentityApplicationManagementUtil.
      getQNameWithIdentityApplicationNS(FrameworkConstants.Config.QNAME_EXTENSIONS));
  if (extensionsElem != null) {
    for (Iterator extChildElems = extensionsElem.getChildElements(); extChildElems.hasNext(); ) {
      OMElement extensionElem = (OMElement) extChildElems.next();
      instantiateClass(extensionElem);
    }
  }
}

代码示例来源:origin: org.apache.axis2/axis2-kernel

public Phase makePhase(OMElement phaseElement) throws PhaseException {
  String phaseName = phaseElement.getAttributeValue(new QName("name"));
  Phase phase = new Phase(phaseName);
  Iterator children = phaseElement.getChildElements();
  while (children.hasNext()) {
    OMElement handlerElement = (OMElement) children.next();
    HandlerDescription handlerDesc = makeHandler(handlerElement);
    phase.addHandler(handlerDesc);
  }
  return phase;
}

代码示例来源:origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core

@SuppressWarnings("unchecked")
private void secureVaultResolve(OMElement dbsElement) {
  String secretAliasAttr = dbsElement.getAttributeValue(
      new QName(DataSourceConstants.SECURE_VAULT_NS, DataSourceConstants.SECRET_ALIAS_ATTR_NAME));
  if (secretAliasAttr != null) {
    dbsElement.setText(DBUtils.loadFromSecureVault(secretAliasAttr));
  }
  Iterator<OMElement> childEls = (Iterator<OMElement>) dbsElement.getChildElements();
  while (childEls.hasNext()) {
    this.secureVaultResolve(childEls.next());
  }
}

代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.identity.application.authentication.framework

private void readExtensionPoints(OMElement documentElement) {
  OMElement extensionsElem = documentElement.getFirstChildWithName(IdentityApplicationManagementUtil.
      getQNameWithIdentityApplicationNS(FrameworkConstants.Config.QNAME_EXTENSIONS));
  if (extensionsElem != null) {
    for (Iterator extChildElems = extensionsElem.getChildElements(); extChildElems.hasNext(); ) {
      OMElement extensionElem = (OMElement) extChildElems.next();
      if (isValidExtension(extensionElem)) {
        instantiateClass(extensionElem);
      }
    }
  }
}

代码示例来源:origin: org.apache.rampart/rampart-policy

public Assertion build(OMElement element, AssertionBuilderFactory factory) throws IllegalArgumentException {
  
  RequiredElements requiredElements = new RequiredElements(SPConstants.SP_V11);
  OMAttribute attrXPathVersion = element.getAttribute(SP11Constants.ATTR_XPATH_VERSION);
  
  if (attrXPathVersion != null) {
    requiredElements.setXPathVersion(attrXPathVersion.getAttributeValue());
  }
  
  for (Iterator iterator = element.getChildElements(); iterator.hasNext();) {
    processElement((OMElement) iterator.next(),requiredElements);            
  }
  
  return requiredElements;
}

相关文章

微信公众号

最新文章

更多