本文整理汇总了Java中com.sun.tools.internal.ws.ToolVersion类的典型用法代码示例。如果您正苦于以下问题:Java ToolVersion类的具体用法?Java ToolVersion怎么用?Java ToolVersion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ToolVersion类属于com.sun.tools.internal.ws包,在下文中一共展示了ToolVersion类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getJAXWSClassComment
import com.sun.tools.internal.ws.ToolVersion; //导入依赖的package包/类
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;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:GeneratorBase.java
示例2: generateExceptionBean
import com.sun.tools.internal.ws.ToolVersion; //导入依赖的package包/类
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;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:75,代码来源:WebServiceWrapperGenerator.java
示例3: annotate
import com.sun.tools.internal.ws.ToolVersion; //导入依赖的package包/类
private void annotate(JAnnotatable m) {
m.annotate(annotation)
.param("value", WsimportTool.class.getName())
.param("date", getISO8601Date())
.param("comments", ToolVersion.VERSION.BUILD_VERSION);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:PluginImpl.java
示例4: generateExceptionBean
import com.sun.tools.internal.ws.ToolVersion; //导入依赖的package包/类
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;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:78,代码来源:WebServiceWrapperGenerator.java
示例5: getSourceVersion
import com.sun.tools.internal.ws.ToolVersion; //导入依赖的package包/类
public String getSourceVersion() {
return ToolVersion.VERSION.MAJOR_VERSION;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:4,代码来源:WebServiceAP.java
注:本文中的com.sun.tools.internal.ws.ToolVersion类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论