private boolean isWebFaultAbsent(final Class exceptionClass) {
return StringUtils.isEmpty(getWebFaultBean(exceptionClass));
}
public WrapperBeanClass transform(final Class exceptionClass, final String defaultPackage) {
WrapperBeanClass jClass = new WrapperBeanClass();
if (isWebFaultAbsent(exceptionClass)) {
jClass.setName(exceptionClass.getSimpleName() + "Bean");
jClass.setPackageName(defaultPackage);
} else {
jClass.setFullClassName(getWebFaultBean(exceptionClass));
}
buildBeanFields(exceptionClass, jClass);
String pkg = PackageUtils.getPackageName(exceptionClass);
if (pkg.length() > 0) {
jClass.setElementName(new QName(URIParserUtil.getNamespace(pkg),
exceptionClass.getSimpleName()));
} else {
jClass.setElementName(new QName(URIParserUtil.getNamespace(ToolConstants.DEFAULT_PACKAGE_NAME),
exceptionClass.getSimpleName()));
}
jClass.annotate(new WrapperBeanAnnotator(exceptionClass));
return jClass;
}