KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > csdl > jblanket > report > element > ParameterElement


1 package csdl.jblanket.report.element;
2
3 import java.io.PrintWriter JavaDoc;
4
5 /**
6  * Provides a wrapper for the 'Parameter' element in an XML file. An instance of a
7  * ParameterElement represents an element of a method's type signature.
8  * <p>
9  * An example of a ParameterElement is:
10  * <pre>
11  * &lt;Parameter type="java.lang.String"/&gt;
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 JavaDoc 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 JavaDoc 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 JavaDoc 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 JavaDoc toString() {
46     StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
47     buffer.append(" <Parameter type=\"" + this.type + "\"/>");
48     return buffer.toString();
49   }
50
51   /**
52    * Writes this ParameterElement to writer.
53    *
54    * @param writer points to an output file.
55    */

56   public void write(PrintWriter JavaDoc writer) {
57     writer.write(" <Parameter type=\"" + this.type + "\"/>");
58   }
59 }
Popular Tags