|
Java example source code file (Operation.java)
The Operation.java Java example source code/* * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package com.sun.tools.internal.ws.processor.model; import com.sun.tools.internal.ws.processor.model.java.JavaMethod; import com.sun.tools.internal.ws.wsdl.document.soap.SOAPStyle; import com.sun.tools.internal.ws.wsdl.document.soap.SOAPUse; import com.sun.tools.internal.ws.wsdl.framework.Entity; import com.sun.xml.internal.ws.spi.db.BindingHelper; import javax.xml.namespace.QName; import java.util.HashSet; import java.util.Iterator; import java.util.Set; /** * * @author WS Development Team */ public class Operation extends ModelObject { public Operation(Entity entity) { super(entity); } public Operation(Operation operation, Entity entity){ this(operation._name, entity); this._style = operation._style; this._use = operation._use; this.customizedName = operation.customizedName; } public Operation(QName name, Entity entity) { super(entity); _name = name; _uniqueName = name.getLocalPart(); _faultNames = new HashSet<String>(); _faults = new HashSet<Fault>(); } public QName getName() { return _name; } public void setName(QName n) { _name = n; } public String getUniqueName() { return _uniqueName; } public void setUniqueName(String s) { _uniqueName = s; } public Request getRequest() { return _request; } public void setRequest(Request r) { _request = r; } public Response getResponse() { return _response; } public void setResponse(Response r) { _response = r; } public boolean isOverloaded() { return !_name.getLocalPart().equals(_uniqueName); } public void addFault(Fault f) { if (_faultNames.contains(f.getName())) { throw new ModelException("model.uniqueness"); } _faultNames.add(f.getName()); _faults.add(f); } public Iterator<Fault> getFaults() { return _faults.iterator(); } public Set<Fault> getFaultsSet() { return _faults; } /* serialization */ public void setFaultsSet(Set<Fault> s) { _faults = s; initializeFaultNames(); } private void initializeFaultNames() { _faultNames = new HashSet<String>(); if (_faults != null) { for (Iterator iter = _faults.iterator(); iter.hasNext();) { Fault f = (Fault) iter.next(); if (f.getName() != null && _faultNames.contains(f.getName())) { throw new ModelException("model.uniqueness"); } _faultNames.add(f.getName()); } } } public Iterator<Fault> getAllFaults() { Set<Fault> allFaults = getAllFaultsSet(); return allFaults.iterator(); } public Set<Fault> getAllFaultsSet() { Set transSet = new HashSet(); transSet.addAll(_faults); Iterator iter = _faults.iterator(); Fault fault; Set tmpSet; while (iter.hasNext()) { tmpSet = ((Fault)iter.next()).getAllFaultsSet(); transSet.addAll(tmpSet); } return transSet; } public int getFaultCount() { return _faults.size(); } public Set<Block> getAllFaultBlocks(){ Set<Block> blocks = new HashSet Other Java examples (source code examples)Here is a short list of links related to this Java Operation.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.