本文整理汇总了Java中com.sun.xml.internal.ws.api.model.ExceptionType.WSDLException方法的典型用法代码示例。如果您正苦于以下问题:Java ExceptionType.WSDLException方法的具体用法?Java ExceptionType.WSDLException怎么用?Java ExceptionType.WSDLException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.xml.internal.ws.api.model.ExceptionType
的用法示例。
在下文中一共展示了ExceptionType.WSDLException方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processExceptions
import com.sun.xml.internal.ws.api.model.ExceptionType; //导入方法依赖的package包/类
/**
* models the exceptions thrown by <code>method</code> and adds them to the <code>javaMethod</code>
* runtime model object
* @param javaMethod the runtime model object to add the exception model objects to
* @param method the <code>method</code> from which to find the exceptions to model
*/
protected void processExceptions(JavaMethodImpl javaMethod, Method method) {
Action actionAnn = getAnnotation(method, Action.class);
FaultAction[] faultActions = {};
if(actionAnn != null)
faultActions = actionAnn.fault();
for (Class<?> exception : method.getExceptionTypes()) {
//Exclude RuntimeException, RemoteException and Error etc
if (!EXCEPTION_CLASS.isAssignableFrom(exception))
continue;
if (RUNTIME_EXCEPTION_CLASS.isAssignableFrom(exception) || REMOTE_EXCEPTION_CLASS.isAssignableFrom(exception))
continue;
Class exceptionBean;
Annotation[] anns;
WebFault webFault = getAnnotation(exception, WebFault.class);
Method faultInfoMethod = getWSDLExceptionFaultInfo(exception);
ExceptionType exceptionType = ExceptionType.WSDLException;
String namespace = targetNamespace;
String name = exception.getSimpleName();
String beanPackage = packageName + PD_JAXWS_PACKAGE_PD;
if (packageName.length() == 0)
beanPackage = JAXWS_PACKAGE_PD;
String className = beanPackage+ name + BEAN;
String messageName = exception.getSimpleName();
if (webFault != null) {
if (webFault.faultBean().length()>0)
className = webFault.faultBean();
if (webFault.name().length()>0)
name = webFault.name();
if (webFault.targetNamespace().length()>0)
namespace = webFault.targetNamespace();
if (webFault.messageName().length()>0)
messageName = webFault.messageName();
}
if (faultInfoMethod == null) {
exceptionBean = getExceptionBeanClass(className, exception, name, namespace);
exceptionType = ExceptionType.UserDefined;
anns = getAnnotations(exceptionBean);
} else {
exceptionBean = faultInfoMethod.getReturnType();
anns = getAnnotations(faultInfoMethod);
}
QName faultName = new QName(namespace, name);
TypeInfo typeRef = new TypeInfo(faultName, exceptionBean, anns);
CheckedExceptionImpl checkedException =
new CheckedExceptionImpl(javaMethod, exception, typeRef, exceptionType);
checkedException.setMessageName(messageName);
for(FaultAction fa: faultActions) {
if(fa.className().equals(exception) && !fa.value().equals("")) {
checkedException.setFaultAction(fa.value());
break;
}
}
javaMethod.addException(checkedException);
}
}
示例2: processExceptions
import com.sun.xml.internal.ws.api.model.ExceptionType; //导入方法依赖的package包/类
/**
* models the exceptions thrown by <code>method</code> and adds them to the <code>javaMethod</code>
* runtime model object
* @param javaMethod the runtime model object to add the exception model objects to
* @param method the <code>method</code> from which to find the exceptions to model
*/
protected void processExceptions(JavaMethodImpl javaMethod, Method method) {
Action actionAnn = getAnnotation(method, Action.class);
FaultAction[] faultActions = {};
if(actionAnn != null)
faultActions = actionAnn.fault();
for (Class<?> exception : method.getExceptionTypes()) {
//Exclude RuntimeException, RemoteException and Error etc
if (!EXCEPTION_CLASS.isAssignableFrom(exception))
continue;
if (RUNTIME_EXCEPTION_CLASS.isAssignableFrom(exception) || isRemoteException(exception))
continue;
if (getAnnotation(exception, javax.xml.bind.annotation.XmlTransient.class) != null)
continue;
Class exceptionBean;
Annotation[] anns;
WebFault webFault = getAnnotation(exception, WebFault.class);
Method faultInfoMethod = getWSDLExceptionFaultInfo(exception);
ExceptionType exceptionType = ExceptionType.WSDLException;
String namespace = targetNamespace;
String name = exception.getSimpleName();
String beanPackage = packageName + PD_JAXWS_PACKAGE_PD;
if (packageName.length() == 0)
beanPackage = JAXWS_PACKAGE_PD;
String className = beanPackage+ name + BEAN;
String messageName = exception.getSimpleName();
if (webFault != null) {
if (webFault.faultBean().length()>0)
className = webFault.faultBean();
if (webFault.name().length()>0)
name = webFault.name();
if (webFault.targetNamespace().length()>0)
namespace = webFault.targetNamespace();
if (webFault.messageName().length()>0)
messageName = webFault.messageName();
}
if (faultInfoMethod == null) {
exceptionBean = getExceptionBeanClass(className, exception, name, namespace);
exceptionType = ExceptionType.UserDefined;
anns = getAnnotations(exceptionBean);
} else {
exceptionBean = faultInfoMethod.getReturnType();
anns = getAnnotations(faultInfoMethod);
}
QName faultName = new QName(namespace, name);
TypeInfo typeRef = new TypeInfo(faultName, exceptionBean, anns);
CheckedExceptionImpl checkedException =
new CheckedExceptionImpl(javaMethod, exception, typeRef, exceptionType);
checkedException.setMessageName(messageName);
checkedException.setFaultInfoGetter(faultInfoMethod);
for(FaultAction fa: faultActions) {
if(fa.className().equals(exception) && !fa.value().equals("")) {
checkedException.setFaultAction(fa.value());
break;
}
}
javaMethod.addException(checkedException);
}
}
示例3: processExceptions
import com.sun.xml.internal.ws.api.model.ExceptionType; //导入方法依赖的package包/类
/**
* models the exceptions thrown by <code>method</code> and adds them to the <code>javaMethod</code>
* runtime model object
* @param javaMethod the runtime model object to add the exception model objects to
* @param method the <code>method</code> from which to find the exceptions to model
*/
protected void processExceptions(JavaMethodImpl javaMethod, Method method) {
Action actionAnn = getAnnotation(method, Action.class);
FaultAction[] faultActions = {};
if(actionAnn != null)
faultActions = actionAnn.fault();
for (Class<?> exception : method.getExceptionTypes()) {
//Exclude RuntimeException, RemoteException and Error etc
if (!EXCEPTION_CLASS.isAssignableFrom(exception))
continue;
if (RUNTIME_EXCEPTION_CLASS.isAssignableFrom(exception) || REMOTE_EXCEPTION_CLASS.isAssignableFrom(exception))
continue;
if (getAnnotation(exception, javax.xml.bind.annotation.XmlTransient.class) != null)
continue;
Class exceptionBean;
Annotation[] anns;
WebFault webFault = getAnnotation(exception, WebFault.class);
Method faultInfoMethod = getWSDLExceptionFaultInfo(exception);
ExceptionType exceptionType = ExceptionType.WSDLException;
String namespace = targetNamespace;
String name = exception.getSimpleName();
String beanPackage = packageName + PD_JAXWS_PACKAGE_PD;
if (packageName.length() == 0)
beanPackage = JAXWS_PACKAGE_PD;
String className = beanPackage+ name + BEAN;
String messageName = exception.getSimpleName();
if (webFault != null) {
if (webFault.faultBean().length()>0)
className = webFault.faultBean();
if (webFault.name().length()>0)
name = webFault.name();
if (webFault.targetNamespace().length()>0)
namespace = webFault.targetNamespace();
if (webFault.messageName().length()>0)
messageName = webFault.messageName();
}
if (faultInfoMethod == null) {
exceptionBean = getExceptionBeanClass(className, exception, name, namespace);
exceptionType = ExceptionType.UserDefined;
anns = getAnnotations(exceptionBean);
} else {
exceptionBean = faultInfoMethod.getReturnType();
anns = getAnnotations(faultInfoMethod);
}
QName faultName = new QName(namespace, name);
TypeInfo typeRef = new TypeInfo(faultName, exceptionBean, anns);
CheckedExceptionImpl checkedException =
new CheckedExceptionImpl(javaMethod, exception, typeRef, exceptionType);
checkedException.setMessageName(messageName);
checkedException.setFaultInfoGetter(faultInfoMethod);
for(FaultAction fa: faultActions) {
if(fa.className().equals(exception) && !fa.value().equals("")) {
checkedException.setFaultAction(fa.value());
break;
}
}
javaMethod.addException(checkedException);
}
}
示例4: processExceptions
import com.sun.xml.internal.ws.api.model.ExceptionType; //导入方法依赖的package包/类
/**
* models the exceptions thrown by <code>method</code> and adds them to the <code>javaMethod</code>
* runtime model object
* @param javaMethod the runtime model object to add the exception model objects to
* @param method the <code>method</code> from which to find the exceptions to model
*/
protected void processExceptions(JavaMethodImpl javaMethod, Method method) {
Action actionAnn = method.getAnnotation(Action.class);
FaultAction[] faultActions = {};
if(actionAnn != null)
faultActions = actionAnn.fault();
for (Class<?> exception : method.getExceptionTypes()) {
//Exclude RuntimeException, RemoteException and Error etc
if (!EXCEPTION_CLASS.isAssignableFrom(exception))
continue;
if (RUNTIME_EXCEPTION_CLASS.isAssignableFrom(exception) || REMOTE_EXCEPTION_CLASS.isAssignableFrom(exception))
continue;
Class exceptionBean;
Annotation[] anns;
WebFault webFault = getPrivClassAnnotation(exception, WebFault.class);
Method faultInfoMethod = getWSDLExceptionFaultInfo(exception);
ExceptionType exceptionType = ExceptionType.WSDLException;
String namespace = targetNamespace;
String name = exception.getSimpleName();
String beanPackage = packageName + PD_JAXWS_PACKAGE_PD;
if (packageName.length() == 0)
beanPackage = JAXWS_PACKAGE_PD;
String className = beanPackage+ name + BEAN;
String messageName = exception.getSimpleName();
if (webFault != null) {
if (webFault.faultBean().length()>0)
className = webFault.faultBean();
if (webFault.name().length()>0)
name = webFault.name();
if (webFault.targetNamespace().length()>0)
namespace = webFault.targetNamespace();
if (webFault.messageName().length()>0)
messageName = webFault.messageName();
}
if (faultInfoMethod == null) {
exceptionBean = getExceptionBeanClass(className, exception, name, namespace);
exceptionType = ExceptionType.UserDefined;
anns = exceptionBean.getAnnotations();
} else {
exceptionBean = faultInfoMethod.getReturnType();
anns = faultInfoMethod.getAnnotations();
}
QName faultName = new QName(namespace, name);
TypeReference typeRef = new TypeReference(faultName, exceptionBean, anns);
CheckedExceptionImpl checkedException =
new CheckedExceptionImpl(javaMethod, exception, typeRef, exceptionType);
checkedException.setMessageName(messageName);
for(FaultAction fa: faultActions) {
if(fa.className().equals(exception) && !fa.value().equals("")) {
checkedException.setFaultAction(fa.value());
break;
}
}
javaMethod.addException(checkedException);
}
}