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


Java OMAttribute.getAttributeValue方法代码示例

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


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

示例1: validate1

import org.apache.axiom.om.OMAttribute; //导入方法依赖的package包/类
public void validate1(OMElement root) {
	String localname = root.getLocalName();
	
	if (isIdentifiable(localname)) {

		OMAttribute home_att = root.getAttribute(MetadataSupport.home_qname);

		if (home_att == null) {
			errs += "\nElement of type " + localname + " does not contain a home attribute";
		} else {
			String home1 = home_att.getAttributeValue();
			if (home1 == null) home1 = "";
			if ( !home1.equals(home))
				errs += "\nElement of type " + localname + " has home of [" + home1 + "] which does not match expected value of [" + home + "]"; 
		}
	}

	for (OMNode child=root.getFirstElement(); child != null; child=child.getNextOMSibling()) {
		OMElement child_e = (OMElement) child;
		validate1(child_e);
	}
}
 
开发者ID:jembi,项目名称:openxds,代码行数:23,代码来源:HomeAttribute.java

示例2: dup_wrapper1

import org.apache.axiom.om.OMAttribute; //导入方法依赖的package包/类
OMElement dup_wrapper1(OMElement e) {
	OMElement e_dup = om_factory().createOMElement(e.getLocalName(),
			e.getNamespace());
	for (Iterator it = e.getAllAttributes(); it.hasNext();) {
		OMAttribute a = (OMAttribute) it.next();
		String name = a.getLocalName();
		String value = a.getAttributeValue();
		e_dup.addAttribute(name, value, null);
	}
	if (e.getLocalName().equals(wrapper.getLocalName())) {
		wrapperDup = e_dup;
		return e_dup;
	}
	for (Iterator it = e.getChildElements(); it.hasNext();) {
		OMElement ele = (OMElement) it.next();
		OMElement ele_dup = dup_wrapper1(ele);
		e_dup.addChild(ele_dup);
	}
	return e_dup;
}
 
开发者ID:jembi,项目名称:openxds,代码行数:21,代码来源:Metadata.java

示例3: validate_internal_classifications

import org.apache.axiom.om.OMAttribute; //导入方法依赖的package包/类
void validate_internal_classifications(OMElement e) throws MetadataValidationException, MetadataException {
	String e_id = e.getAttributeValue(MetadataSupport.id_qname);
	if (e_id == null || e_id.equals(""))
		return;
	for (Iterator it=e.getChildElements(); it.hasNext(); ) {
		OMElement child = (OMElement) it.next();
		OMAttribute classified_object_att = child.getAttribute(MetadataSupport.classified_object_qname);
		if (classified_object_att != null) {
			String value = classified_object_att.getAttributeValue();
			if ( !e_id.equals(value)) {
				throw new MetadataValidationException("Classification " + m.getIdentifyingString(child) + 
						"\n   is nested inside " + m.getIdentifyingString(e) +
						"\n   but classifies object " + m.getIdentifyingString(value));
			}
		}
	}
}
 
开发者ID:jembi,项目名称:openxds,代码行数:18,代码来源:Validator.java

示例4: processIdExpression

import org.apache.axiom.om.OMAttribute; //导入方法依赖的package包/类
protected void processIdExpression(T tag, IParserContext context) {
	IdAttribute a = ReflectUtils.getAnnotation(tag.getClass(), IdAttribute.class);
	if (a != null) {
		final String id = a.value();
		if (IdAttribute.NO_ID_SUPPORT.equals(id)) {
			return;
		}

		OMElement ele = context.getElement();
		QName qn = new QName("", id);
		OMAttribute at = ele.getAttribute(qn);
		if (at != null) {
			String attr = at.getAttributeValue();
			if (StringUtils.isBlank(attr)) {
				throw new PaxmlRuntimeException("Id attribute cannot be given as blank: " + qn);
			}
			tag.setIdExpression(new IdExpression(ExpressionFactory.create(attr), qn));
		}

	}
}
 
开发者ID:niuxuetao,项目名称:paxml,代码行数:22,代码来源:AbstractTagFactory.java

示例5: processOperationModuleConfig

import org.apache.axiom.om.OMAttribute; //导入方法依赖的package包/类
protected void processOperationModuleConfig(Iterator moduleConfigs,
		ParameterInclude parent, AxisOperation operation)
		throws DeploymentException {
	while (moduleConfigs.hasNext()) {
		OMElement moduleConfig = (OMElement) moduleConfigs.next();
		OMAttribute moduleName_att = moduleConfig.getAttribute(new QName(
				ATTRIBUTE_NAME));

		if (moduleName_att == null) {
			throw new DeploymentException(Messages
					.getMessage(DeploymentErrorMsgs.INVALID_MODULE_CONFIG));
		} else {
			String module = moduleName_att.getAttributeValue();
			ModuleConfiguration moduleConfiguration = new ModuleConfiguration(
					module, parent);
			Iterator parameters = moduleConfig
					.getChildrenWithName(new QName(TAG_PARAMETER));

			processParameters(parameters, moduleConfiguration, parent);
			operation.addModuleConfig(moduleConfiguration);
		}
	}
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:24,代码来源:ServiceBuilder.java

示例6: getSOAPBodyIdRef

import org.apache.axiom.om.OMAttribute; //导入方法依赖的package包/类
/**
 * Helper method to retrieve the value of the id of the SOAP <code>Body</code> element.
 * <a>As described in the WS-Security spec valid id attributes are:<ul>
 * <li>Local ID attributes on XML Signature elements</li>
 * <li>Local ID attributes on XML Encryption elements</li>
 * <li>Global wsu:Id attributes (described below) on elements</li>
 * <li>Profile specific defined identifiers</li>
 * <li>Global xml:id attributes on elements</li>
 * </ul>
 * So for the SOAP <code>Body</code> element the possible id attributes are <code>wsu:Id</code> and
 * <code>xml:id</code>.
 *
 * @param mc    The current message context
 * @return      The id reference for the SOAP Body element if it has an id attribute, or<br>
 *              <code>null</code> if no id attribute is found on the SOAP Body element
 */
private String getSOAPBodyIdRef(final MessageContext mc) {
    String  bodyId = null;

    final SOAPBody body = mc.getEnvelope().getBody();
    for(final Iterator<OMAttribute> attributes = body.getAllAttributes(); attributes.hasNext() && bodyId == null;) {
        final OMAttribute attr = attributes.next();

        if (SecurityConstants.QNAME_WSU_ID.equals(attr.getQName()))
            bodyId = attr.getAttributeValue();
        else if (EbMSConstants.QNAME_XMLID.equals(attr.getQName()))
            bodyId = attr.getAttributeValue();
    }

    // As we need to return the reference the id must be prefixed with a '#'
    return bodyId != null ? "#" + bodyId : null;
}
 
开发者ID:holodeck-b2b,项目名称:Holodeck-B2B,代码行数:33,代码来源:CheckSignatureCompleteness.java

示例7: processAnalyticsServerProfileName

import org.apache.axiom.om.OMAttribute; //导入方法依赖的package包/类
/**
 * Reading Analytics Server profile name and Agent type and setting them to given analyticsServerProfile instance.
 *
 * @param analyticsServerConfig  OMElement of analyticsServerConfig
 * @param analyticsServerProfile AnalyticsServerProfile instance
 */
private void processAnalyticsServerProfileName(OMElement analyticsServerConfig,
                                               AnalyticsServerProfile analyticsServerProfile) {
    OMAttribute name = analyticsServerConfig.getAttribute(new QName(AnalyticsConstants.NAME));
    if (name != null && name.getAttributeValue() != null &&
            !AnalyticsConstants.EMPTY.equals(name.getAttributeValue().trim())) {
        analyticsServerProfile.setName(name.getAttributeValue().trim());
    } else {
        String errMsg =
                AnalyticsConstants.NAME + " attribute not found for Analytics server profile: " + profileLocation;
        handleError(errMsg);
    }
    OMAttribute type = analyticsServerConfig.getAttribute(new QName(AnalyticsConstants.TYPE));
    if (type != null && type.getAttributeValue() != null &&
            !AnalyticsConstants.EMPTY.equals(type.getAttributeValue().trim())) {
        analyticsServerProfile.setType(type.getAttributeValue().trim());
    } else {
        // This value can be null or empty. Then default agent will get selected.
        analyticsServerProfile.setType(null);
    }
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:27,代码来源:AnalyticsServerProfileBuilder.java

示例8: processOperationModuleRefs

import org.apache.axiom.om.OMAttribute; //导入方法依赖的package包/类
protected void processOperationModuleRefs(Iterator moduleRefs,
                                              AxisOperation operation) throws DeploymentException {
//        try {
            while (moduleRefs.hasNext()) {
                OMElement moduleref = (OMElement) moduleRefs.next();
                OMAttribute moduleRefAttribute = moduleref
                        .getAttribute(new QName(TAG_REFERENCE));

                if (moduleRefAttribute != null) {
                    String refName = moduleRefAttribute.getAttributeValue();
                    operation.addModule(refName);

//                    if (axisConfig.getModule(refName) == null) {
//                        throw new DeploymentException(Messages.getMessage(
//                                DeploymentErrorMsgs.MODULE_NOT_FOUND, refName));
//                    } else {
//                        operation.addModule(refName);
//                    }
                }
            }
//        } catch (AxisFault axisFault) {
//            throw new DeploymentException(Messages.getMessage(
//                    DeploymentErrorMsgs.MODULE_NOT_FOUND, axisFault
//                    .getMessage()), axisFault);
//        }
    }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:27,代码来源:DescriptionBuilder.java

示例9: processDataLocatorConfig

import org.apache.axiom.om.OMAttribute; //导入方法依赖的package包/类
private void processDataLocatorConfig(OMElement dataLocatorElement,
		AxisService service) {
	OMAttribute serviceOverallDataLocatorclass = dataLocatorElement
			.getAttribute(new QName(DRConstants.CLASS_ATTRIBUTE));
	if (serviceOverallDataLocatorclass != null) {
		String className = serviceOverallDataLocatorclass
				.getAttributeValue();
		service.addDataLocatorClassNames(DRConstants.SERVICE_LEVEL,
				className);
	}
	Iterator iterator = dataLocatorElement.getChildrenWithName(new QName(
			DRConstants.DIALECT_LOCATOR_ELEMENT));

	while (iterator.hasNext()) {
		OMElement locatorElement = (OMElement) iterator.next();
		OMAttribute dialect = locatorElement.getAttribute(new QName(
				DRConstants.DIALECT_ATTRIBUTE));
		OMAttribute dialectclass = locatorElement.getAttribute(new QName(
				DRConstants.CLASS_ATTRIBUTE));
		service.addDataLocatorClassNames(dialect.getAttributeValue(),
				dialectclass.getAttributeValue());

	}

}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:26,代码来源:ServiceBuilder.java

示例10: processTargetResolvers

import org.apache.axiom.om.OMAttribute; //导入方法依赖的package包/类
private void processTargetResolvers(AxisConfiguration axisConfig, OMElement targetResolvers) {
    if (targetResolvers != null) {
        Iterator iterator = targetResolvers.getChildrenWithName(new QName(TAG_TARGET_RESOLVER));
        while (iterator.hasNext()) {
            OMElement targetResolver = (OMElement) iterator.next();
            OMAttribute classNameAttribute =
                    targetResolver.getAttribute(new QName(TAG_CLASS_NAME));
            String className = classNameAttribute.getAttributeValue();
            try {
                Class classInstance = Loader.loadClass(className);
                TargetResolver tr = (TargetResolver) classInstance.newInstance();
                axisConfig.addTargetResolver(tr);
            } catch (Exception e) {
                if (log.isTraceEnabled()) {
                    log.trace(
                            "processTargetResolvers: Exception thrown initialising TargetResolver: " +
                                    e.getMessage());
                }
            }
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:23,代码来源:AxisConfigBuilder.java

示例11: processServiceModuleConfig

import org.apache.axiom.om.OMAttribute; //导入方法依赖的package包/类
protected void processServiceModuleConfig(Iterator moduleConfigs,
		ParameterInclude parent, AxisService service)
		throws DeploymentException {
	while (moduleConfigs.hasNext()) {
		OMElement moduleConfig = (OMElement) moduleConfigs.next();
		OMAttribute moduleName_att = moduleConfig.getAttribute(new QName(
				ATTRIBUTE_NAME));

		if (moduleName_att == null) {
			throw new DeploymentException(Messages
					.getMessage(DeploymentErrorMsgs.INVALID_MODULE_CONFIG));
		} else {
			String module = moduleName_att.getAttributeValue();
			ModuleConfiguration moduleConfiguration = new ModuleConfiguration(
					module, parent);
			Iterator parameters = moduleConfig
					.getChildrenWithName(new QName(TAG_PARAMETER));

			processParameters(parameters, moduleConfiguration, parent);
			service.addModuleConfig(moduleConfiguration);
		}
	}
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:24,代码来源:ServiceBuilder.java

示例12: processOperationModuleRefs

import org.apache.axiom.om.OMAttribute; //导入方法依赖的package包/类
/**
 * If the required module is not found this will return the error code 1: which is
 * "Error 1: Required module is not found"
 *
 * @param moduleRefs moduleRefs
 * @param operation  operation
 * @throws DeploymentException DeploymentException
 */
protected void processOperationModuleRefs(Iterator moduleRefs,
                                          AxisOperation operation) throws DeploymentException {
    while (moduleRefs.hasNext()) {
        OMElement moduleref = (OMElement) moduleRefs.next();
        OMAttribute moduleRefAttribute = moduleref
                .getAttribute(new QName(TAG_REFERENCE));

        if (moduleRefAttribute != null) {
            String refName = moduleRefAttribute.getAttributeValue();

            if (axisConfig.getModule(refName) == null) {
                throw new DeploymentException(MODULE_NOT_FOUND_ERROR + refName);
            } else {
                operation.addModule(refName);
            }
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:27,代码来源:OSGiServiceBuilder.java

示例13: readAuthenticationEndpointQueryParams

import org.apache.axiom.om.OMAttribute; //导入方法依赖的package包/类
private void readAuthenticationEndpointQueryParams(OMElement documentElement) {
    OMElement authEndpointQueryParamsElem = documentElement
            .getFirstChildWithName(IdentityApplicationManagementUtil
                                           .getQNameWithIdentityApplicationNS(FrameworkConstants.Config.QNAME_AUTH_ENDPOINT_QUERY_PARAMS));

    if (authEndpointQueryParamsElem != null) {

        authEndpointQueryParamsConfigAvailable = true;
        OMAttribute actionAttr = authEndpointQueryParamsElem.getAttribute(new QName(
                FrameworkConstants.Config.ATTR_AUTH_ENDPOINT_QUERY_PARAM_ACTION));
        authEndpointQueryParamsAction = FrameworkConstants.AUTH_ENDPOINT_QUERY_PARAMS_ACTION_EXCLUDE;

        if (actionAttr != null) {
            String actionValue = actionAttr.getAttributeValue();

            if (actionValue != null && !actionValue.isEmpty()) {
                authEndpointQueryParamsAction = actionValue;
            }
        }


        for (Iterator authEndpointQueryParamElems = authEndpointQueryParamsElem
                .getChildrenWithLocalName(FrameworkConstants.Config.ELEM_AUTH_ENDPOINT_QUERY_PARAM); authEndpointQueryParamElems
                     .hasNext(); ) {
            String queryParamName = processAuthEndpointQueryParamElem((OMElement) authEndpointQueryParamElems
                    .next());

            if (queryParamName != null) {
                this.authEndpointQueryParams.add(queryParamName);
            }
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:34,代码来源:FileBasedConfigurationBuilder.java

示例14: processAuthEndpointQueryParamElem

import org.apache.axiom.om.OMAttribute; //导入方法依赖的package包/类
private String processAuthEndpointQueryParamElem(OMElement authEndpointQueryParamElem) {

        OMAttribute nameAttr = authEndpointQueryParamElem.getAttribute(new QName(
                FrameworkConstants.Config.ATTR_AUTH_ENDPOINT_QUERY_PARAM_NAME));

        if (nameAttr == null) {
            log.warn("Each Authentication Endpoint Query Param should have a unique name attribute. This Query Param will skipped.");
            return null;
        }

        return nameAttr.getAttributeValue();
    }
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:13,代码来源:FileBasedConfigurationBuilder.java

示例15: load_xpath_values

import org.apache.axiom.om.OMAttribute; //导入方法依赖的package包/类
private void load_xpath_values(String[] paths, String[] values) throws Exception {
	XPathEvaluator eval = new XPathEvaluator();
	for (int i=0; i<paths.length; i++) {
		String path = paths[i];
		List node_list = eval.evaluateXpath(path, m.getRoot(), null);
		assertTrue(node_list.size() == 1);
		for (Iterator it=node_list.iterator(); it.hasNext(); ) {
			OMAttribute attr = (OMAttribute) it.next();
			values[i] = attr.getAttributeValue();
		}
	}
}
 
开发者ID:jembi,项目名称:openxds,代码行数:13,代码来源:RegistryAdaptorTest.java


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