001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.compapp.projects.jbi.api;
043:
044: import java.io.Serializable;
045: import java.net.URL;
046: import java.util.List;
047:
048: /**
049: * JBI extension info.
050: *
051: * @author tli
052: */
053: public class JbiExtensionInfo implements Serializable {
054:
055: /**
056: * Name of the extension, e.x., "ConfigExtension".
057: */
058: private String name;
059:
060: /**
061: * Name of the extension schema file.
062: */
063: private String file;
064:
065: /**
066: * Type of the extension, e.x., "port", "endpoint", "connection", or "su".
067: */
068: private String type;
069:
070: /**
071: * Name of the target component, e.x., "sun-http-binding", "all"
072: */
073: private String target;
074:
075: /**
076: * DOCUMENT ME!
077: */
078: private String description;
079:
080: /**
081: * DOCUMENT ME!
082: */
083: private URL icon;
084:
085: /**
086: * DOCUMENT ME!
087: */
088: private String ns;
089:
090: /**
091: * DOCUMENT ME!
092: */
093: private List<JbiExtensionElement> elements;
094:
095: /**
096: * DOCUMENT ME!
097: *
098: * @param name extension name, e.x., "ConfigExtension"
099: * @param type extension type, e.x., "endpoint", "connection"
100: * @param target extension target, e.x., "sun-http-binding", "all".
101: * @param file schema file
102: * @param ns extension namespace
103: * @param description extension description
104: * @param icon extension icon resource
105: * @param elements a list of extension elements
106: */
107: public JbiExtensionInfo(String name, String type, String target,
108: String file, String ns, String description, URL icon,
109: List<JbiExtensionElement> elements) {
110: this .name = name;
111: this .type = type;
112: this .target = target;
113: this .file = file;
114: this .ns = ns;
115: this .icon = icon;
116: this .description = description;
117: this .elements = elements;
118: }
119:
120: /**
121: * DOCUMENT ME!
122: *
123: * @return the icon.
124: */
125: public URL getIcon() {
126: return this .icon;
127: }
128:
129: /**
130: * DOCUMENT ME!
131: *
132: * @return the description
133: */
134: public String getName() {
135: return this .name;
136: }
137:
138: /**
139: * DOCUMENT ME!
140: *
141: * @return the description
142: */
143: public String getType() {
144: return this .type;
145: }
146:
147: /**
148: * DOCUMENT ME!
149: *
150: * @return the description
151: */
152: public String getTarget() {
153: return this .target;
154: }
155:
156: /**
157: * DOCUMENT ME!
158: *
159: * @return the description
160: */
161: public String getFile() {
162: return this .file;
163: }
164:
165: /**
166: * DOCUMENT ME!
167: *
168: * @return the description
169: */
170: public String getDescription() {
171: return this .description;
172: }
173:
174: /**
175: * DOCUMENT ME!
176: *
177: * @return the extension namespaces
178: */
179: public String getNameSpace() {
180: return this .ns;
181: }
182:
183: /**
184: * DOCUMENT ME!
185: *
186: * @return the extension elements
187: */
188: public List<JbiExtensionElement> getElements() {
189: return this .elements;
190: }
191:
192: @Override
193: public String toString() {
194: StringBuilder sb = new StringBuilder();
195: sb.append("JbiExtensionInfo:").append(" name=").append(
196: getName()).append(" type=").append(getType()).append(
197: " file=").append(getFile()).append(" ns=").append(
198: getNameSpace()).append(" target=").append(getTarget())
199: .append(" icon=").append(getIcon()).append(
200: " description=").append(getDescription());
201:
202: for (JbiExtensionElement element : getElements()) {
203: sb.append(System.getProperty("line.separator")); // NOI18N
204: sb.append(element.toString());
205: }
206:
207: sb.append(System.getProperty("line.separator")); // NOI18N
208:
209: return sb.toString();
210: }
211: }
|