Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
public final class FaultBeanGenerator extends BeanGenerator {
    private String getSEIPackage(final Method method) {
        Package pkg = method.getDeclaringClass().getPackage();
        if (pkg == null) {
            return .;
        return pkg.getName();
    protected Collection<JavaClassgenerateBeanClasses(final ServiceInfo serviceInfo) {
        Set<ClassexceptionClasses = new HashSet<Class>();
        String seiPackageName = null;
        for (OperationInfo op : serviceInfo.getInterface().getOperations()) {
            Method method = (Methodop.getProperty("operation.method");
            seiPackageName = getSEIPackage(method);
        Collection<JavaClassfaultBeanClasses = new HashSet<JavaClass>();
        String defaultPackage = seiPackageName + ".jaxws";
        FaultBean bean = new FaultBean();
        for (Class clz : exceptionClasses) {
        return faultBeanClasses;
    protected Set<ClassgetExceptionClasses(final Method method) {
        Set<Classexps = new HashSet<Class>();
        final Class[] exceptionClasses = method.getExceptionTypes();
        for (int i = 0; i < exceptionClasses.lengthi++) {
            boolean exclude = false;
            Class exClazz = exceptionClasses[i];
            if (exClazz.equals(Exception.class
                || Fault.class.isAssignableFrom(exClazz)
                || exClazz.equals(RuntimeException.class)
                || exClazz.equals(Throwable.class)
                || exClazz.equals(RemoteException.class)
                || exClazz.equals(ServerException.class)) {
            Method[] expMethods = exClazz.getMethods();
            for (Method expMethod : expMethods) {
                if ("getFaultInfo".equals(expMethod.getName())) {
                    exclude = true;
            if (exclude) {
        return exps;
New to GrepCode? Check out our FAQ X