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


Java Parameter.setLocked方法代码示例

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


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

示例1: testAddParameterServiceLockedAtAxisConfig

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public void testAddParameterServiceLockedAtAxisConfig() {
    try {
        Parameter para = new Parameter();
        para.setValue(null);
        para.setName("PARA_NAME");
        para.setLocked(true);
        reg.addParameter(para);

        AxisService service = new AxisService("Service1");
        reg.addService(service);
        service.addParameter(para);
        fail("This should fails with Parmter is locked can not overide");
    } catch (AxisFault axisFault) {

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

示例2: testAddParameterOperationlockedByAxisConfig

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public void testAddParameterOperationlockedByAxisConfig() {
    try {
        Parameter para = new Parameter();
        para.setValue(null);
        para.setName("PARA_NAME");
        para.setLocked(true);
        reg.addParameter(para);

        AxisService service = new AxisService("Service1");
        reg.addService(service);

        AxisOperation opertion = new InOutAxisOperation();
        opertion.setParent(service);
        opertion.addParameter(para);
        fail("This should fails with Parmter is locked can not overide");


    } catch (AxisFault axisFault) {

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

示例3: testAddParameterOperationLockebyService

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public void testAddParameterOperationLockebyService() {
    try {
        Parameter para = new Parameter();
        para.setValue(null);
        para.setName("PARA_NAME");
        para.setLocked(true);

        AxisService service = new AxisService("Service1");
        reg.addService(service);
        service.addParameter(para);

        AxisOperation opertion = new InOutAxisOperation();
        opertion.setParent(service);
        opertion.addParameter(para);
        fail("This should fails with Parmter is locked can not overide");
    } catch (AxisFault axisFault) {

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

示例4: testAddParameterModuleLockedAtAxisConfig

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public void testAddParameterModuleLockedAtAxisConfig() {
    try {
        Parameter para = new Parameter();
        para.setValue(null);
        para.setName("PARA_NAME");
        para.setLocked(true);
        reg.addParameter(para);
        AxisModule module = new AxisModule("Service1");
        module.setParent(reg);
        module.addParameter(para);
        fail("This should fails with Parmter is locked can not overide");
    } catch (AxisFault axisFault) {

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

示例5: processParameters

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
private void processParameters(Iterator parameters, ParameterInclude parameterInclude,
        ParameterInclude parent) throws DeploymentException {
    while (parameters.hasNext()) {
        // this is to check whether some one has locked the parmeter at the
        // top level
        OMElement parameterElement = (OMElement) parameters.next();
        Parameter parameter = new Parameter();
        // setting parameterElement
        parameter.setParameterElement(parameterElement);
        // setting parameter Name
        OMAttribute paramName = parameterElement.getAttribute(new QName(ATTRIBUTE_NAME));
        if (paramName == null) {
            throw new DeploymentException(Messages.getMessage(
                    DeploymentErrorMsgs.BAD_PARAMETER_ARGUMENT, parameterElement.toString()));
        }
        parameter.setName(paramName.getAttributeValue());
        // setting parameter Value (the child element of the parameter)
        OMElement paramValue = parameterElement.getFirstElement();
        if (paramValue != null) {
            parameter.setValue(parameterElement);
            parameter.setParameterType(Parameter.OM_PARAMETER);
        } else {
            String paratextValue = parameterElement.getText();

            parameter.setValue(paratextValue);
            parameter.setParameterType(Parameter.TEXT_PARAMETER);
        }
        // setting locking attribute
        OMAttribute paramLocked = parameterElement.getAttribute(new QName(ATTRIBUTE_LOCKED));
        Parameter parentParam = null;
        if (parent != null) {
            parentParam = parent.getParameter(parameter.getName());
        }
        if (paramLocked != null) {
            String lockedValue = paramLocked.getAttributeValue();
            if (BOOLEAN_TRUE.equals(lockedValue)) {
                // if the parameter is locked at some level parameter value
                // replace by that
                if ((parent != null) && parent.isParameterLocked(parameter.getName())) {
                    throw new DeploymentException(Messages.getMessage(
                            DeploymentErrorMsgs.CONFIG_NOT_FOUND, parameter.getName()));
                } else {
                    parameter.setLocked(true);
                }
            } else {
                parameter.setLocked(false);
            }
        }
        try {
            if (parent != null) {
                if ((parentParam == null) || !parent.isParameterLocked(parameter.getName())) {
                    parameterInclude.addParameter(parameter);
                }
            } else {
                parameterInclude.addParameter(parameter);
            }
        } catch (AxisFault axisFault) {
            throw new DeploymentException(axisFault);
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:62,代码来源:CorbaDeployer.java

示例6: processParameters

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
/**
 * Gets the Parameter object from the OM.
 *
 * @param parameters       <code>Parameter</code>
 * @param parameterInclude <code>ParameterInclude</code>
 * @param parent           <code>ParameterInclude</code>
 */
protected void processParameters(Iterator parameters,
                                 ParameterInclude parameterInclude,
                                 ParameterInclude parent)
        throws DeploymentException {
    while (parameters.hasNext()) {
        // this is to check whether some one has locked the parmeter at the
        // top level
        OMElement parameterElement = (OMElement) parameters.next();
        Parameter parameter = new Parameter();
        // setting parameterElement
        parameter.setParameterElement(parameterElement);
        // setting parameter Name
        OMAttribute paramName = parameterElement.getAttribute(new QName(ATTRIBUTE_NAME));
        if (paramName == null) {
            throw new DeploymentException(Messages.getMessage(
                    DeploymentErrorMsgs.BAD_PARAMETER_ARGUMENT,
                    parameterElement.toString()));
        }
        parameter.setName(paramName.getAttributeValue());
        // setting parameter Value (the child element of the parameter)
        OMElement paramValue = parameterElement.getFirstElement();
        if (paramValue != null) {
            parameter.setValue(parameterElement);
            parameter.setParameterType(Parameter.OM_PARAMETER);
        } else {
            String paratextValue = parameterElement.getText();

            parameter.setValue(paratextValue);
            parameter.setParameterType(Parameter.TEXT_PARAMETER);
        }
        // setting locking attribute
        OMAttribute paramLocked = parameterElement.getAttribute(new QName(
                ATTRIBUTE_LOCKED));
        Parameter parentParam = null;
        if (parent != null) {
            parentParam = parent.getParameter(parameter.getName());
        }
        if (paramLocked != null) {
            String lockedValue = paramLocked.getAttributeValue();
            if (BOOLEAN_TRUE.equals(lockedValue)) {
                // if the parameter is locked at some level parameter value
                // replace by that
                if ((parent != null)
                        && parent.isParameterLocked(parameter.getName())) {
                    throw new DeploymentException(Messages.getMessage(
                            DeploymentErrorMsgs.PARAMETER_LOCKED, parameter.getName()));
                } else {
                    parameter.setLocked(true);
                }
            } else {
                parameter.setLocked(false);
            }
        }
        try {
            if (parent != null) {
                if ((parentParam == null)
                        || !parent.isParameterLocked(parameter.getName())) {
                    parameterInclude.addParameter(parameter);
                }
            } else {
                parameterInclude.addParameter(parameter);
            }
        } catch (AxisFault axisFault) {
            throw new DeploymentException(axisFault);
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:75,代码来源:DescriptionBuilder.java


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