本文整理汇总了Java中com.sun.tools.internal.ws.resources.WebserviceapMessages类的典型用法代码示例。如果您正苦于以下问题:Java WebserviceapMessages类的具体用法?Java WebserviceapMessages怎么用?Java WebserviceapMessages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WebserviceapMessages类属于com.sun.tools.internal.ws.resources包,在下文中一共展示了WebserviceapMessages类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: hasWebMethods
import com.sun.tools.internal.ws.resources.WebserviceapMessages; //导入依赖的package包/类
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());
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:WebServiceVisitor.java
示例2: shouldProcessMethod
import com.sun.tools.internal.ws.resources.WebserviceapMessages; //导入依赖的package包/类
protected boolean shouldProcessMethod(ExecutableElement method, WebMethod webMethod) {
builder.log("should process method: " + method.getSimpleName() + " hasWebMethods: " + hasWebMethods + " ");
/*
Fix for https://jax-ws.dev.java.net/issues/show_bug.cgi?id=577
if (hasWebMethods && webMethod == null) {
builder.log("webMethod == null");
return false;
}
*/
Collection<Modifier> modifiers = method.getModifiers();
boolean staticFinal = modifiers.contains(Modifier.STATIC) || modifiers.contains(Modifier.FINAL);
if (staticFinal) {
if (webMethod != null) {
builder.processError(WebserviceapMessages.WEBSERVICEAP_WEBSERVICE_METHOD_IS_STATIC_OR_FINAL(method.getEnclosingElement(),
method), method);
}
return false;
}
boolean result = (endpointReferencesInterface ||
method.getEnclosingElement().equals(typeElement) ||
(method.getEnclosingElement().getAnnotation(WebService.class) != null));
builder.log("endpointReferencesInterface: " + endpointReferencesInterface);
builder.log("declaring class has WebService: " + (method.getEnclosingElement().getAnnotation(WebService.class) != null));
builder.log("returning: " + result);
return result;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:WebServiceVisitor.java
示例3: classImplementsSei
import com.sun.tools.internal.ws.resources.WebserviceapMessages; //导入依赖的package包/类
protected boolean classImplementsSei(TypeElement classElement, TypeElement interfaceElement) {
for (TypeMirror interfaceType : classElement.getInterfaces()) {
if (((DeclaredType) interfaceType).asElement().equals(interfaceElement))
return true;
}
List<ExecutableElement> classMethods = getClassMethods(classElement);
boolean implementsMethod;
for (ExecutableElement interfaceMethod : ElementFilter.methodsIn(interfaceElement.getEnclosedElements())) {
implementsMethod = false;
for (ExecutableElement classMethod : classMethods) {
if (sameMethod(interfaceMethod, classMethod)) {
implementsMethod = true;
classMethods.remove(classMethod);
break;
}
}
if (!implementsMethod) {
builder.processError(WebserviceapMessages.WEBSERVICEAP_METHOD_NOT_IMPLEMENTED(interfaceElement.getSimpleName(), classElement.getSimpleName(), interfaceMethod), interfaceMethod);
return false;
}
}
return true;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:WebServiceVisitor.java
示例4: generateExceptionBeans
import com.sun.tools.internal.ws.resources.WebserviceapMessages; //导入依赖的package包/类
private boolean generateExceptionBeans(ExecutableElement method) {
String beanPackage = packageName + PD_JAXWS_PACKAGE_PD.getValue();
if (packageName.length() == 0)
beanPackage = JAXWS_PACKAGE_PD.getValue();
boolean beanGenerated = false;
for (TypeMirror thrownType : method.getThrownTypes()) {
TypeElement typeDecl = (TypeElement) ((DeclaredType) thrownType).asElement();
if (typeDecl == null) {
builder.processError(WebserviceapMessages.WEBSERVICEAP_COULD_NOT_FIND_TYPEDECL(
thrownType.toString(), context.getRound()));
return false;
}
boolean tmp = generateExceptionBean(typeDecl, beanPackage);
beanGenerated = beanGenerated || tmp;
}
return beanGenerated;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:WebServiceWrapperGenerator.java
示例5: getEndpointInterfaceElement
import com.sun.tools.internal.ws.resources.WebserviceapMessages; //导入依赖的package包/类
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;
}
开发者ID:campolake,项目名称:openjdk9,代码行数:19,代码来源:WebServiceVisitor.java
示例6: visitInterfaceDeclaration
import com.sun.tools.internal.ws.resources.WebserviceapMessages; //导入依赖的package包/类
public void visitInterfaceDeclaration(InterfaceDeclaration d) {
WebService webService = d.getAnnotation(WebService.class);
if (!shouldProcessWebService(webService, d))
return;
if (builder.checkAndSetProcessed(d))
return;
typeDecl = d;
if (endpointInterfaceName != null && !endpointInterfaceName.equals(d.getQualifiedName())) {
builder.onError(d.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_ENDPOINTINTERFACES_DO_NOT_MATCH(endpointInterfaceName, d.getQualifiedName()));
}
verifySEIAnnotations(webService, d);
endpointInterfaceName = d.getQualifiedName();
processingSEI = true;
preProcessWebService(webService, d);
processWebService(webService, d);
postProcessWebService(webService, d);
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:18,代码来源:WebServiceVisitor.java
示例7: hasWebMethods
import com.sun.tools.internal.ws.resources.WebserviceapMessages; //导入依赖的package包/类
protected boolean hasWebMethods(ClassDeclaration d) {
if (d.getQualifiedName().equals(JAVA_LANG_OBJECT))
return false;
WebMethod webMethod;
for (MethodDeclaration method : d.getMethods()) {
webMethod = method.getAnnotation(WebMethod.class);
if (webMethod != null) {
if (webMethod.exclude()) {
if (webMethod.operationName().length() > 0)
builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_INVALID_WEBMETHOD_ELEMENT_WITH_EXCLUDE("operationName", d.getQualifiedName(), method.toString()));
if (webMethod.action().length() > 0)
builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_INVALID_WEBMETHOD_ELEMENT_WITH_EXCLUDE("action", d.getQualifiedName(), method.toString()));
} else {
return true;
}
}
}
return false;//hasWebMethods(d.getSuperclass().getDeclaration());
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:20,代码来源:WebServiceVisitor.java
示例8: getEndpointInterfaceDecl
import com.sun.tools.internal.ws.resources.WebserviceapMessages; //导入依赖的package包/类
private InterfaceDeclaration getEndpointInterfaceDecl(String endpointInterfaceName,
ClassDeclaration d) {
InterfaceDeclaration intTypeDecl = null;
for (InterfaceType interfaceType : d.getSuperinterfaces()) {
if (endpointInterfaceName.equals(interfaceType.toString())) {
intTypeDecl = interfaceType.getDeclaration();
seiContext = context.getSEIContext(intTypeDecl.getQualifiedName());
assert(seiContext != null);
seiContext.setImplementsSEI(true);
break;
}
}
if (intTypeDecl == null) {
intTypeDecl = (InterfaceDeclaration)builder.getTypeDeclaration(endpointInterfaceName);
}
if (intTypeDecl == null)
builder.onError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTERFACE_CLASS_NOT_FOUND(endpointInterfaceName));
return intTypeDecl;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:20,代码来源:WebServiceVisitor.java
示例9: shouldProcessMethod
import com.sun.tools.internal.ws.resources.WebserviceapMessages; //导入依赖的package包/类
protected boolean shouldProcessMethod(MethodDeclaration method, WebMethod webMethod) {
builder.log("should process method: "+method.getSimpleName()+" hasWebMethods: "+ hasWebMethods+" ");
/*
Fix for https://jax-ws.dev.java.net/issues/show_bug.cgi?id=577
if (hasWebMethods && webMethod == null) {
builder.log("webMethod == null");
return false;
}
*/
Collection<Modifier> modifiers = method.getModifiers();
boolean staticFinal = modifiers.contains(Modifier.STATIC) || modifiers.contains(Modifier.FINAL);
if (staticFinal) {
if (webMethod != null) {
builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_WEBSERVICE_METHOD_IS_STATIC_OR_FINAL(method.getDeclaringType(), method));
}
return false;
}
boolean retval = (endpointReferencesInterface ||
method.getDeclaringType().equals(typeDecl) ||
(method.getDeclaringType().getAnnotation(WebService.class) != null));
builder.log("endpointReferencesInterface: "+endpointReferencesInterface);
builder.log("declaring class has WebSevice: "+(method.getDeclaringType().getAnnotation(WebService.class) != null));
builder.log("returning: "+retval);
return retval;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:26,代码来源:WebServiceVisitor.java
示例10: classImplementsSEI
import com.sun.tools.internal.ws.resources.WebserviceapMessages; //导入依赖的package包/类
protected boolean classImplementsSEI(ClassDeclaration classDecl,
InterfaceDeclaration intfDecl) {
for (InterfaceType interfaceType : classDecl.getSuperinterfaces()) {
if (interfaceType.getDeclaration().equals(intfDecl))
return true;
}
boolean implementsMethod;
for (MethodDeclaration method : intfDecl.getMethods()) {
implementsMethod = false;
for (MethodDeclaration classMethod : classDecl.getMethods()) {
if (sameMethod(method, classMethod)) {
implementsMethod = true;
break;
}
}
if (!implementsMethod) {
builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_METHOD_NOT_IMPLEMENTED(intfDecl.getSimpleName(), classDecl.getSimpleName(), method));
return false;
}
}
return true;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:23,代码来源:WebServiceVisitor.java
示例11: generateExceptionBeans
import com.sun.tools.internal.ws.resources.WebserviceapMessages; //导入依赖的package包/类
private boolean generateExceptionBeans(MethodDeclaration method) {
String beanPackage = packageName + PD_JAXWS_PACKAGE_PD;
if (packageName.length() == 0)
beanPackage = JAXWS_PACKAGE_PD;
boolean beanGenerated = false;
for (ReferenceType thrownType : method.getThrownTypes()) {
ClassDeclaration typeDecl = ((ClassType)thrownType).getDeclaration();
if (typeDecl == null){
builder.onError(WebserviceapMessages.WEBSERVICEAP_COULD_NOT_FIND_TYPEDECL(thrownType.toString(), context.getRound()));
return false;
}
boolean tmp = generateExceptionBean(typeDecl, beanPackage);
beanGenerated = beanGenerated || tmp;
}
return beanGenerated;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:17,代码来源:WebServiceWrapperGenerator.java
示例12: verifySeiAnnotations
import com.sun.tools.internal.ws.resources.WebserviceapMessages; //导入依赖的package包/类
protected void verifySeiAnnotations(WebService webService, TypeElement d) {
if (webService.endpointInterface().length() > 0) {
builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTERFACE_ON_INTERFACE(
d.getQualifiedName(), webService.endpointInterface()), d);
}
if (webService.serviceName().length() > 0) {
builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(
"serviceName", d.getQualifiedName()), d);
}
if (webService.portName().length() > 0) {
builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(
"portName", d.getQualifiedName()), d);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:WebServiceVisitor.java
示例13: checkForInvalidSeiAnnotation
import com.sun.tools.internal.ws.resources.WebserviceapMessages; //导入依赖的package包/类
protected void checkForInvalidSeiAnnotation(TypeElement element, Class annotationClass) {
Object annotation = element.getAnnotation(annotationClass);
if (annotation != null) {
builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SEI_ANNOTATION(
annotationClass.getName(), element.getQualifiedName()), element);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:WebServiceVisitor.java
示例14: preProcessWebService
import com.sun.tools.internal.ws.resources.WebserviceapMessages; //导入依赖的package包/类
protected void preProcessWebService(WebService webService, TypeElement element) {
processedMethods = new HashSet<String>();
seiContext = context.getSeiContext(element);
String targetNamespace = null;
if (webService != null)
targetNamespace = webService.targetNamespace();
PackageElement packageElement = builder.getProcessingEnvironment().getElementUtils().getPackageOf(element);
if (targetNamespace == null || targetNamespace.length() == 0) {
String packageName = packageElement.getQualifiedName().toString();
if (packageName == null || packageName.length() == 0) {
builder.processError(WebserviceapMessages.WEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(
element.getQualifiedName()), element);
}
targetNamespace = RuntimeModeler.getNamespace(packageName);
}
seiContext.setNamespaceUri(targetNamespace);
if (serviceImplName == null)
serviceImplName = seiContext.getSeiImplName();
if (serviceImplName != null) {
seiContext.setSeiImplName(serviceImplName);
context.addSeiContext(serviceImplName, seiContext);
}
portName = ClassNameInfo.getName(element.getSimpleName().toString().replace('$', '_'));
packageName = packageElement.getQualifiedName();
portName = webService != null && webService.name() != null && webService.name().length() > 0 ?
webService.name() : portName;
serviceName = ClassNameInfo.getName(element.getQualifiedName().toString()) + WebServiceConstants.SERVICE.getValue();
serviceName = webService != null && webService.serviceName() != null && webService.serviceName().length() > 0 ?
webService.serviceName() : serviceName;
wsdlNamespace = seiContext.getNamespaceUri();
typeNamespace = wsdlNamespace;
SOAPBinding soapBinding = element.getAnnotation(SOAPBinding.class);
if (soapBinding != null) {
pushedSoapBinding = pushSoapBinding(soapBinding, element, element);
} else if (element.equals(typeElement)) {
pushedSoapBinding = pushSoapBinding(new MySoapBinding(), element, element);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:40,代码来源:WebServiceVisitor.java
示例15: isLegalSei
import com.sun.tools.internal.ws.resources.WebserviceapMessages; //导入依赖的package包/类
protected boolean isLegalSei(TypeElement interfaceElement) {
for (VariableElement field : ElementFilter.fieldsIn(interfaceElement.getEnclosedElements()))
if (field.getConstantValue() != null) {
builder.processError(WebserviceapMessages.WEBSERVICEAP_SEI_CANNOT_CONTAIN_CONSTANT_VALUES(
interfaceElement.getQualifiedName(), field.getSimpleName()));
return false;
}
return methodsAreLegal(interfaceElement);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:WebServiceVisitor.java
示例16: isLegalParameter
import com.sun.tools.internal.ws.resources.WebserviceapMessages; //导入依赖的package包/类
protected boolean isLegalParameter(VariableElement param,
ExecutableElement method,
TypeElement typeElement,
int paramIndex) {
if (!isLegalType(param.asType())) {
builder.processError(WebserviceapMessages.WEBSERVICEAP_METHOD_PARAMETER_TYPES_CANNOT_IMPLEMENT_REMOTE(typeElement.getQualifiedName(),
method.getSimpleName(),
param.getSimpleName(),
param.asType().toString()), param);
return false;
}
TypeMirror holderType;
holderType = builder.getHolderValueType(param.asType());
WebParam webParam = param.getAnnotation(WebParam.class);
WebParam.Mode mode = null;
if (webParam != null)
mode = webParam.mode();
if (holderType != null) {
if (mode != null && mode == WebParam.Mode.IN)
builder.processError(WebserviceapMessages.WEBSERVICEAP_HOLDER_PARAMETERS_MUST_NOT_BE_IN_ONLY(typeElement.getQualifiedName(), method.toString(), paramIndex), param);
} else if (mode != null && mode != WebParam.Mode.IN) {
builder.processError(WebserviceapMessages.WEBSERVICEAP_NON_IN_PARAMETERS_MUST_BE_HOLDER(typeElement.getQualifiedName(), method.toString(), paramIndex), param);
}
return true;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:WebServiceVisitor.java
示例17: isValidOneWayMethod
import com.sun.tools.internal.ws.resources.WebserviceapMessages; //导入依赖的package包/类
protected boolean isValidOneWayMethod(ExecutableElement method, TypeElement typeElement) {
boolean valid = true;
if (!(method.getReturnType().accept(NO_TYPE_VISITOR, null))) {
// this is an error, cannot be OneWay and have a return type
builder.processError(WebserviceapMessages.WEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_RETURN_TYPE(typeElement.getQualifiedName(), method.toString()), method);
valid = false;
}
VariableElement outParam = getOutParameter(method);
if (outParam != null) {
builder.processError(WebserviceapMessages.WEBSERVICEAP_ONEWAY_AND_OUT(typeElement.getQualifiedName(), method.toString()), outParam);
valid = false;
}
if (!isDocLitWrapped() && soapStyle.equals(SOAPStyle.DOCUMENT)) {
int inCnt = getModeParameterCount(method, WebParam.Mode.IN);
if (inCnt != 1) {
builder.processError(WebserviceapMessages.WEBSERVICEAP_ONEWAY_AND_NOT_ONE_IN(typeElement.getQualifiedName(), method.toString()), method);
valid = false;
}
}
for (TypeMirror thrownType : method.getThrownTypes()) {
TypeElement thrownElement = (TypeElement) ((DeclaredType) thrownType).asElement();
if (builder.isServiceException(thrownType)) {
builder.processError(WebserviceapMessages.WEBSERVICEAP_ONEWAY_OPERATION_CANNOT_DECLARE_EXCEPTIONS(
typeElement.getQualifiedName(), method.toString(), thrownElement.getQualifiedName()), method);
valid = false;
}
}
return valid;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:WebServiceVisitor.java
注:本文中的com.sun.tools.internal.ws.resources.WebserviceapMessages类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论