@Override public Boolean isOutParam(Method method, int j) { method = getDeclaredMethod(method); if (j == -1) { return !method.getReturnType().equals(void.class); } WebParam webParam = getWebParam(method, j); if (webParam != null && (webParam.mode().equals(Mode.OUT) || webParam.mode().equals(Mode.INOUT))) { return Boolean.TRUE; } return method.getParameterTypes()[j] == Holder.class; }
@Override public Boolean isInOutParam(Method method, int j) { method = getDeclaredMethod(method); if (j == -1) { return !method.getReturnType().equals(void.class); } WebParam webParam = getWebParam(method, j); if (webParam != null && webParam.mode().equals(Mode.INOUT)) { return Boolean.TRUE; } return Boolean.FALSE; }
countHeaders++; if (parm.mode() != WebParam.Mode.IN) { countOut++;
protected VariableElement getOutParameter(ExecutableElement method) { WebParam webParam; for (VariableElement param : method.getParameters()) { webParam = param.getAnnotation(WebParam.class); if (webParam != null && webParam.mode() != WebParam.Mode.IN) { return param; } } return null; }
protected VariableElement getOutParameter(ExecutableElement method) { WebParam webParam; for (VariableElement param : method.getParameters()) { webParam = param.getAnnotation(WebParam.class); if (webParam != null && webParam.mode() != WebParam.Mode.IN) { return param; } } return null; }
protected VariableElement getOutParameter(ExecutableElement method) { WebParam webParam; for (VariableElement param : method.getParameters()) { webParam = param.getAnnotation(WebParam.class); if (webParam != null && webParam.mode() != WebParam.Mode.IN) { return param; } } return null; }
protected VariableElement getOutParameter(ExecutableElement method) { WebParam webParam; for (VariableElement param : method.getParameters()) { webParam = param.getAnnotation(WebParam.class); if (webParam != null && webParam.mode() != WebParam.Mode.IN) { return param; } } return null; }
@Override public Boolean isOutParam(Method method, int j) { method = getDeclaredMethod(method); if (j == -1) { return !method.getReturnType().equals(void.class); } WebParam webParam = getWebParam(method, j); if (webParam != null && (webParam.mode().equals(Mode.OUT) || webParam.mode().equals(Mode.INOUT))) { return Boolean.TRUE; } return method.getParameterTypes()[j] == Holder.class; }
@Override public Boolean isInOutParam(Method method, int j) { method = getDeclaredMethod(method); if (j == -1) { return !method.getReturnType().equals(void.class); } WebParam webParam = getWebParam(method, j); if (webParam != null && webParam.mode().equals(Mode.INOUT)) { return Boolean.TRUE; } return Boolean.FALSE; }
protected int getModeParameterCount(ExecutableElement method, WebParam.Mode mode) { WebParam webParam; int cnt = 0; for (VariableElement param : method.getParameters()) { webParam = param.getAnnotation(WebParam.class); if (webParam != null) { if (webParam.header()) continue; if (isEquivalentModes(mode, webParam.mode())) cnt++; } else { if (isEquivalentModes(mode, WebParam.Mode.IN)) { cnt++; } } } return cnt; }
protected int getModeParameterCount(ExecutableElement method, WebParam.Mode mode) { WebParam webParam; int cnt = 0; for (VariableElement param : method.getParameters()) { webParam = param.getAnnotation(WebParam.class); if (webParam != null) { if (webParam.header()) continue; if (isEquivalentModes(mode, webParam.mode())) cnt++; } else { if (isEquivalentModes(mode, WebParam.Mode.IN)) { cnt++; } } } return cnt; }
protected int getModeParameterCount(ExecutableElement method, WebParam.Mode mode) { WebParam webParam; int cnt = 0; for (VariableElement param : method.getParameters()) { webParam = param.getAnnotation(WebParam.class); if (webParam != null) { if (webParam.header()) continue; if (isEquivalentModes(mode, webParam.mode())) cnt++; } else { if (isEquivalentModes(mode, WebParam.Mode.IN)) { cnt++; } } } return cnt; }
protected int getModeParameterCount(ExecutableElement method, WebParam.Mode mode) { WebParam webParam; int cnt = 0; for (VariableElement param : method.getParameters()) { webParam = param.getAnnotation(WebParam.class); if (webParam != null) { if (webParam.header()) continue; if (isEquivalentModes(mode, webParam.mode())) cnt++; } else { if (isEquivalentModes(mode, WebParam.Mode.IN)) { cnt++; } } } return cnt; }
public WebParam.Mode getAnnoWebParamMode() { if (webParamMode == null) { // Interesting conundrum here: // Because WebParam.mode has a default value, it will always return something if the // annotation is present. That value is currently Mode.IN. However, that default is only // correct for a non-Holder Type; the correct default for a Holder Type is Mode.INOUT. Furthermore, // there's no way (I can tell) to differentiate if the setting for mode() was specified or defaulted, // so there's no way to tell if the value is defaulted to IN or explicitly specified IN by the annotation. // The conundrum is: Do we return the value from the annotation, or do we return the default value based on the // type. For now, for a Holder type that has a value of IN, we reset the value to INOUT. // That means even if WebParam.mode=IN was explicitly set, it will be overridden to INOUT. // The default values are from JSR-181 MR Sec 4.4.1, pg 20 // Unlike a String value, if the annotation is present, it will return a usable default value as defined by // the Annotation. That is currently Mode.IN if (getAnnoWebParam() != null) { webParamMode = getAnnoWebParam().mode(); } else { webParamMode = WebParam.Mode.IN; } if (isHolderType() && webParamMode == WebParam.Mode.IN) { // Default per JSR-181 MR Sec 4.4.1, pg 20 webParamMode = WebParam.Mode.INOUT; } } return webParamMode; }
/** * This method will attach @WebParam annotation data to the <code> ParameterDescriptionComposite</code> * if the annotation was found on the parameter represented by this index in the parameter list. * * @param pdc - <code>ParameterDescriptionComposite</code> * @param order - the current index in the parameter list */ private void attachWebParamAnnotation(ParameterDescriptionComposite pdc, int order) { Annotation[] orderAnnots = paramAnnotations[order]; for (Annotation annot : orderAnnots) { if (annot instanceof WebParam) { WebParam webParam = (WebParam)annot; WebParamAnnot wpAnnot = WebParamAnnot.createWebParamAnnotImpl(); wpAnnot.setHeader(webParam.header()); wpAnnot.setMode(webParam.mode()); wpAnnot.setName(webParam.name()); wpAnnot.setPartName(webParam.partName()); wpAnnot.setTargetNamespace(webParam.targetNamespace()); pdc.setWebParamAnnot(wpAnnot); } } } }