1 /** 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * 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 */ 17 18 package org.apache.geronimo.gbean; 19 20 import java.io.Serializable; 21 22 23 /** 24 * @version $Rev: 564608 $ $Date: 2007-08-10 07:43:14 -0700 (Fri, 10 Aug 2007) $ 25 */ 26 public class GReferenceInfo implements Serializable { 27 private static final long serialVersionUID = 8817036672214905192L; 28 29 /** 30 * Name of this reference. 31 */ 32 private final String name; 33 34 /** 35 * Type of this reference. 36 */ 37 private final String referenceType; 38 39 /** 40 * Type of the proxy injected into the bean. 41 */ 42 private final String proxyType; 43 44 /** 45 * Name of the setter method. 46 */ 47 private final String setterName; 48 49 /** 50 * String for type component when constructing reference patterns. For jsr-77 this maps to j2eeType=nameTypeName 51 */ 52 private final String nameTypeName; 53 54 public GReferenceInfo(String name, String referenceType, String proxyType, String setterName, String nameTypeName) { 55 this.name = name; 56 this.referenceType = referenceType; 57 this.setterName = setterName; 58 this.proxyType = proxyType; 59 this.nameTypeName = nameTypeName; 60 } 61 62 public String getName() { 63 return name; 64 } 65 66 public String getReferenceType() { 67 return referenceType; 68 } 69 70 public String getProxyType() { 71 return proxyType; 72 } 73 74 public String getSetterName() { 75 return setterName; 76 } 77 78 public String getNameTypeName() { 79 return nameTypeName; 80 } 81 82 public String toString() { 83 return "[GReferenceInfo: name=" + name + 84 " referenceType=" + referenceType + 85 " proxyType=" + proxyType + 86 " setterName=" + setterName + 87 " naming system type name= " + nameTypeName + 88 "]"; 89 } 90 91 public String toXML() { 92 StringBuilder xml = new StringBuilder(); 93 94 xml.append("<gReferenceInfo "); 95 xml.append("name='" + name + "' "); 96 xml.append("referenceType='" + referenceType + "' "); 97 xml.append("proxyType='" + proxyType + "' "); 98 xml.append("setterName='" + setterName + "' "); 99 xml.append("namingSystem='" + nameTypeName + "' "); 100 xml.append("/>"); 101 102 return xml.toString(); 103 } 104 }