protected boolean isLegalType(TypeMirror type) { if (!(type != null && type.getKind().equals(TypeKind.DECLARED))) return true; TypeElement tE = (TypeElement) ((DeclaredType) type).asElement(); if (tE == null) { // can be null, if this type's declaration is unknown. This may be the result of a processing error, such as a missing class file. builder.processError(WebserviceapMessages.WEBSERVICEAP_COULD_NOT_FIND_TYPEDECL(type.toString(), context.getRound())); } return !builder.isRemote(tE); }
protected void checkForInvalidImplAnnotation(Element element, Class annotationClass) { Object annotation = element.getAnnotation(annotationClass); if (annotation != null) { builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ANNOTATION(annotationClass.getName()), element); } }
private TypeElement getEndpointInterfaceElement(String endpointInterfaceName, TypeElement element) { TypeElement intTypeElement = null; for (TypeMirror interfaceType : element.getInterfaces()) { if (endpointInterfaceName.equals(interfaceType.toString())) { intTypeElement = (TypeElement) ((DeclaredType) interfaceType).asElement(); seiContext = context.getSeiContext(intTypeElement.getQualifiedName()); assert (seiContext != null); seiContext.setImplementsSei(true); break; } } if (intTypeElement == null) { intTypeElement = builder.getProcessingEnvironment().getElementUtils().getTypeElement(endpointInterfaceName); } if (intTypeElement == null) builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTERFACE_CLASS_NOT_FOUND(endpointInterfaceName)); return intTypeElement; }
builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT_EXCLUDE("exclude=true", typeElement.getQualifiedName(), method.toString()), method); builder.processError(WebserviceapMessages.WEBSERVICEAP_METHOD_RETURN_TYPE_CANNOT_IMPLEMENT_REMOTE(typeElement.getQualifiedName(), method.getSimpleName(), returnType), method); if (soapBinding != null) { if (soapBinding.style().equals(SOAPBinding.Style.RPC)) { builder.processError(WebserviceapMessages.WEBSERVICEAP_RPC_SOAPBINDING_NOT_ALLOWED_ON_METHOD(typeElement.getQualifiedName(), method.toString()), method); int outParams = getModeParameterCount(method, WebParam.Mode.OUT); if (inParams != 1) { builder.processError(WebserviceapMessages.WEBSERVICEAP_DOC_BARE_AND_NO_ONE_IN(typeElement.getQualifiedName(), method.toString()), method); builder.processError(WebserviceapMessages.WEBSERVICEAP_DOC_BARE_NO_OUT(typeElement.getQualifiedName(), method.toString()), method); builder.processError(WebserviceapMessages.WEBSERVICEAP_DOC_BARE_NO_RETURN_AND_NO_OUT(typeElement.getQualifiedName(), method.toString()), method); builder.processError(WebserviceapMessages.WEBSERVICEAP_DOC_BARE_RETURN_AND_OUT(typeElement.getQualifiedName(), method.toString()), outParam);
hasWebMethods = false; if (webService == null) builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTERFACE_HAS_NO_WEBSERVICE_ANNOTATION( element.getQualifiedName()), element); && soapBinding.style() == SOAPBinding.Style.RPC && soapBinding.parameterStyle() == SOAPBinding.ParameterStyle.BARE) { builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SOAPBINDING_PARAMETERSTYLE( soapBinding, element), element); return false; && soapBinding.style() == SOAPBinding.Style.RPC && soapBinding.parameterStyle() == SOAPBinding.ParameterStyle.BARE) { builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SOAPBINDING_PARAMETERSTYLE( soapBinding, element), element); return false;
case INTERFACE: { if (endpointInterfaceName != null && !endpointInterfaceName.equals(e.getQualifiedName())) { builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTERFACES_DO_NOT_MATCH(endpointInterfaceName, e.getQualifiedName()), e); checkForInvalidImplAnnotation(e, SOAPBinding.class); if (webService.name().length() > 0) builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ELEMENT("name"), e); endpointReferencesInterface = true; verifyImplAnnotations(e);
builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT_EXCLUDE("exclude=true", typeElement.getQualifiedName(), method.toString()), method); builder.processError(WebserviceapMessages.WEBSERVICEAP_METHOD_RETURN_TYPE_CANNOT_IMPLEMENT_REMOTE(typeElement.getQualifiedName(), method.getSimpleName(), returnType), method); if (soapBinding != null) { if (soapBinding.style().equals(SOAPBinding.Style.RPC)) { builder.processError(WebserviceapMessages.WEBSERVICEAP_RPC_SOAPBINDING_NOT_ALLOWED_ON_METHOD(typeElement.getQualifiedName(), method.toString()), method); int outParams = getModeParameterCount(method, WebParam.Mode.OUT); if (inParams != 1) { builder.processError(WebserviceapMessages.WEBSERVICEAP_DOC_BARE_AND_NO_ONE_IN(typeElement.getQualifiedName(), method.toString()), method); builder.processError(WebserviceapMessages.WEBSERVICEAP_DOC_BARE_NO_OUT(typeElement.getQualifiedName(), method.toString()), method); builder.processError(WebserviceapMessages.WEBSERVICEAP_DOC_BARE_NO_RETURN_AND_NO_OUT(typeElement.getQualifiedName(), method.toString()), method); builder.processError(WebserviceapMessages.WEBSERVICEAP_DOC_BARE_RETURN_AND_OUT(typeElement.getQualifiedName(), method.toString()), outParam);
hasWebMethods = false; if (webService == null) builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTERFACE_HAS_NO_WEBSERVICE_ANNOTATION( element.getQualifiedName()), element); && soapBinding.style() == SOAPBinding.Style.RPC && soapBinding.parameterStyle() == SOAPBinding.ParameterStyle.BARE) { builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SOAPBINDING_PARAMETERSTYLE( soapBinding, element), element); return false; && soapBinding.style() == SOAPBinding.Style.RPC && soapBinding.parameterStyle() == SOAPBinding.ParameterStyle.BARE) { builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SOAPBINDING_PARAMETERSTYLE( soapBinding, element), element); return false;
case INTERFACE: { if (endpointInterfaceName != null && !endpointInterfaceName.equals(e.getQualifiedName())) { builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTERFACES_DO_NOT_MATCH(endpointInterfaceName, e.getQualifiedName()), e); checkForInvalidImplAnnotation(e, SOAPBinding.class); if (webService.name().length() > 0) builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ELEMENT("name"), e); endpointReferencesInterface = true; verifyImplAnnotations(e);
builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT_EXCLUDE("exclude=true", typeElement.getQualifiedName(), method.toString()), method); builder.processError(WebserviceapMessages.WEBSERVICEAP_METHOD_RETURN_TYPE_CANNOT_IMPLEMENT_REMOTE(typeElement.getQualifiedName(), method.getSimpleName(), returnType), method); if (soapBinding != null) { if (soapBinding.style().equals(SOAPBinding.Style.RPC)) { builder.processError(WebserviceapMessages.WEBSERVICEAP_RPC_SOAPBINDING_NOT_ALLOWED_ON_METHOD(typeElement.getQualifiedName(), method.toString()), method); int outParams = getModeParameterCount(method, WebParam.Mode.OUT); if (inParams != 1) { builder.processError(WebserviceapMessages.WEBSERVICEAP_DOC_BARE_AND_NO_ONE_IN(typeElement.getQualifiedName(), method.toString()), method); builder.processError(WebserviceapMessages.WEBSERVICEAP_DOC_BARE_NO_OUT(typeElement.getQualifiedName(), method.toString()), method); builder.processError(WebserviceapMessages.WEBSERVICEAP_DOC_BARE_NO_RETURN_AND_NO_OUT(typeElement.getQualifiedName(), method.toString()), method); builder.processError(WebserviceapMessages.WEBSERVICEAP_DOC_BARE_RETURN_AND_OUT(typeElement.getQualifiedName(), method.toString()), outParam);
hasWebMethods = false; if (webService == null) builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTERFACE_HAS_NO_WEBSERVICE_ANNOTATION( element.getQualifiedName()), element); && soapBinding.style() == SOAPBinding.Style.RPC && soapBinding.parameterStyle() == SOAPBinding.ParameterStyle.BARE) { builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SOAPBINDING_PARAMETERSTYLE( soapBinding, element), element); return false; && soapBinding.style() == SOAPBinding.Style.RPC && soapBinding.parameterStyle() == SOAPBinding.ParameterStyle.BARE) { builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SOAPBINDING_PARAMETERSTYLE( soapBinding, element), element); return false;
case INTERFACE: { if (endpointInterfaceName != null && !endpointInterfaceName.equals(e.getQualifiedName())) { builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTERFACES_DO_NOT_MATCH(endpointInterfaceName, e.getQualifiedName()), e); checkForInvalidImplAnnotation(e, SOAPBinding.class); if (webService.name().length() > 0) builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ELEMENT("name"), e); endpointReferencesInterface = true; verifyImplAnnotations(e);
protected boolean isLegalType(TypeMirror type) { if (!(type != null && type.getKind().equals(TypeKind.DECLARED))) return true; TypeElement tE = (TypeElement) ((DeclaredType) type).asElement(); if (tE == null) { // can be null, if this type's declaration is unknown. This may be the result of a processing error, such as a missing class file. builder.processError(WebserviceapMessages.WEBSERVICEAP_COULD_NOT_FIND_TYPEDECL(type.toString(), context.getRound())); } return !builder.isRemote(tE); }
protected void checkForInvalidImplAnnotation(Element element, Class annotationClass) { Object annotation = element.getAnnotation(annotationClass); if (annotation != null) { builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ANNOTATION(annotationClass.getName()), element); } }
private TypeElement getEndpointInterfaceElement(String endpointInterfaceName, TypeElement element) { TypeElement intTypeElement = null; for (TypeMirror interfaceType : element.getInterfaces()) { if (endpointInterfaceName.equals(interfaceType.toString())) { intTypeElement = (TypeElement) ((DeclaredType) interfaceType).asElement(); seiContext = context.getSeiContext(intTypeElement.getQualifiedName()); assert (seiContext != null); seiContext.setImplementsSei(true); break; } } if (intTypeElement == null) { intTypeElement = builder.getProcessingEnvironment().getElementUtils().getTypeElement(endpointInterfaceName); } if (intTypeElement == null) builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTERFACE_CLASS_NOT_FOUND(endpointInterfaceName)); return intTypeElement; }
builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT_EXCLUDE("exclude=true", typeElement.getQualifiedName(), method.toString()), method); builder.processError(WebserviceapMessages.WEBSERVICEAP_METHOD_RETURN_TYPE_CANNOT_IMPLEMENT_REMOTE(typeElement.getQualifiedName(), method.getSimpleName(), returnType), method); if (soapBinding != null) { if (soapBinding.style().equals(SOAPBinding.Style.RPC)) { builder.processError(WebserviceapMessages.WEBSERVICEAP_RPC_SOAPBINDING_NOT_ALLOWED_ON_METHOD(typeElement.getQualifiedName(), method.toString()), method); int outParams = getModeParameterCount(method, WebParam.Mode.OUT); if (inParams != 1) { builder.processError(WebserviceapMessages.WEBSERVICEAP_DOC_BARE_AND_NO_ONE_IN(typeElement.getQualifiedName(), method.toString()), method); builder.processError(WebserviceapMessages.WEBSERVICEAP_DOC_BARE_NO_OUT(typeElement.getQualifiedName(), method.toString()), method); builder.processError(WebserviceapMessages.WEBSERVICEAP_DOC_BARE_NO_RETURN_AND_NO_OUT(typeElement.getQualifiedName(), method.toString()), method); builder.processError(WebserviceapMessages.WEBSERVICEAP_DOC_BARE_RETURN_AND_OUT(typeElement.getQualifiedName(), method.toString()), outParam);
hasWebMethods = false; if (webService == null) builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTERFACE_HAS_NO_WEBSERVICE_ANNOTATION( element.getQualifiedName()), element); && soapBinding.style() == SOAPBinding.Style.RPC && soapBinding.parameterStyle() == SOAPBinding.ParameterStyle.BARE) { builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SOAPBINDING_PARAMETERSTYLE( soapBinding, element), element); return false; && soapBinding.style() == SOAPBinding.Style.RPC && soapBinding.parameterStyle() == SOAPBinding.ParameterStyle.BARE) { builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SOAPBINDING_PARAMETERSTYLE( soapBinding, element), element); return false;
case INTERFACE: { if (endpointInterfaceName != null && !endpointInterfaceName.equals(e.getQualifiedName())) { builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTERFACES_DO_NOT_MATCH(endpointInterfaceName, e.getQualifiedName()), e); checkForInvalidImplAnnotation(e, SOAPBinding.class); if (webService.name().length() > 0) builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ELEMENT("name"), e); endpointReferencesInterface = true; verifyImplAnnotations(e);
protected boolean isLegalType(TypeMirror type) { if (!(type != null && type.getKind().equals(TypeKind.DECLARED))) return true; TypeElement tE = (TypeElement) ((DeclaredType) type).asElement(); if (tE == null) { // can be null, if this type's declaration is unknown. This may be the result of a processing error, such as a missing class file. builder.processError(WebserviceapMessages.WEBSERVICEAP_COULD_NOT_FIND_TYPEDECL(type.toString(), context.getRound())); } return !builder.isRemote(tE); }
protected void checkForInvalidImplAnnotation(Element element, Class annotationClass) { Object annotation = element.getAnnotation(annotationClass); if (annotation != null) { builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ANNOTATION(annotationClass.getName()), element); } }