01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2007 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU General Public License as published by the
09: * Free Software Foundation; either version 2 of the License, or (at your option)
10: * any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15: * for more details.
16: *
17: * You should have received a copy of the GNU General Public License along with
18: * this program; if not, write to the Free Software Foundation, Inc.,
19: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: *
21: *
22: * $Id: ComponentInfo.java 4582 2007-01-18 22:54:26Z mpreston $
23: */
24:
25: package com.bostechcorp.cbesb.common.wsdl;
26:
27: import java.util.Iterator;
28: import java.util.List;
29:
30: import javax.wsdl.extensions.ExtensibilityElement;
31: import javax.wsdl.Definition;
32:
33: public abstract class ComponentInfo {
34:
35: protected String name;
36:
37: protected String namespaceURI;
38:
39: /**
40: * @return the name
41: */
42: public String getName() {
43: return name;
44: }
45:
46: /**
47: * @param name the name to set
48: */
49: public void setName(String name) {
50: this .name = name;
51: }
52:
53: /**
54: * @return the namespaceURI
55: */
56: public String getNamespaceURI() {
57: return namespaceURI;
58: }
59:
60: /**
61: * @param namespaceURI the namespaceURI to set
62: */
63: public void setNamespaceURI(String namespaceURI) {
64: this .namespaceURI = namespaceURI;
65: }
66:
67: /**
68: * Returns the desired ExtensibilityElement if found in the List
69: *
70: * @param extensibilityElements
71: * The list of extensibility elements to search
72: * @param elementType
73: * The element type to find
74: *
75: * @return Returns the first matching element of type found in the list
76: */
77: protected static ExtensibilityElement findExtensibilityElement(
78: List extensibilityElements, String elementType) {
79: if (extensibilityElements != null) {
80: Iterator iter = extensibilityElements.iterator();
81:
82: while (iter.hasNext()) {
83: ExtensibilityElement element = (ExtensibilityElement) iter
84: .next();
85: if (element.getElementType().getLocalPart()
86: .equalsIgnoreCase(elementType)) {
87: // Found it
88: return element;
89: }
90: }
91: }
92:
93: return null;
94: }
95:
96: }
|