当前位置: 首页>>代码示例>>Java>>正文


Java OMElement.getChildElements方法代码示例

本文整理汇总了Java中org.apache.axiom.om.OMElement.getChildElements方法的典型用法代码示例。如果您正苦于以下问题:Java OMElement.getChildElements方法的具体用法?Java OMElement.getChildElements怎么用?Java OMElement.getChildElements使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.axiom.om.OMElement的用法示例。


在下文中一共展示了OMElement.getChildElements方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testTemplateWithValuesAndExpressions

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
@Test(groups = {"wso2.esb"}, description = "Template with values and expressions")
public void testTemplateWithValuesAndExpressions() throws IOException, XMLStreamException {
    String soapResponse = getResponse();
    assertNotNull(soapResponse, "Response message is null");
    OMElement response = AXIOMUtil.stringToOM(soapResponse);
    OMElement soapBody = response.getFirstElement();
    Iterator quoteBody = soapBody.getChildElements();
    int count = 0;
    while (quoteBody.hasNext()) {
        OMElement getQuote = (OMElement) quoteBody.next();
        String test = getQuote.getLocalName();
        assertEquals(test, "getQuoteResponse", "getQuoteResponse not match");
        OMElement omElement = getQuote.getFirstElement();
        String symbolResponse = omElement.getFirstChildWithName(
                new QName("http://services.samples/xsd", "symbol")).getText();
        assertEquals(symbolResponse, "WSO2", "Request symbol not changed");

        count++;
    }
    assertEquals(count, iterations, "number of responses different from requests");
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:22,代码来源:CallTemplateWithValuesAndExpressionTestCase.java

示例2: build

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
public static LocalRole build(OMElement localRoleOM) {
    LocalRole localRole = new LocalRole();

    Iterator<?> iter = localRoleOM.getChildElements();

    while (iter.hasNext()) {
        OMElement element = (OMElement) (iter.next());
        String elementName = element.getLocalName();

        if ("LocalRoleName".equals(elementName)) {
            localRole.setLocalRoleName(element.getText());
        } else if ("UserStoreId".equals(elementName)) {
            localRole.setUserStoreId(element.getText());
        }

    }

    return localRole;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:20,代码来源:LocalRole.java

示例3: build

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
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;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:17,代码来源:ApplicationPermission.java

示例4: build

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
public static InboundProvisioningConfig build(OMElement inboundProvisioningConfigOM) {
    InboundProvisioningConfig inboundProvisioningConfig = new InboundProvisioningConfig();

    if (inboundProvisioningConfigOM == null) {
        return inboundProvisioningConfig;
    }

    Iterator<?> iter = inboundProvisioningConfigOM.getChildElements();

    while (iter.hasNext()) {
        OMElement element = (OMElement) (iter.next());
        String elementName = element.getLocalName();

        if ("ProvisioningUserStore".equals(elementName)) {
            inboundProvisioningConfig.setProvisioningUserStore(element.getText());
        } else if ("IsProvisioningEnabled".equals(elementName) && element.getText() != null) {
            inboundProvisioningConfig.setProvisioningEnabled(Boolean.parseBoolean(element.getText()));
        } else if ("IsDumbModeEnabled".equals(elementName) && element.getText() != null) {
            inboundProvisioningConfig.setDumbMode(Boolean.parseBoolean(element.getText()));
        }
    }

    return inboundProvisioningConfig;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:25,代码来源:InboundProvisioningConfig.java

示例5: readChildElements

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private void readChildElements(OMElement serverConfig, Stack<String> nameStack) {

        for (Iterator childElements = serverConfig.getChildElements(); childElements.hasNext(); ) {
            OMElement element = (OMElement) childElements.next();
            nameStack.push(element.getLocalName());
            if (elementHasText(element)) {
                String key = getKey(nameStack);
                Object currentObject = configuration.get(key);
                String value = replaceSystemProperty(element.getText());
                if (currentObject == null) {
                    configuration.put(key, value);
                } else if (currentObject instanceof ArrayList) {
                    List<String> list = (ArrayList) currentObject;
                    if (!list.contains(value)) {
                        list.add(value);
                    }
                } else {
                    if (!value.equals(currentObject)) {
                        List arrayList = new ArrayList(2);
                        arrayList.add(currentObject);
                        arrayList.add(value);
                        configuration.put(key, arrayList);
                    }
                }
            }
            readChildElements(element, nameStack);
            nameStack.pop();
        }
    }
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:30,代码来源:FileBasedConfigurationBuilder.java

示例6: parseOrder

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
 * @param payload XML message content came inside the JMS message
 * @throws XMLStreamException on error
 */
private void parseOrder(String payload) throws XMLStreamException {
    InputStream is = new ByteArrayInputStream(payload.getBytes());
    javax.xml.stream.XMLStreamReader parser = XMLInputFactory
            .newInstance().createXMLStreamReader(is);
    StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(parser,
            null);
    SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
    // retrieve SOAP body
    SOAPBody soapBody = envelope.getBody();
    OMElement messageNode = soapBody.getFirstChildWithName(new QName(
            FIX_MSG));
    Iterator<?> messageElements = (Iterator<?>) messageNode
            .getChildElements();
    while (messageElements.hasNext()) {
        OMElement node = (OMElement) messageElements.next();
        if (node.getQName().getLocalPart().equals(FIX_MSG_BODY)) {
            Iterator<?> bodyElements = (Iterator<?>) node.getChildElements();
            while (bodyElements.hasNext()) {
                OMElement bodyNode = (OMElement) bodyElements.next();
                String tag = bodyNode
                        .getAttributeValue(new QName(FIX_MSG_ID));
                String value = bodyNode.getText();
                if (tag.equals(FIX_MSG_SYMBOL)) {
                    inSymbol = value;
                } else if (tag.equals(FIX_MSG_CLORDID)) {
                    inClOrderID = value;
                } else if (tag.equals(FIX_MSG_ORDQTY)) {
                    inQty = value;
                }
            }
        }
    }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:38,代码来源:AMQPConsumer.java

示例7: readExtensionPoints

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
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);
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:12,代码来源:FileBasedConfigurationBuilder.java

示例8: getProperties

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private Map<String, String> getProperties(OMElement parentElement) {

        Map<String, String> properties = new HashMap<>();
        if (parentElement != null) {
            Iterator iterator = parentElement.getChildElements();
            while (iterator.hasNext()) {
                OMElement element = (OMElement) iterator.next();
                String nameAttribute = element.getAttribute(new QName(SecurityConstants.NAME_LABEL)).
                        getAttributeValue();
                String value = element.getText();
                properties.put(nameAttribute, value);
            }
        }
        return properties;
    }
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:16,代码来源:SecurityConfigAdmin.java

示例9: build

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
public static JustInTimeProvisioningConfig build(OMElement justInTimeProvisioningConfigOM) {
    JustInTimeProvisioningConfig justInTimeProvisioningConfig = new JustInTimeProvisioningConfig();

    if (justInTimeProvisioningConfigOM == null) {
        return justInTimeProvisioningConfig;
    }

    Iterator<?> iter = justInTimeProvisioningConfigOM.getChildElements();

    while (iter.hasNext()) {
        OMElement element = (OMElement) (iter.next());
        String elementName = element.getLocalName();

        if ("UserStoreClaimUri".equals(elementName)) {
            justInTimeProvisioningConfig.setUserStoreClaimUri(element.getText());
        } else if ("ProvisioningUserStore".equals(elementName)) {
            justInTimeProvisioningConfig.setProvisioningUserStore(element.getText());
        } else if ("IsProvisioningEnabled".equals(elementName)) {
            if (element.getText() != null && element.getText().trim().length() > 0) {
                justInTimeProvisioningConfig.setProvisioningEnabled(Boolean
                        .parseBoolean(element.getText()));
            }
        }
    }

    return justInTimeProvisioningConfig;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:28,代码来源:JustInTimeProvisioningConfig.java

示例10: build

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
public static RequestPathAuthenticatorConfig build(OMElement requestPathAuthenticatorConfigOM) {
    RequestPathAuthenticatorConfig requestPathAuthenticatorConfig = new RequestPathAuthenticatorConfig();

    Iterator<?> members = requestPathAuthenticatorConfigOM.getChildElements();

    while (members.hasNext()) {
        OMElement member = (OMElement) members.next();

        if ("Name".equals(member.getLocalName())) {
            requestPathAuthenticatorConfig.setName(member.getText());
        } else if ("DisplayName".equals(member.getLocalName())) {
            requestPathAuthenticatorConfig.setDisplayName(member.getText());
        } else if ("IsEnabled".equals(member.getLocalName())) {
            requestPathAuthenticatorConfig.setEnabled(Boolean.parseBoolean(member.getText()));
        } else if ("Properties".equals(member.getLocalName())) {
            Iterator<?> propertiesIter = member.getChildElements();
            List<Property> propertiesArrList = new ArrayList<Property>();

            if (propertiesIter != null) {
                while (propertiesIter.hasNext()) {
                    OMElement propertiesElement = (OMElement) (propertiesIter.next());
                    Property prop = Property.build(propertiesElement);
                    propertiesArrList.add(prop);
                }
            }

            if (CollectionUtils.isNotEmpty(propertiesArrList)) {
                Property[] propertiesArr = propertiesArrList.toArray(new Property[0]);
                requestPathAuthenticatorConfig.setProperties(propertiesArr);
            }
        }
    }
    return requestPathAuthenticatorConfig;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:35,代码来源:RequestPathAuthenticatorConfig.java

示例11: build

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
public static FederatedAuthenticatorConfig build(OMElement federatedAuthenticatorConfigOM) {

        if (federatedAuthenticatorConfigOM == null) {
            return null;
        }

        FederatedAuthenticatorConfig federatedAuthenticatorConfig = new FederatedAuthenticatorConfig();

        Iterator<?> iter = federatedAuthenticatorConfigOM.getChildElements();

        while (iter.hasNext()) {
            OMElement element = (OMElement) (iter.next());
            String elementName = element.getLocalName();

            if ("Name".equals(elementName)) {
                federatedAuthenticatorConfig.setName(element.getText());
            } else if ("DisplayName".equals(elementName)) {
                federatedAuthenticatorConfig.setDisplayName(element.getText());
            } else if ("IsEnabled".equals(elementName)) {
                federatedAuthenticatorConfig.setEnabled(Boolean.parseBoolean(element.getText()));
            } else if ("Properties".equals(elementName)) {
                Iterator<?> propertiesIter = element.getChildElements();
                List<Property> propertiesArrList = new ArrayList<Property>();

                if (propertiesIter != null) {
                    while (propertiesIter.hasNext()) {
                        OMElement propertiesElement = (OMElement) (propertiesIter.next());
                        propertiesArrList.add(Property.build(propertiesElement));
                    }
                }

                if (CollectionUtils.isNotEmpty(propertiesArrList)) {
                    Property[] propertiesArr = propertiesArrList.toArray(new Property[0]);
                    federatedAuthenticatorConfig.setProperties(propertiesArr);
                }
            }
        }

        return federatedAuthenticatorConfig;
    }
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:41,代码来源:FederatedAuthenticatorConfig.java

示例12: readChildElements

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private void readChildElements(OMElement serverConfig, Stack<String> nameStack) {
    for (Iterator childElements = serverConfig.getChildElements(); childElements.hasNext(); ) {
        OMElement element = (OMElement) childElements.next();
        nameStack.push(element.getLocalName());
        if (elementHasText(element)) {
            String key = getKey(nameStack);
            Object currentObject = configuration.get(key);
            String value = replaceSystemProperty(element.getText());
            if (secretResolver != null && secretResolver.isInitialized() &&
                    secretResolver.isTokenProtected(key)) {
                value = secretResolver.resolve(key);
            }
            if (currentObject == null) {
                configuration.put(key, value);
            } else if (currentObject instanceof ArrayList) {
                List list = (ArrayList) currentObject;
                if (!list.contains(value)) {
                    list.add(value);
                }
            } else {
                if (!value.equals(currentObject)) {
                    List arrayList = new ArrayList(2);
                    arrayList.add(currentObject);
                    arrayList.add(value);
                    configuration.put(key, arrayList);
                }
            }
        }
        readChildElements(element, nameStack);
        nameStack.pop();
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:33,代码来源:ThriftAuthenticationConfigParser.java

示例13: processSequenceElement

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
 * Create SequenceDOs for each sequence entry
 *
 * @param sequenceElem
 * @return
 */
private SequenceConfig processSequenceElement(OMElement sequenceElem) {
    SequenceConfig sequenceConfig = new SequenceConfig();

    String applicationId = "default";
    OMAttribute appIdAttr = sequenceElem.getAttribute(new QName(FrameworkConstants.Config.ATTR_APPLICATION_ID));

    if (appIdAttr != null) {
        applicationId = appIdAttr.getAttributeValue();
    }

    sequenceConfig.setApplicationId(applicationId);

    OMAttribute forceAuthnAttr = sequenceElem.getAttribute(new QName(FrameworkConstants.Config.ATTR_FORCE_AUTHENTICATE));

    if (forceAuthnAttr != null) {
        sequenceConfig.setForceAuthn(Boolean.valueOf(forceAuthnAttr.getAttributeValue()));
    }

    OMAttribute checkAuthnAttr = sequenceElem.getAttribute(new QName(FrameworkConstants.Config.ATTR_CHECK_AUTHENTICATE));

    if (checkAuthnAttr != null) {
        sequenceConfig.setCheckAuthn(Boolean.valueOf(checkAuthnAttr.getAttributeValue()));
    }

    //RequestPathAuthenticators
    OMElement reqPathAuthenticatorsElem = sequenceElem.getFirstChildWithName(IdentityApplicationManagementUtil.
            getQNameWithIdentityApplicationNS(FrameworkConstants.Config.ELEM_REQ_PATH_AUTHENTICATOR));

    if (reqPathAuthenticatorsElem != null) {

        for (Iterator reqPathAuthenticatorElems = reqPathAuthenticatorsElem.getChildElements(); reqPathAuthenticatorElems.hasNext(); ) {
            OMElement reqPathAuthenticatorElem = (OMElement) reqPathAuthenticatorElems.next();

            String authenticatorName = reqPathAuthenticatorElem.getAttributeValue(IdentityApplicationManagementUtil.
                    getQNameWithIdentityApplicationNS(FrameworkConstants.Config.ATTR_AUTHENTICATOR_NAME));
            AuthenticatorConfig authenticatorConfig = authenticatorConfigMap.get(authenticatorName);
            sequenceConfig.getReqPathAuthenticators().add(authenticatorConfig);
        }
    }

    // for each step defined, create a StepDO instance
    for (Iterator stepElements = sequenceElem.getChildrenWithLocalName(FrameworkConstants.Config.ELEM_STEP);
         stepElements.hasNext(); ) {
        StepConfig stepConfig = processStepElement((OMElement) stepElements.next());

        if (stepConfig != null) {
            sequenceConfig.getStepMap().put(stepConfig.getOrder(), stepConfig);
        }
    }

    return sequenceConfig;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:59,代码来源:FileBasedConfigurationBuilder.java

示例14: build

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
public static LocalAuthenticatorConfig build(OMElement localAuthenticatorConfigOM) {
    LocalAuthenticatorConfig localAuthenticatorConfig = new LocalAuthenticatorConfig();

    if (localAuthenticatorConfigOM == null) {
        return new LocalAuthenticatorConfig();
    }

    Iterator<?> members = localAuthenticatorConfigOM.getChildElements();

    while (members.hasNext()) {

        OMElement member = (OMElement) members.next();


        if ("Name".equals(member.getLocalName())) {
            localAuthenticatorConfig.setName(member.getText());
        } else if ("DisplayName".equals(member.getLocalName())) {
            localAuthenticatorConfig.setDisplayName(member.getText());
        } else if ("IsEnabled".equals(member.getLocalName())) {
            if (member.getText() != null && member.getText().trim().length() > 0) {
                localAuthenticatorConfig.setEnabled(Boolean.parseBoolean(member.getText()));
            }
        } else if ("Properties".equals(member.getLocalName())) {

            Iterator<?> propertiesIter = member.getChildElements();
            ArrayList<Property> propertiesArrList = new ArrayList<Property>();

            if (propertiesIter != null) {
                while (propertiesIter.hasNext()) {
                    OMElement propertiesElement = (OMElement) (propertiesIter.next());
                    Property prop = Property.build(propertiesElement);
                    if (prop != null) {
                        propertiesArrList.add(prop);
                    }
                }
            }

            if (CollectionUtils.isNotEmpty(propertiesArrList)) {
                Property[] propertiesArr = propertiesArrList.toArray(new Property[0]);
                localAuthenticatorConfig.setProperties(propertiesArr);
            }
        }
    }
    return localAuthenticatorConfig;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:46,代码来源:LocalAuthenticatorConfig.java

示例15: build

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
public static AuthenticationStep build(OMElement authenticationStepOM) {
    AuthenticationStep authenticationStep = new AuthenticationStep();

    Iterator<?> iter = authenticationStepOM.getChildElements();


    while (iter.hasNext()) {
        OMElement member = (OMElement) iter.next();
        if ("StepOrder".equals(member.getLocalName())) {
            authenticationStep.setStepOrder(Integer.parseInt(member.getText()));
        } else if ("SubjectStep".equals(member.getLocalName())) {
            if (member.getText() != null && member.getText().trim().length() > 0) {
                authenticationStep.setSubjectStep(Boolean.parseBoolean(member.getText()));
            }
        } else if ("AttributeStep".equals(member.getLocalName())) {
            if (member.getText() != null && member.getText().trim().length() > 0) {
                authenticationStep.setAttributeStep(Boolean.parseBoolean(member.getText()));
            }
        } else if ("FederatedIdentityProviders".equals(member.getLocalName())) {

            Iterator<?> federatedIdentityProvidersIter = member.getChildElements();
            List<IdentityProvider> federatedIdentityProvidersArrList = new ArrayList<IdentityProvider>();

            if (federatedIdentityProvidersIter != null) {
                while (federatedIdentityProvidersIter.hasNext()) {
                    OMElement federatedIdentityProvidersElement = (OMElement) (federatedIdentityProvidersIter
                            .next());
                    IdentityProvider idp = IdentityProvider
                            .build(federatedIdentityProvidersElement);
                    if (idp != null) {
                        federatedIdentityProvidersArrList.add(idp);
                    }
                }
            }

            if (CollectionUtils.isNotEmpty(federatedIdentityProvidersArrList)) {
                IdentityProvider[] federatedAuthenticatorConfigsArr = federatedIdentityProvidersArrList
                        .toArray(new IdentityProvider[0]);
                authenticationStep
                        .setFederatedIdentityProviders(federatedAuthenticatorConfigsArr);
            }
        } else if ("LocalAuthenticatorConfigs".equals(member.getLocalName())) {

            Iterator<?> localAuthenticatorConfigsIter = member.getChildElements();
            List<LocalAuthenticatorConfig> localAuthenticatorConfigsArrList = new ArrayList<LocalAuthenticatorConfig>();

            if (localAuthenticatorConfigsIter != null) {
                while (localAuthenticatorConfigsIter.hasNext()) {
                    OMElement localAuthenticatorConfigsElement = (OMElement) (localAuthenticatorConfigsIter
                            .next());
                    LocalAuthenticatorConfig localAuthConfig = LocalAuthenticatorConfig
                            .build(localAuthenticatorConfigsElement);
                    if (localAuthConfig != null) {
                        localAuthenticatorConfigsArrList.add(localAuthConfig);
                    }
                }
            }

            if (CollectionUtils.isNotEmpty(localAuthenticatorConfigsArrList)) {
                LocalAuthenticatorConfig[] localAuthenticatorConfigsArr = localAuthenticatorConfigsArrList
                        .toArray(new LocalAuthenticatorConfig[0]);
                authenticationStep.setLocalAuthenticatorConfigs(localAuthenticatorConfigsArr);
            }
        }
    }
    return authenticationStep;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:68,代码来源:AuthenticationStep.java


注:本文中的org.apache.axiom.om.OMElement.getChildElements方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。