src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Fault.java

changeset 0
373ffda63c9a
child 637
9c07ef4934dd
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Fault.java	Wed Apr 27 01:27:09 2016 +0800
     1.3 @@ -0,0 +1,170 @@
     1.4 +/*
     1.5 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 + *
     1.8 + * This code is free software; you can redistribute it and/or modify it
     1.9 + * under the terms of the GNU General Public License version 2 only, as
    1.10 + * published by the Free Software Foundation.  Oracle designates this
    1.11 + * particular file as subject to the "Classpath" exception as provided
    1.12 + * by Oracle in the LICENSE file that accompanied this code.
    1.13 + *
    1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
    1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.17 + * version 2 for more details (a copy is included in the LICENSE file that
    1.18 + * accompanied this code).
    1.19 + *
    1.20 + * You should have received a copy of the GNU General Public License version
    1.21 + * 2 along with this work; if not, write to the Free Software Foundation,
    1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.23 + *
    1.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.25 + * or visit www.oracle.com if you need additional information or have any
    1.26 + * questions.
    1.27 + */
    1.28 +
    1.29 +package com.sun.tools.internal.ws.processor.model;
    1.30 +
    1.31 +import com.sun.codemodel.internal.JClass;
    1.32 +import com.sun.tools.internal.ws.processor.model.java.JavaException;
    1.33 +import com.sun.tools.internal.ws.wsdl.framework.Entity;
    1.34 +
    1.35 +import javax.xml.namespace.QName;
    1.36 +import java.util.HashSet;
    1.37 +import java.util.Iterator;
    1.38 +import java.util.Set;
    1.39 +
    1.40 +/**
    1.41 + *
    1.42 + * @author WS Development Team
    1.43 + */
    1.44 +public class Fault extends ModelObject {
    1.45 +
    1.46 +    public Fault(Entity entity) {
    1.47 +        super(entity);
    1.48 +    }
    1.49 +
    1.50 +    public Fault(String name, Entity entity) {
    1.51 +        super(entity);
    1.52 +        this.name = name;
    1.53 +    }
    1.54 +
    1.55 +    public String getName() {
    1.56 +        return name;
    1.57 +    }
    1.58 +
    1.59 +    public void setName(String s) {
    1.60 +        name = s;
    1.61 +    }
    1.62 +
    1.63 +    public Block getBlock() {
    1.64 +        return block;
    1.65 +    }
    1.66 +
    1.67 +    public void setBlock(Block b) {
    1.68 +        block = b;
    1.69 +    }
    1.70 +
    1.71 +    public JavaException getJavaException() {
    1.72 +        return javaException;
    1.73 +    }
    1.74 +
    1.75 +    public void setJavaException(JavaException e) {
    1.76 +        javaException = e;
    1.77 +    }
    1.78 +
    1.79 +    public void accept(ModelVisitor visitor) throws Exception {
    1.80 +        visitor.visit(this);
    1.81 +    }
    1.82 +
    1.83 +    public Iterator getSubfaults() {
    1.84 +        if (subfaults.isEmpty()) {
    1.85 +            return null;
    1.86 +        }
    1.87 +        return subfaults.iterator();
    1.88 +    }
    1.89 +
    1.90 +    /* serialization */
    1.91 +    public Set getSubfaultsSet() {
    1.92 +        return subfaults;
    1.93 +    }
    1.94 +
    1.95 +    /* serialization */
    1.96 +    public void setSubfaultsSet(Set s) {
    1.97 +        subfaults = s;
    1.98 +    }
    1.99 +
   1.100 +    public Iterator getAllFaults() {
   1.101 +        Set allFaults = getAllFaultsSet();
   1.102 +        if (allFaults.isEmpty()) {
   1.103 +            return null;
   1.104 +        }
   1.105 +        return allFaults.iterator();
   1.106 +    }
   1.107 +
   1.108 +    public Set getAllFaultsSet() {
   1.109 +        Set transSet = new HashSet();
   1.110 +        Iterator iter = subfaults.iterator();
   1.111 +        while (iter.hasNext()) {
   1.112 +            transSet.addAll(((Fault)iter.next()).getAllFaultsSet());
   1.113 +        }
   1.114 +        transSet.addAll(subfaults);
   1.115 +        return transSet;
   1.116 +    }
   1.117 +
   1.118 +    public QName getElementName() {
   1.119 +        return elementName;
   1.120 +    }
   1.121 +
   1.122 +    public void setElementName(QName elementName) {
   1.123 +        this.elementName = elementName;
   1.124 +    }
   1.125 +
   1.126 +    public String getJavaMemberName() {
   1.127 +        return javaMemberName;
   1.128 +    }
   1.129 +
   1.130 +    public void setJavaMemberName(String javaMemberName) {
   1.131 +        this.javaMemberName = javaMemberName;
   1.132 +    }
   1.133 +
   1.134 +    /**
   1.135 +     * @return Returns the wsdlFault.
   1.136 +     */
   1.137 +    public boolean isWsdlException() {
   1.138 +            return wsdlException;
   1.139 +    }
   1.140 +    /**
   1.141 +     * @param wsdlFault The wsdlFault to set.
   1.142 +     */
   1.143 +    public void setWsdlException(boolean wsdlFault) {
   1.144 +            this.wsdlException = wsdlFault;
   1.145 +    }
   1.146 +
   1.147 +    public void setExceptionClass(JClass ex){
   1.148 +        exceptionClass = ex;
   1.149 +    }
   1.150 +
   1.151 +    public JClass getExceptionClass(){
   1.152 +        return exceptionClass;
   1.153 +    }
   1.154 +
   1.155 +    private boolean wsdlException = true;
   1.156 +    private String name;
   1.157 +    private Block block;
   1.158 +    private JavaException javaException;
   1.159 +    private Set subfaults = new HashSet();
   1.160 +    private QName elementName = null;
   1.161 +    private String javaMemberName = null;
   1.162 +    private JClass exceptionClass;
   1.163 +
   1.164 +    public String getWsdlFaultName() {
   1.165 +        return wsdlFaultName;
   1.166 +    }
   1.167 +
   1.168 +    public void setWsdlFaultName(String wsdlFaultName) {
   1.169 +        this.wsdlFaultName = wsdlFaultName;
   1.170 +    }
   1.171 +
   1.172 +    private String wsdlFaultName;
   1.173 +}

mercurial