325N/A/*
325N/A * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
325N/A *
325N/A * This code is free software; you can redistribute it and/or modify it
325N/A * under the terms of the GNU General Public License version 2 only, as
325N/A * published by the Free Software Foundation. Oracle designates this
325N/A * particular file as subject to the "Classpath" exception as provided
325N/A * by Oracle in the LICENSE file that accompanied this code.
325N/A *
325N/A * This code is distributed in the hope that it will be useful, but WITHOUT
325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
325N/A * version 2 for more details (a copy is included in the LICENSE file that
325N/A * accompanied this code).
325N/A *
325N/A * You should have received a copy of the GNU General Public License version
325N/A * 2 along with this work; if not, write to the Free Software Foundation,
325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
325N/A *
325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
325N/A * or visit www.oracle.com if you need additional information or have any
325N/A * questions.
325N/A */
325N/A
325N/Apackage com.sun.tools.internal.ws.processor.model;
325N/A
325N/Aimport com.sun.codemodel.internal.JClass;
325N/Aimport com.sun.tools.internal.ws.processor.generator.GeneratorUtil;
325N/Aimport com.sun.tools.internal.ws.processor.model.java.JavaException;
325N/Aimport com.sun.tools.internal.ws.wsdl.framework.Entity;
325N/A
325N/Aimport javax.xml.namespace.QName;
325N/Aimport java.util.HashSet;
325N/Aimport java.util.Iterator;
325N/Aimport java.util.Set;
325N/Aimport java.util.TreeSet;
325N/A
325N/A/**
325N/A *
325N/A * @author WS Development Team
325N/A */
325N/Apublic class Fault extends ModelObject {
325N/A
325N/A public Fault(Entity entity) {
325N/A super(entity);
325N/A }
325N/A
325N/A public Fault(String name, Entity entity) {
325N/A super(entity);
325N/A this.name = name;
325N/A parentFault = null;
325N/A }
325N/A
325N/A public String getName() {
325N/A return name;
325N/A }
325N/A
325N/A public void setName(String s) {
325N/A name = s;
325N/A }
325N/A
325N/A public Block getBlock() {
325N/A return block;
325N/A }
325N/A
325N/A public void setBlock(Block b) {
325N/A block = b;
325N/A }
325N/A
325N/A public JavaException getJavaException() {
325N/A return javaException;
325N/A }
325N/A
325N/A public void setJavaException(JavaException e) {
325N/A javaException = e;
325N/A }
325N/A
325N/A public void accept(ModelVisitor visitor) throws Exception {
325N/A visitor.visit(this);
325N/A }
325N/A
325N/A public Fault getParentFault() {
325N/A return parentFault;
325N/A }
325N/A
325N/A public Iterator getSubfaults() {
325N/A if (subfaults.size() == 0) {
325N/A return null;
325N/A }
325N/A return subfaults.iterator();
325N/A }
325N/A
325N/A /* serialization */
325N/A public Set getSubfaultsSet() {
325N/A return subfaults;
325N/A }
325N/A
325N/A /* serialization */
325N/A public void setSubfaultsSet(Set s) {
325N/A subfaults = s;
325N/A }
325N/A
325N/A public Iterator getAllFaults() {
325N/A Set allFaults = getAllFaultsSet();
325N/A if (allFaults.size() == 0) {
325N/A return null;
325N/A }
325N/A return allFaults.iterator();
325N/A }
325N/A
325N/A public Set getAllFaultsSet() {
325N/A Set transSet = new HashSet();
325N/A Iterator iter = subfaults.iterator();
325N/A while (iter.hasNext()) {
325N/A transSet.addAll(((Fault)iter.next()).getAllFaultsSet());
325N/A }
325N/A transSet.addAll(subfaults);
325N/A return transSet;
325N/A }
325N/A
325N/A public QName getElementName() {
325N/A return elementName;
325N/A }
325N/A
325N/A public void setElementName(QName elementName) {
325N/A this.elementName = elementName;
325N/A }
325N/A
325N/A public String getJavaMemberName() {
325N/A return javaMemberName;
325N/A }
325N/A
325N/A public void setJavaMemberName(String javaMemberName) {
325N/A this.javaMemberName = javaMemberName;
325N/A }
325N/A
325N/A /**
325N/A * @return Returns the wsdlFault.
325N/A */
325N/A public boolean isWsdlException() {
325N/A return wsdlException;
325N/A }
325N/A /**
325N/A * @param wsdlFault The wsdlFault to set.
325N/A */
325N/A public void setWsdlException(boolean wsdlFault) {
325N/A this.wsdlException = wsdlFault;
325N/A }
325N/A
325N/A public void setExceptionClass(JClass ex){
325N/A exceptionClass = ex;
325N/A }
325N/A
325N/A public JClass getExceptionClass(){
325N/A return exceptionClass;
325N/A }
325N/A
325N/A private boolean wsdlException = true;
325N/A private String name;
325N/A private Block block;
325N/A private JavaException javaException;
325N/A private Fault parentFault;
325N/A private Set subfaults = new HashSet();
325N/A private QName elementName = null;
325N/A private String javaMemberName = null;
325N/A private JClass exceptionClass;
325N/A
325N/A public String getWsdlFaultName() {
325N/A return wsdlFaultName;
325N/A }
325N/A
325N/A public void setWsdlFaultName(String wsdlFaultName) {
325N/A this.wsdlFaultName = wsdlFaultName;
325N/A }
325N/A
325N/A private String wsdlFaultName;
325N/A}