public Boolean isWebMethod(final Method method) { if (method == null || method.getReturnType().equals(Future.class) || method.getReturnType().equals(Response.class) || method.isSynthetic()) { return Boolean.FALSE; } WebMethod wm = method.getAnnotation(WebMethod.class); Class<?> cls = method.getDeclaringClass(); if ((wm != null) && wm.exclude()) { return Boolean.FALSE; } if ((wm != null && !wm.exclude()) || (implInfo.getSEIClass() != null && cls.isInterface() && cls.isAssignableFrom(implInfo.getSEIClass()))) { return Boolean.TRUE; } if (method.getDeclaringClass().isInterface()) { return hasWebServiceAnnotation(method); } if (implInfo.getSEIClass() == null) { return hasWebServiceAnnotation(method) && !Modifier.isFinal(method.getModifiers()) && !Modifier.isStatic(method.getModifiers()); } return implInfo.getSEIClass().isAssignableFrom(method.getDeclaringClass()); }
@Override public Boolean isOperation(final Method method) { if (Object.class.equals(method.getDeclaringClass())) { return false; } if (method.getDeclaringClass() == implInfo.getSEIClass()) { WebMethod wm = method.getAnnotation(WebMethod.class); if (wm != null && wm.exclude()) { Message message = new Message("WEBMETHOD_EXCLUDE_NOT_ALLOWED", LOG, method.getName()); throw new JaxWsConfigurationException(message); } } Class<?> implClz = implInfo.getImplementorClass(); Method m = getDeclaredMethod(implClz, method); if (m != null) { WebMethod wm = m.getAnnotation(WebMethod.class); if (wm != null && wm.exclude()) { return Boolean.FALSE; } } if (isWebMethod(m)) { return true; } return isWebMethod(getDeclaredMethod(method)); }
java.lang.NoSuchMethodError: javax.jws.WebMethod.exclude()Z
private boolean isExcluced(Method method) { WebMethod webMethod = AnnotationUtil.getPrivMethodAnnotation(method, WebMethod.class); return webMethod != null && webMethod.exclude(); }
private boolean isExcluced(Method method) { WebMethod webMethod = AnnotationUtil.getPrivMethodAnnotation(method, WebMethod.class); return webMethod != null && webMethod.exclude(); }
/** * A quick check to see if a method is a web method. */ public boolean isWebMethod(ExecutableElement method) { boolean isWebMethod = method.getModifiers().contains(Modifier.PUBLIC); javax.jws.WebMethod annotation = method.getAnnotation(javax.jws.WebMethod.class); if (annotation != null) { isWebMethod &= !annotation.exclude(); } else if (this.aggressiveWebMethodExcludePolicy) { isWebMethod = false; } return isWebMethod; }
private boolean isWebMethod(Method method) { int modifiers = method.getModifiers(); if (Modifier.isStatic(modifiers) || Modifier.isFinal(modifiers)) return false; Class clazz = method.getDeclaringClass(); boolean declHasWebService = getAnnotation(clazz, WebService.class) != null; WebMethod webMethod = getAnnotation(method, WebMethod.class); if (webMethod != null && !webMethod.exclude() && declHasWebService) return true; return declHasWebService && !classUsesWebMethod.contains(clazz); }
private boolean isWebMethod(Method method) { int modifiers = method.getModifiers(); if (Modifier.isStatic(modifiers) || Modifier.isFinal(modifiers)) return false; Class clazz = method.getDeclaringClass(); boolean declHasWebService = getAnnotation(clazz, WebService.class) != null; WebMethod webMethod = getAnnotation(method, WebMethod.class); if (webMethod != null && !webMethod.exclude() && declHasWebService) return true; return declHasWebService && !classUsesWebMethod.contains(clazz); }
private boolean isWebMethod(Method method) { int modifiers = method.getModifiers(); if (Modifier.isStatic(modifiers) || Modifier.isFinal(modifiers)) return false; Class clazz = method.getDeclaringClass(); boolean declHasWebService = getAnnotation(clazz, WebService.class) != null; WebMethod webMethod = getAnnotation(method, WebMethod.class); if (webMethod != null && !webMethod.exclude() && declHasWebService) return true; return declHasWebService && !classUsesWebMethod.contains(clazz); }
/** * A quick check to see if a method is a web method. */ public boolean isWebMethod(MethodDeclaration method) { boolean isWebMethod = method.getModifiers().contains(Modifier.PUBLIC); javax.jws.WebMethod annotation = method.getAnnotation(javax.jws.WebMethod.class); if (annotation != null) { isWebMethod &= !annotation.exclude(); } return isWebMethod; }
public boolean getAnnoWebMethodExclude() { if (webMethodExclude == null) { // TODO: Validation: if this attribute specified, no other elements allowed per JSR-181 MR Sec 4.2, pg 17 // TODO: Validation: This element is not allowed on endpoint interfaces // Unlike the elements with a String value, if the annotation is present, exclude will always // return a usable value since it will default to FALSE if the element is not present. if (getAnnoWebMethod() != null) { webMethodExclude = Boolean.valueOf(getAnnoWebMethod().exclude()); } else { webMethodExclude = WebMethod_Exclude_DEFAULT; } } return webMethodExclude.booleanValue(); }
private boolean isOperationToGen(Method method, Class clazz) { if (clazz.isInterface()) { return true; } Class declareClass = method.getDeclaringClass(); WebMethod webMethod = AnnotationUtil.getPrivMethodAnnotation(method, WebMethod.class); if (webMethod != null && !webMethod.exclude()) { return true; } if (AnnotationUtil.getPrivClassAnnotation(declareClass, WebService.class) != null && !useWebMethodClasses.get(declareClass)) { return true; } return false; }
public boolean getAnnoWebMethodExclude() { if (webMethodExclude == null) { // TODO: Validation: if this attribute specified, no other elements allowed per JSR-181 MR Sec 4.2, pg 17 // TODO: Validation: This element is not allowed on endpoint interfaces // Unlike the elements with a String value, if the annotation is present, exclude will always // return a usable value since it will default to FALSE if the element is not present. if (getAnnoWebMethod() != null) { webMethodExclude = Boolean.valueOf(getAnnoWebMethod().exclude()); } else { webMethodExclude = WebMethod_Exclude_DEFAULT; } } return webMethodExclude.booleanValue(); }
void verifyWebMethod(final Method endpointInterfaceDefinedWebMethod) { final Method endpointImplementationMethod = findEndpointImplMethodMatching(endpointInterfaceDefinedWebMethod); if (endpointImplementationMethod != null) { final int methodModifiers = endpointImplementationMethod.getModifiers(); final WebMethod possibleWebMethodAnnotation = endpointImplementationMethod.getAnnotation(WebMethod.class); if (possibleWebMethodAnnotation == null || !possibleWebMethodAnnotation.exclude()) { if (Modifier.isPublic(methodModifiers)) { if (Modifier.isStatic(methodModifiers) || Modifier.isFinal(methodModifiers)) { verificationFailures.add(new WebMethodIsStaticOrFinal(endpointImplementationMethod)); } } else { verificationFailures.add(new WebMethodIsNotPublic(endpointImplementationMethod)); } } } }
void verifyWebMethod(final Method endpointInterfaceDefinedWebMethod) { final Method endpointImplementationMethod = findEndpointImplMethodMatching(endpointInterfaceDefinedWebMethod); if (endpointImplementationMethod != null) { final int methodModifiers = endpointImplementationMethod.getModifiers(); final WebMethod possibleWebMethodAnnotation = endpointImplementationMethod.getAnnotation(WebMethod.class); if (possibleWebMethodAnnotation == null || !possibleWebMethodAnnotation.exclude()) { if (Modifier.isPublic(methodModifiers)) { if (Modifier.isStatic(methodModifiers) || Modifier.isFinal(methodModifiers)) { verificationFailures.add(new WebMethodIsStaticOrFinal(endpointImplementationMethod)); } } else { verificationFailures.add(new WebMethodIsNotPublic(endpointImplementationMethod)); } } } }
/** * A quick check to see if a method is a web method. */ public boolean isWebMethod(MethodDeclaration method) { boolean isWebMethod = method.getModifiers().contains(Modifier.PUBLIC); javax.jws.WebMethod annotation = method.getAnnotation(javax.jws.WebMethod.class); if (annotation != null) { isWebMethod &= !annotation.exclude(); } else if (this.aggressiveWebMethodExcludePolicy) { isWebMethod = false; } return isWebMethod; }
protected AMFEndpointImpl(Object serviceBean) { this.serviceBean = serviceBean; this.operationNames2Methods.clear(); for (Method method : getServiceInterface().getMethods()) { String operationName = method.getName(); WebMethod webMethodInfo = method.getAnnotation(WebMethod.class); // If the annotation exclude the method, don't add it to the possible operations. if ((webMethodInfo != null) && (webMethodInfo.exclude())) { continue; } else if ((webMethodInfo != null) && (!"".equals(webMethodInfo.operationName()))) { operationName = webMethodInfo.operationName(); } this.operationNames2Methods.put(operationName, method); } }
private boolean isWebMethodBySpec(Method method, Class clazz) { int modifiers = method.getModifiers(); boolean staticFinal = Modifier.isStatic(modifiers) || Modifier.isFinal(modifiers); assert Modifier.isPublic(modifiers); assert !clazz.isInterface(); WebMethod webMethod = getAnnotation(method, WebMethod.class); if (webMethod != null) { if (webMethod.exclude()) { return false; // @WebMethod(exclude="true") } if (staticFinal) { throw new RuntimeModelerException(ModelerMessages.localizableRUNTIME_MODELER_WEBMETHOD_MUST_BE_NONSTATICFINAL(method)); } return true; // @WebMethod } if (staticFinal) { return false; } Class declClass = method.getDeclaringClass(); return getAnnotation(declClass, WebService.class) != null; }
protected boolean hasWebMethods(TypeElement element) { if (element.getQualifiedName().toString().equals(Object.class.getName())) return false; WebMethod webMethod; for (ExecutableElement method : ElementFilter.methodsIn(element.getEnclosedElements())) { webMethod = method.getAnnotation(WebMethod.class); if (webMethod != null) { if (webMethod.exclude()) { if (webMethod.operationName().length() > 0) builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_WEBMETHOD_ELEMENT_WITH_EXCLUDE( "operationName", element.getQualifiedName(), method.toString()), method); if (webMethod.action().length() > 0) builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_WEBMETHOD_ELEMENT_WITH_EXCLUDE( "action", element.getQualifiedName(), method.toString()), method); } else { return true; } } } return false;//hasWebMethods(d.getSuperclass().getDeclaration()); }
public WebMethodAnnotation getWebMethodAnnotation(Method method) { WebMethod webMethod = (WebMethod) method.getAnnotation(WebMethod.class); if (webMethod != null) { WebMethodAnnotation annotation = new WebMethodAnnotation(); annotation.setAction(webMethod.action()); annotation.setOperationName(webMethod.operationName()); annotation.setExclude(webMethod.exclude()); return annotation; } else { return null; } }