01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.geronimo.gbean;
17:
18: import java.io.Serializable;
19: import java.util.Arrays;
20: import java.util.Collections;
21: import java.util.Iterator;
22: import java.util.List;
23:
24: /**
25: * @version $Rev: 564608 $ $Date: 2007-08-10 07:43:14 -0700 (Fri, 10 Aug 2007) $
26: */
27: public class GConstructorInfo implements Serializable {
28: private static final long serialVersionUID = -769958715671913257L;
29:
30: private final List attributeNames;
31:
32: public GConstructorInfo() {
33: this .attributeNames = Collections.EMPTY_LIST;
34: }
35:
36: public GConstructorInfo(String[] attributeNames) {
37: this (Arrays.asList(attributeNames));
38: }
39:
40: public GConstructorInfo(List attributeNames) {
41: this .attributeNames = Collections
42: .unmodifiableList(attributeNames);
43: }
44:
45: public List getAttributeNames() {
46: return attributeNames;
47: }
48:
49: public String toString() {
50: return "[GConstructorInfo: attributeNames=" + attributeNames
51: + "]";
52: }
53:
54: public String toXML() {
55: StringBuilder xml = new StringBuilder();
56:
57: xml.append("<gConstructorInfo>");
58: xml.append("<attributes>");
59:
60: for (Iterator loop = attributeNames.iterator(); loop.hasNext();) {
61: xml.append("<name>" + loop.next().toString() + "</name>");
62: }
63:
64: xml.append("</attributes>");
65: xml.append("</gConstructorInfo>");
66:
67: return xml.toString();
68: }
69: }
|