01: package csdl.jblanket.report.element;
02:
03: import java.io.PrintWriter;
04:
05: /**
06: * Provides a wrapper for the 'Parameter' element in an XML file. An instance of a
07: * ParameterElement represents an element of a method's type signature.
08: * <p>
09: * An example of a ParameterElement is:
10: * <pre>
11: * <Parameter type="java.lang.String"/>
12: * </pre>
13: *
14: * @author Joy M. Agustin
15: * @version $Id: ParameterElement.java,v 1.1 2004/11/07 00:32:39 timshadel Exp $
16: */
17: public class ParameterElement {
18:
19: /** type of this parameter */
20: private String type;
21:
22: /**
23: * Constructs a new ParameterElement object.
24: *
25: * @param type the type of the parameter element to be represented.
26: */
27: public ParameterElement(String type) {
28: this .type = type;
29: }
30:
31: /**
32: * Returns the <code>type</code> of this ParameterElement.
33: *
34: * @return the <code>type</code> of this ParameterElement.
35: */
36: public String getType() {
37: return this .type;
38: }
39:
40: /**
41: * Returns a String representation of this ParameterElement as found in an aggregate XML file.
42: *
43: * @return a String representation of this ParameterElement.
44: */
45: public String toString() {
46: StringBuffer buffer = new StringBuffer();
47: buffer
48: .append(" <Parameter type=\"" + this .type
49: + "\"/>");
50: return buffer.toString();
51: }
52:
53: /**
54: * Writes this ParameterElement to writer.
55: *
56: * @param writer points to an output file.
57: */
58: public void write(PrintWriter writer) {
59: writer.write(" <Parameter type=\"" + this .type + "\"/>");
60: }
61: }
|