1 27 package org.objectweb.jonas_ws.deployment.xml; 28 29 import org.objectweb.jonas_lib.deployment.xml.AbsElement; 30 35 36 public class VariableMapping extends AbsElement { 37 38 41 private String javaVariableName = null; 42 43 46 private boolean dataMember = false; 47 48 51 private String xmlElementName = null; 52 53 54 57 public VariableMapping() { 58 super(); 59 } 60 61 65 public String getJavaVariableName() { 66 return javaVariableName; 67 } 68 69 73 public void setJavaVariableName(String javaVariableName) { 74 this.javaVariableName = javaVariableName; 75 } 76 77 81 public boolean isDataMember() { 82 return dataMember; 83 } 84 85 88 public void setDataMember() { 89 this.dataMember = true; 90 } 91 92 96 public String getXmlElementName() { 97 return xmlElementName; 98 } 99 100 104 public void setXmlElementName(String xmlElementName) { 105 this.xmlElementName = xmlElementName; 106 } 107 108 113 public String toXML(int indent) { 114 StringBuffer sb = new StringBuffer (); 115 sb.append(indent(indent)); 116 sb.append("<variable-mapping>\n"); 117 118 indent += 2; 119 120 sb.append(xmlElement(javaVariableName, "java-variable-name", indent)); 122 if (dataMember) { 124 sb.append(indent(indent)); 125 sb.append("<data-member/>"); 126 } 127 sb.append(xmlElement(xmlElementName, "xml-element-name", indent)); 129 indent -= 2; 130 sb.append(indent(indent)); 131 sb.append("</variable-mapping>\n"); 132 133 return sb.toString(); 134 } 135 } 136 | Popular Tags |