KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > doclet > Property


1 /*
2  * Copyright (c) 2005, Rob Gordon.
3  */

4 package org.oddjob.doclet;
5
6 /**
7  * Encapsulate the data about a property or element that are
8  * derrived from either field or method javadoc.
9  *
10  * @author Rob Gordon.
11  */

12 public class Property {
13
14     /** The name of the property as appears in xml. */
15     private final String JavaDoc name;
16     
17     /** The descritpion. */
18     private String JavaDoc description;
19     
20     /** The required text. */
21     private String JavaDoc required;
22     
23     /**
24      * Constructor.
25      *
26      * @param name The name of the property or element.
27      */

28     public Property(String JavaDoc name) {
29         if (name == null) {
30             throw new IllegalArgumentException JavaDoc("name can never be null");
31         }
32         this.name = name;
33     }
34
35     /**
36      * Get the name of this property or element.
37      *
38      * @return The name. Never null.
39      */

40     public String JavaDoc getName() {
41         return name;
42     }
43     
44     /**
45      * Set the description.
46      *
47      * @param description The description text. May be null.
48      */

49     public void setDescription(String JavaDoc description) {
50         this.description = description;
51     }
52     
53     /**
54      * Get the description.
55      *
56      * @return The description text. May be null.
57      */

58     public String JavaDoc getDescription() {
59         return description;
60     }
61     
62     /**
63      * Set the required text.
64      *
65      * @param required The required text. May be null.
66      */

67     public void setRequired(String JavaDoc required) {
68         this.required = required;
69     }
70     
71     /**
72      * Get the required text.
73      *
74      * @return The required text. May be null.
75      */

76     public String JavaDoc getRequired() {
77         return required;
78     }
79 }
80
81
Popular Tags