public static int getRequiredParamInt(ParameterInclude paramInclude, String paramName) throws AxisFault { Integer value = getOptionalParamInt(paramInclude, paramName); if (value == null) { throw new AxisFault("Cannot find parameter '" + paramName + "' for " + getDescriptionFor(paramInclude)); } else { return value.intValue(); } }
public static int getRequiredParamInt(ParameterInclude paramInclude, String paramName) throws AxisFault { Integer value = getOptionalParamInt(paramInclude, paramName); if (value == null) { throw new AxisFault("Cannot find parameter '" + paramName + "' for " + getDescriptionFor(paramInclude)); } else { return value.intValue(); } }
public static Integer getOptionalParamInt(ParameterInclude paramInclude, String paramName) throws AxisFault { Parameter param = paramInclude.getParameter(paramName); if (param == null || param.getValue() == null) { return null; } else { Object paramValue = param.getValue(); if (paramValue instanceof Integer) { return (Integer)paramValue; } else if (paramValue instanceof String) { try { return Integer.valueOf((String)paramValue); } catch (NumberFormatException ex) { throw new AxisFault("Invalid value '" + paramValue + "' for parameter '" + paramName + "' for " + getDescriptionFor(paramInclude)); } } else { throw new AxisFault("Invalid type for parameter '" + paramName + "' for " + getDescriptionFor(paramInclude)); } } }
public static Integer getOptionalParamInt(ParameterInclude paramInclude, String paramName) throws AxisFault { Parameter param = paramInclude.getParameter(paramName); if (param == null || param.getValue() == null) { return null; } else { Object paramValue = param.getValue(); if (paramValue instanceof Integer) { return (Integer)paramValue; } else if (paramValue instanceof String) { try { return Integer.valueOf((String)paramValue); } catch (NumberFormatException ex) { throw new AxisFault("Invalid value '" + paramValue + "' for parameter '" + paramName + "' for " + getDescriptionFor(paramInclude)); } } else { throw new AxisFault("Invalid type for parameter '" + paramName + "' for " + getDescriptionFor(paramInclude)); } } }
public static String getRequiredParam(ParameterInclude paramInclude, String paramName) throws AxisFault { Parameter param = paramInclude.getParameter(paramName); if (param != null && param.getValue() != null && param.getValue() instanceof String) { return (String) param.getValue(); } else { throw new AxisFault("Cannot find parameter '" + paramName + "' for " + getDescriptionFor(paramInclude)); } }
public static String getRequiredParam(ParameterInclude paramInclude, String paramName) throws AxisFault { Parameter param = paramInclude.getParameter(paramName); if (param != null && param.getValue() != null && param.getValue() instanceof String) { return (String) param.getValue(); } else { throw new AxisFault("Cannot find parameter '" + paramName + "' for " + getDescriptionFor(paramInclude)); } }