com.sun.tools.internal.ws.ToolVersion Java Examples
The following examples show how to use
com.sun.tools.internal.ws.ToolVersion.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GeneratorBase.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public static List<String> getJAXWSClassComment(String targetVersion) { List<String> comments = new ArrayList<String>(); comments.add("This class was generated by the JAX-WS RI.\n"); comments.add(ToolVersion.VERSION.BUILD_VERSION+"\n"); comments.add("Generated source version: " + targetVersion); return comments; }
Example #2
Source File: GeneratorBase.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public static List<String> getJAXWSClassComment(String targetVersion) { List<String> comments = new ArrayList<String>(); comments.add("This class was generated by the JAX-WS RI.\n"); comments.add(ToolVersion.VERSION.BUILD_VERSION+"\n"); comments.add("Generated source version: " + targetVersion); return comments; }
Example #3
Source File: GeneratorBase.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public static List<String> getJAXWSClassComment(String targetVersion) { List<String> comments = new ArrayList<String>(); comments.add("This class was generated by the JAX-WS RI.\n"); comments.add(ToolVersion.VERSION.BUILD_VERSION+"\n"); comments.add("Generated source version: " + targetVersion); return comments; }
Example #4
Source File: GeneratorBase.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public static List<String> getJAXWSClassComment(String targetVersion) { List<String> comments = new ArrayList<String>(); comments.add("This class was generated by the JAX-WS RI.\n"); comments.add(ToolVersion.VERSION.BUILD_VERSION+"\n"); comments.add("Generated source version: " + targetVersion); return comments; }
Example #5
Source File: GeneratorBase.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public static List<String> getJAXWSClassComment(String targetVersion) { List<String> comments = new ArrayList<String>(); comments.add("This class was generated by the JAX-WS RI.\n"); comments.add(ToolVersion.VERSION.BUILD_VERSION+"\n"); comments.add("Generated source version: " + targetVersion); return comments; }
Example #6
Source File: GeneratorBase.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public static List<String> getJAXWSClassComment(String targetVersion) { List<String> comments = new ArrayList<String>(); comments.add("This class was generated by the JAX-WS RI.\n"); comments.add(ToolVersion.VERSION.BUILD_VERSION+"\n"); comments.add("Generated source version: " + targetVersion); return comments; }
Example #7
Source File: GeneratorBase.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public static List<String> getJAXWSClassComment(String targetVersion) { List<String> comments = new ArrayList<String>(); comments.add("This class was generated by the JAX-WS RI.\n"); comments.add(ToolVersion.VERSION.BUILD_VERSION+"\n"); comments.add("Generated source version: " + targetVersion); return comments; }
Example #8
Source File: GeneratorBase.java From hottub with GNU General Public License v2.0 | 5 votes |
public static List<String> getJAXWSClassComment(String targetVersion) { List<String> comments = new ArrayList<String>(); comments.add("This class was generated by the JAX-WS RI.\n"); comments.add(ToolVersion.VERSION.BUILD_VERSION+"\n"); comments.add("Generated source version: " + targetVersion); return comments; }
Example #9
Source File: PluginImpl.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
private void annotate(JAnnotatable m) { m.annotate(annotation) .param("value", WsimportTool.class.getName()) .param("date", getISO8601Date()) .param("comments", ToolVersion.VERSION.BUILD_VERSION); }
Example #10
Source File: WebServiceWrapperGenerator.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
private boolean generateExceptionBean(TypeElement thrownDecl, String beanPackage) { if (!builder.isServiceException(thrownDecl.asType())) return false; String exceptionName = ClassNameInfo.getName(thrownDecl.getQualifiedName().toString()); if (processedExceptions.contains(exceptionName)) return false; processedExceptions.add(exceptionName); WebFault webFault = thrownDecl.getAnnotation(WebFault.class); String className = beanPackage+ exceptionName + BEAN.getValue(); Collection<MemberInfo> members = ap_generator.collectExceptionBeanMembers(thrownDecl); boolean isWSDLException = isWSDLException(members, thrownDecl); String namespace = typeNamespace; String name = exceptionName; FaultInfo faultInfo; if (isWSDLException) { TypeMirror beanType = getFaultInfoMember(members).getParamType(); faultInfo = new FaultInfo(TypeMonikerFactory.getTypeMoniker(beanType), true); namespace = webFault.targetNamespace().length()>0 ? webFault.targetNamespace() : namespace; name = webFault.name().length()>0 ? webFault.name() : name; faultInfo.setElementName(new QName(namespace, name)); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return false; } if (webFault != null) { namespace = webFault.targetNamespace().length()>0 ? webFault.targetNamespace() : namespace; name = webFault.name().length()>0 ? webFault.name() : name; className = webFault.faultBean().length()>0 ? webFault.faultBean() : className; } JDefinedClass cls = getCMClass(className, CLASS); faultInfo = new FaultInfo(className, false); if (duplicateName(className)) { builder.processError(WebserviceapMessages.WEBSERVICEAP_METHOD_EXCEPTION_BEAN_NAME_NOT_UNIQUE( typeElement.getQualifiedName(), thrownDecl.getQualifiedName())); } boolean canOverWriteBean = builder.canOverWriteClass(className); if (!canOverWriteBean) { builder.log("Class " + className + " exists. Not overwriting."); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return false; } if (seiContext.getExceptionBeanName(thrownDecl.getQualifiedName()) != null) return false; //write class comment - JAXWS warning JDocComment comment = cls.javadoc(); for (String doc : GeneratorBase.getJAXWSClassComment(ToolVersion.VERSION.MAJOR_VERSION)) { comment.add(doc); } // XmlElement Declarations writeXmlElementDeclaration(cls, name, namespace); // XmlType Declaration //members = sortMembers(members); XmlType xmlType = thrownDecl.getAnnotation(XmlType.class); String xmlTypeName = (xmlType != null && !xmlType.name().equals("##default")) ? xmlType.name() : exceptionName; String xmlTypeNamespace = (xmlType != null && !xmlType.namespace().equals("##default")) ? xmlType.namespace() : typeNamespace; writeXmlTypeDeclaration(cls, xmlTypeName, xmlTypeNamespace, members); writeMembers(cls, members); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return true; }
Example #11
Source File: PluginImpl.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
private void annotate(JAnnotatable m) { m.annotate(annotation) .param("value", WsimportTool.class.getName()) .param("date", getISO8601Date()) .param("comments", ToolVersion.VERSION.BUILD_VERSION); }
Example #12
Source File: WebServiceWrapperGenerator.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
private boolean generateExceptionBean(TypeElement thrownDecl, String beanPackage) { if (!builder.isServiceException(thrownDecl.asType())) return false; String exceptionName = ClassNameInfo.getName(thrownDecl.getQualifiedName().toString()); if (processedExceptions.contains(exceptionName)) return false; processedExceptions.add(exceptionName); WebFault webFault = thrownDecl.getAnnotation(WebFault.class); String className = beanPackage+ exceptionName + BEAN.getValue(); Collection<MemberInfo> members = ap_generator.collectExceptionBeanMembers(thrownDecl); boolean isWSDLException = isWSDLException(members, thrownDecl); String namespace = typeNamespace; String name = exceptionName; FaultInfo faultInfo; if (isWSDLException) { TypeMirror beanType = getFaultInfoMember(members).getParamType(); faultInfo = new FaultInfo(TypeMonikerFactory.getTypeMoniker(beanType), true); namespace = webFault.targetNamespace().length()>0 ? webFault.targetNamespace() : namespace; name = webFault.name().length()>0 ? webFault.name() : name; faultInfo.setElementName(new QName(namespace, name)); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return false; } if (webFault != null) { namespace = webFault.targetNamespace().length()>0 ? webFault.targetNamespace() : namespace; name = webFault.name().length()>0 ? webFault.name() : name; className = webFault.faultBean().length()>0 ? webFault.faultBean() : className; } JDefinedClass cls = getCMClass(className, CLASS); faultInfo = new FaultInfo(className, false); if (duplicateName(className)) { builder.processError(WebserviceapMessages.WEBSERVICEAP_METHOD_EXCEPTION_BEAN_NAME_NOT_UNIQUE( typeElement.getQualifiedName(), thrownDecl.getQualifiedName())); } boolean canOverWriteBean = builder.canOverWriteClass(className); if (!canOverWriteBean) { builder.log("Class " + className + " exists. Not overwriting."); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return false; } if (seiContext.getExceptionBeanName(thrownDecl.getQualifiedName()) != null) return false; //write class comment - JAXWS warning JDocComment comment = cls.javadoc(); for (String doc : GeneratorBase.getJAXWSClassComment(ToolVersion.VERSION.MAJOR_VERSION)) { comment.add(doc); } // XmlElement Declarations writeXmlElementDeclaration(cls, name, namespace); // XmlType Declaration //members = sortMembers(members); XmlType xmlType = thrownDecl.getAnnotation(XmlType.class); String xmlTypeName = (xmlType != null && !xmlType.name().equals("##default")) ? xmlType.name() : exceptionName; String xmlTypeNamespace = (xmlType != null && !xmlType.namespace().equals("##default")) ? xmlType.namespace() : typeNamespace; writeXmlTypeDeclaration(cls, xmlTypeName, xmlTypeNamespace, members); writeMembers(cls, members); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return true; }
Example #13
Source File: PluginImpl.java From hottub with GNU General Public License v2.0 | 4 votes |
private void annotate(JAnnotatable m) { m.annotate(annotation) .param("value", WsimportTool.class.getName()) .param("date", getISO8601Date()) .param("comments", ToolVersion.VERSION.BUILD_VERSION); }
Example #14
Source File: WebServiceWrapperGenerator.java From hottub with GNU General Public License v2.0 | 4 votes |
private boolean generateExceptionBean(TypeElement thrownDecl, String beanPackage) { if (!builder.isServiceException(thrownDecl.asType())) return false; String exceptionName = ClassNameInfo.getName(thrownDecl.getQualifiedName().toString()); if (processedExceptions.contains(exceptionName)) return false; processedExceptions.add(exceptionName); WebFault webFault = thrownDecl.getAnnotation(WebFault.class); String className = beanPackage+ exceptionName + BEAN.getValue(); Collection<MemberInfo> members = ap_generator.collectExceptionBeanMembers(thrownDecl); boolean isWSDLException = isWSDLException(members, thrownDecl); String namespace = typeNamespace; String name = exceptionName; FaultInfo faultInfo; if (isWSDLException) { TypeMirror beanType = getFaultInfoMember(members).getParamType(); faultInfo = new FaultInfo(TypeMonikerFactory.getTypeMoniker(beanType), true); namespace = webFault.targetNamespace().length()>0 ? webFault.targetNamespace() : namespace; name = webFault.name().length()>0 ? webFault.name() : name; faultInfo.setElementName(new QName(namespace, name)); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return false; } if (webFault != null) { namespace = webFault.targetNamespace().length()>0 ? webFault.targetNamespace() : namespace; name = webFault.name().length()>0 ? webFault.name() : name; className = webFault.faultBean().length()>0 ? webFault.faultBean() : className; } JDefinedClass cls = getCMClass(className, CLASS); faultInfo = new FaultInfo(className, false); if (duplicateName(className)) { builder.processError(WebserviceapMessages.WEBSERVICEAP_METHOD_EXCEPTION_BEAN_NAME_NOT_UNIQUE( typeElement.getQualifiedName(), thrownDecl.getQualifiedName())); } boolean canOverWriteBean = builder.canOverWriteClass(className); if (!canOverWriteBean) { builder.log("Class " + className + " exists. Not overwriting."); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return false; } if (seiContext.getExceptionBeanName(thrownDecl.getQualifiedName()) != null) return false; //write class comment - JAXWS warning JDocComment comment = cls.javadoc(); for (String doc : GeneratorBase.getJAXWSClassComment(ToolVersion.VERSION.MAJOR_VERSION)) { comment.add(doc); } // XmlElement Declarations writeXmlElementDeclaration(cls, name, namespace); // XmlType Declaration //members = sortMembers(members); XmlType xmlType = thrownDecl.getAnnotation(XmlType.class); String xmlTypeName = (xmlType != null && !xmlType.name().equals("##default")) ? xmlType.name() : exceptionName; String xmlTypeNamespace = (xmlType != null && !xmlType.namespace().equals("##default")) ? xmlType.namespace() : typeNamespace; writeXmlTypeDeclaration(cls, xmlTypeName, xmlTypeNamespace, members); writeMembers(cls, members); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return true; }
Example #15
Source File: PluginImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
private void annotate(JAnnotatable m) { m.annotate(annotation) .param("value", WsimportTool.class.getName()) .param("date", getISO8601Date()) .param("comments", ToolVersion.VERSION.BUILD_VERSION); }
Example #16
Source File: WebServiceWrapperGenerator.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
private boolean generateExceptionBean(TypeElement thrownDecl, String beanPackage) { if (!builder.isServiceException(thrownDecl.asType())) return false; String exceptionName = ClassNameInfo.getName(thrownDecl.getQualifiedName().toString()); if (processedExceptions.contains(exceptionName)) return false; processedExceptions.add(exceptionName); WebFault webFault = thrownDecl.getAnnotation(WebFault.class); String className = beanPackage+ exceptionName + BEAN.getValue(); Collection<MemberInfo> members = ap_generator.collectExceptionBeanMembers(thrownDecl); boolean isWSDLException = isWSDLException(members, thrownDecl); String namespace = typeNamespace; String name = exceptionName; FaultInfo faultInfo; if (isWSDLException) { TypeMirror beanType = getFaultInfoMember(members).getParamType(); faultInfo = new FaultInfo(TypeMonikerFactory.getTypeMoniker(beanType), true); namespace = webFault.targetNamespace().length()>0 ? webFault.targetNamespace() : namespace; name = webFault.name().length()>0 ? webFault.name() : name; faultInfo.setElementName(new QName(namespace, name)); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return false; } if (webFault != null) { namespace = webFault.targetNamespace().length()>0 ? webFault.targetNamespace() : namespace; name = webFault.name().length()>0 ? webFault.name() : name; className = webFault.faultBean().length()>0 ? webFault.faultBean() : className; } JDefinedClass cls = getCMClass(className, CLASS); faultInfo = new FaultInfo(className, false); if (duplicateName(className)) { builder.processError(WebserviceapMessages.WEBSERVICEAP_METHOD_EXCEPTION_BEAN_NAME_NOT_UNIQUE( typeElement.getQualifiedName(), thrownDecl.getQualifiedName())); } boolean canOverWriteBean = builder.canOverWriteClass(className); if (!canOverWriteBean) { builder.log("Class " + className + " exists. Not overwriting."); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return false; } if (seiContext.getExceptionBeanName(thrownDecl.getQualifiedName()) != null) { return false; } addGeneratedFile(className); //write class comment - JAXWS warning JDocComment comment = cls.javadoc(); for (String doc : GeneratorBase.getJAXWSClassComment(ToolVersion.VERSION.MAJOR_VERSION)) { comment.add(doc); } // XmlElement Declarations writeXmlElementDeclaration(cls, name, namespace); // XmlType Declaration //members = sortMembers(members); XmlType xmlType = thrownDecl.getAnnotation(XmlType.class); String xmlTypeName = (xmlType != null && !xmlType.name().equals("##default")) ? xmlType.name() : exceptionName; String xmlTypeNamespace = (xmlType != null && !xmlType.namespace().equals("##default")) ? xmlType.namespace() : typeNamespace; writeXmlTypeDeclaration(cls, xmlTypeName, xmlTypeNamespace, members); writeMembers(cls, members); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return true; }
Example #17
Source File: PluginImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
private void annotate(JAnnotatable m) { m.annotate(annotation) .param("value", WsimportTool.class.getName()) .param("date", getISO8601Date()) .param("comments", ToolVersion.VERSION.BUILD_VERSION); }
Example #18
Source File: WebServiceWrapperGenerator.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
private boolean generateExceptionBean(TypeElement thrownDecl, String beanPackage) { if (!builder.isServiceException(thrownDecl.asType())) return false; String exceptionName = ClassNameInfo.getName(thrownDecl.getQualifiedName().toString()); if (processedExceptions.contains(exceptionName)) return false; processedExceptions.add(exceptionName); WebFault webFault = thrownDecl.getAnnotation(WebFault.class); String className = beanPackage+ exceptionName + BEAN.getValue(); Collection<MemberInfo> members = ap_generator.collectExceptionBeanMembers(thrownDecl); boolean isWSDLException = isWSDLException(members, thrownDecl); String namespace = typeNamespace; String name = exceptionName; FaultInfo faultInfo; if (isWSDLException) { TypeMirror beanType = getFaultInfoMember(members).getParamType(); faultInfo = new FaultInfo(TypeMonikerFactory.getTypeMoniker(beanType), true); namespace = webFault.targetNamespace().length()>0 ? webFault.targetNamespace() : namespace; name = webFault.name().length()>0 ? webFault.name() : name; faultInfo.setElementName(new QName(namespace, name)); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return false; } if (webFault != null) { namespace = webFault.targetNamespace().length()>0 ? webFault.targetNamespace() : namespace; name = webFault.name().length()>0 ? webFault.name() : name; className = webFault.faultBean().length()>0 ? webFault.faultBean() : className; } JDefinedClass cls = getCMClass(className, CLASS); faultInfo = new FaultInfo(className, false); if (duplicateName(className)) { builder.processError(WebserviceapMessages.WEBSERVICEAP_METHOD_EXCEPTION_BEAN_NAME_NOT_UNIQUE( typeElement.getQualifiedName(), thrownDecl.getQualifiedName())); } boolean canOverWriteBean = builder.canOverWriteClass(className); if (!canOverWriteBean) { builder.log("Class " + className + " exists. Not overwriting."); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return false; } if (seiContext.getExceptionBeanName(thrownDecl.getQualifiedName()) != null) return false; //write class comment - JAXWS warning JDocComment comment = cls.javadoc(); for (String doc : GeneratorBase.getJAXWSClassComment(ToolVersion.VERSION.MAJOR_VERSION)) { comment.add(doc); } // XmlElement Declarations writeXmlElementDeclaration(cls, name, namespace); // XmlType Declaration //members = sortMembers(members); XmlType xmlType = thrownDecl.getAnnotation(XmlType.class); String xmlTypeName = (xmlType != null && !xmlType.name().equals("##default")) ? xmlType.name() : exceptionName; String xmlTypeNamespace = (xmlType != null && !xmlType.namespace().equals("##default")) ? xmlType.namespace() : typeNamespace; writeXmlTypeDeclaration(cls, xmlTypeName, xmlTypeNamespace, members); writeMembers(cls, members); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return true; }
Example #19
Source File: PluginImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
private void annotate(JAnnotatable m) { m.annotate(annotation) .param("value", WsimportTool.class.getName()) .param("date", getISO8601Date()) .param("comments", ToolVersion.VERSION.BUILD_VERSION); }
Example #20
Source File: WebServiceWrapperGenerator.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
private boolean generateExceptionBean(TypeElement thrownDecl, String beanPackage) { if (!builder.isServiceException(thrownDecl.asType())) return false; String exceptionName = ClassNameInfo.getName(thrownDecl.getQualifiedName().toString()); if (processedExceptions.contains(exceptionName)) return false; processedExceptions.add(exceptionName); WebFault webFault = thrownDecl.getAnnotation(WebFault.class); String className = beanPackage+ exceptionName + BEAN.getValue(); Collection<MemberInfo> members = ap_generator.collectExceptionBeanMembers(thrownDecl); boolean isWSDLException = isWSDLException(members, thrownDecl); String namespace = typeNamespace; String name = exceptionName; FaultInfo faultInfo; if (isWSDLException) { TypeMirror beanType = getFaultInfoMember(members).getParamType(); faultInfo = new FaultInfo(TypeMonikerFactory.getTypeMoniker(beanType), true); namespace = webFault.targetNamespace().length()>0 ? webFault.targetNamespace() : namespace; name = webFault.name().length()>0 ? webFault.name() : name; faultInfo.setElementName(new QName(namespace, name)); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return false; } if (webFault != null) { namespace = webFault.targetNamespace().length()>0 ? webFault.targetNamespace() : namespace; name = webFault.name().length()>0 ? webFault.name() : name; className = webFault.faultBean().length()>0 ? webFault.faultBean() : className; } JDefinedClass cls = getCMClass(className, CLASS); faultInfo = new FaultInfo(className, false); if (duplicateName(className)) { builder.processError(WebserviceapMessages.WEBSERVICEAP_METHOD_EXCEPTION_BEAN_NAME_NOT_UNIQUE( typeElement.getQualifiedName(), thrownDecl.getQualifiedName())); } boolean canOverWriteBean = builder.canOverWriteClass(className); if (!canOverWriteBean) { builder.log("Class " + className + " exists. Not overwriting."); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return false; } if (seiContext.getExceptionBeanName(thrownDecl.getQualifiedName()) != null) return false; //write class comment - JAXWS warning JDocComment comment = cls.javadoc(); for (String doc : GeneratorBase.getJAXWSClassComment(ToolVersion.VERSION.MAJOR_VERSION)) { comment.add(doc); } // XmlElement Declarations writeXmlElementDeclaration(cls, name, namespace); // XmlType Declaration //members = sortMembers(members); XmlType xmlType = thrownDecl.getAnnotation(XmlType.class); String xmlTypeName = (xmlType != null && !xmlType.name().equals("##default")) ? xmlType.name() : exceptionName; String xmlTypeNamespace = (xmlType != null && !xmlType.namespace().equals("##default")) ? xmlType.namespace() : typeNamespace; writeXmlTypeDeclaration(cls, xmlTypeName, xmlTypeNamespace, members); writeMembers(cls, members); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return true; }
Example #21
Source File: PluginImpl.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
private void annotate(JAnnotatable m) { m.annotate(annotation) .param("value", WsimportTool.class.getName()) .param("date", getISO8601Date()) .param("comments", ToolVersion.VERSION.BUILD_VERSION); }
Example #22
Source File: WebServiceWrapperGenerator.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
private boolean generateExceptionBean(TypeElement thrownDecl, String beanPackage) { if (!builder.isServiceException(thrownDecl.asType())) return false; String exceptionName = ClassNameInfo.getName(thrownDecl.getQualifiedName().toString()); if (processedExceptions.contains(exceptionName)) return false; processedExceptions.add(exceptionName); WebFault webFault = thrownDecl.getAnnotation(WebFault.class); String className = beanPackage+ exceptionName + BEAN.getValue(); Collection<MemberInfo> members = ap_generator.collectExceptionBeanMembers(thrownDecl); boolean isWSDLException = isWSDLException(members, thrownDecl); String namespace = typeNamespace; String name = exceptionName; FaultInfo faultInfo; if (isWSDLException) { TypeMirror beanType = getFaultInfoMember(members).getParamType(); faultInfo = new FaultInfo(TypeMonikerFactory.getTypeMoniker(beanType), true); namespace = webFault.targetNamespace().length()>0 ? webFault.targetNamespace() : namespace; name = webFault.name().length()>0 ? webFault.name() : name; faultInfo.setElementName(new QName(namespace, name)); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return false; } if (webFault != null) { namespace = webFault.targetNamespace().length()>0 ? webFault.targetNamespace() : namespace; name = webFault.name().length()>0 ? webFault.name() : name; className = webFault.faultBean().length()>0 ? webFault.faultBean() : className; } JDefinedClass cls = getCMClass(className, CLASS); faultInfo = new FaultInfo(className, false); if (duplicateName(className)) { builder.processError(WebserviceapMessages.WEBSERVICEAP_METHOD_EXCEPTION_BEAN_NAME_NOT_UNIQUE( typeElement.getQualifiedName(), thrownDecl.getQualifiedName())); } boolean canOverWriteBean = builder.canOverWriteClass(className); if (!canOverWriteBean) { builder.log("Class " + className + " exists. Not overwriting."); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return false; } if (seiContext.getExceptionBeanName(thrownDecl.getQualifiedName()) != null) return false; //write class comment - JAXWS warning JDocComment comment = cls.javadoc(); for (String doc : GeneratorBase.getJAXWSClassComment(ToolVersion.VERSION.MAJOR_VERSION)) { comment.add(doc); } // XmlElement Declarations writeXmlElementDeclaration(cls, name, namespace); // XmlType Declaration //members = sortMembers(members); XmlType xmlType = thrownDecl.getAnnotation(XmlType.class); String xmlTypeName = (xmlType != null && !xmlType.name().equals("##default")) ? xmlType.name() : exceptionName; String xmlTypeNamespace = (xmlType != null && !xmlType.namespace().equals("##default")) ? xmlType.namespace() : typeNamespace; writeXmlTypeDeclaration(cls, xmlTypeName, xmlTypeNamespace, members); writeMembers(cls, members); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return true; }
Example #23
Source File: PluginImpl.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
private void annotate(JAnnotatable m) { m.annotate(annotation) .param("value", WsimportTool.class.getName()) .param("date", getISO8601Date()) .param("comments", ToolVersion.VERSION.BUILD_VERSION); }
Example #24
Source File: WebServiceWrapperGenerator.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
private boolean generateExceptionBean(TypeElement thrownDecl, String beanPackage) { if (!builder.isServiceException(thrownDecl.asType())) return false; String exceptionName = ClassNameInfo.getName(thrownDecl.getQualifiedName().toString()); if (processedExceptions.contains(exceptionName)) return false; processedExceptions.add(exceptionName); WebFault webFault = thrownDecl.getAnnotation(WebFault.class); String className = beanPackage+ exceptionName + BEAN.getValue(); Collection<MemberInfo> members = ap_generator.collectExceptionBeanMembers(thrownDecl); boolean isWSDLException = isWSDLException(members, thrownDecl); String namespace = typeNamespace; String name = exceptionName; FaultInfo faultInfo; if (isWSDLException) { TypeMirror beanType = getFaultInfoMember(members).getParamType(); faultInfo = new FaultInfo(TypeMonikerFactory.getTypeMoniker(beanType), true); namespace = webFault.targetNamespace().length()>0 ? webFault.targetNamespace() : namespace; name = webFault.name().length()>0 ? webFault.name() : name; faultInfo.setElementName(new QName(namespace, name)); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return false; } if (webFault != null) { namespace = webFault.targetNamespace().length()>0 ? webFault.targetNamespace() : namespace; name = webFault.name().length()>0 ? webFault.name() : name; className = webFault.faultBean().length()>0 ? webFault.faultBean() : className; } JDefinedClass cls = getCMClass(className, CLASS); faultInfo = new FaultInfo(className, false); if (duplicateName(className)) { builder.processError(WebserviceapMessages.WEBSERVICEAP_METHOD_EXCEPTION_BEAN_NAME_NOT_UNIQUE( typeElement.getQualifiedName(), thrownDecl.getQualifiedName())); } boolean canOverWriteBean = builder.canOverWriteClass(className); if (!canOverWriteBean) { builder.log("Class " + className + " exists. Not overwriting."); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return false; } if (seiContext.getExceptionBeanName(thrownDecl.getQualifiedName()) != null) return false; //write class comment - JAXWS warning JDocComment comment = cls.javadoc(); for (String doc : GeneratorBase.getJAXWSClassComment(ToolVersion.VERSION.MAJOR_VERSION)) { comment.add(doc); } // XmlElement Declarations writeXmlElementDeclaration(cls, name, namespace); // XmlType Declaration //members = sortMembers(members); XmlType xmlType = thrownDecl.getAnnotation(XmlType.class); String xmlTypeName = (xmlType != null && !xmlType.name().equals("##default")) ? xmlType.name() : exceptionName; String xmlTypeNamespace = (xmlType != null && !xmlType.namespace().equals("##default")) ? xmlType.namespace() : typeNamespace; writeXmlTypeDeclaration(cls, xmlTypeName, xmlTypeNamespace, members); writeMembers(cls, members); seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder); return true; }