1 26 27 package com.bull.eclipse.jonas.utils.xml; 28 29 30 35 public class EnvEntryDesc { 36 37 40 private String name; 41 42 45 private Class type; 46 47 50 private Object value; 51 52 58 104 108 public String getName() { 109 return name; 110 } 111 112 126 public Class getType() { 127 return type; 128 } 129 130 134 public boolean hasValue() { 135 return value != null; 136 } 137 138 142 public Object getValue() { 143 if (value == null) { 144 throw new Error ("Value not set for env-entry " + name); 145 } 146 return value; 147 } 148 149 153 public String toString() { 154 StringBuffer ret = new StringBuffer (); 155 ret.append("\ngetName()=" + getName()); 156 ret.append("\ngetType()=" + getType()); 157 if (hasValue()) { 158 ret.append("\ngetValue()=" + getValue().toString()); 159 } 160 return ret.toString(); 161 } 162 163 } 164 | Popular Tags |