KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > invicta > api > DefinedProperty


1 package net.sf.invicta.api;
2
3 /**
4  * A property defined for a component in its type definition.<BR>
5  * A defined property has a type, which is one of the following possible types:<BR>
6  * component, project, general, local.
7  */

8 public interface DefinedProperty {
9     /**
10      * A general property that a type uses. Instead of being hard-coded,
11      * allows run-time customization. For example: src.java.dir.
12      */

13     public static final String JavaDoc TYPE_GENERAL = "general";
14     
15     /**
16      * A property whose value may be defined by each component using the
17      * property element of a component's definition in Project Definition
18      * Files. If a default value was specified, then it is an optional
19      * property for the component; otherwise a component of this type must
20      * define a property with this name.
21      */

22     public static final String JavaDoc TYPE_COMPONENT = "component";
23     
24     /**
25      * A property whose value may be defined by a specific project using the
26      * property element of projectSettings in Project Definition Files.
27      * If a default value was specified, then it's an optional property for
28      * the project; otherwise a project that has at least one component of
29      * this type must define a property with this name.
30      */

31     public static final String JavaDoc TYPE_PROJECT = "project";
32     
33     /**
34      * A 'private' property of a type. Its actual value is used in Invicta
35      * processing time. A local property will not be defined or available
36      * for customization in ANT run-time.
37      */

38     public static final String JavaDoc TYPE_LOCAL = "local";
39     
40     /**
41      * Returns the name of the defined property.
42      * @return String. Property name. For example: src.dir
43      */

44     public String JavaDoc getName();
45     
46     /**
47      * Returns the type of the defined type.
48      * @return String. Property type. One of the following: general, component, project and local.
49      */

50     public String JavaDoc getType();
51     
52     /**
53      *
54      * @return boolean. true if this is a general property.
55      */

56     public boolean isGeneralType();
57     
58     /**
59      *
60      * @return boolean. true if this is a component property.
61      */

62     public boolean isComponentType();
63     
64     /**
65      *
66      * @return boolean. true if this is a project property.
67      */

68     public boolean isProjectType();
69     
70     /**
71      *
72      * @return boolean. true if this is a local property.
73      */

74     public boolean isLocalType();
75     
76     /**
77      * Returns the formatted value of the property, which is the result of
78      * formatting the value template if given or simply the given value if
79      * a value template was not given. If it's a component property and a
80      * value was defined in the specific component, then the specific defined
81      * value is returned (other than the default value). If it's a project or
82      * a general property, the returned value is an ANT reference to the
83      * general or the project property, for example: ${general.src.dir}
84      *
85      * @return String. Formatted value of the property.
86      */

87     public String JavaDoc getFormattedValue();
88     
89     /**
90      * Returns a reference to the value of this property. The reference is
91      * an ANT's property reference. The name of the component that has this
92      * property is added to the reference string.
93      * @return String. Reference value of the property. For example: ${sample.utils.src.dir}, while 'sample.util' is the component name and 'src.dir' is the property name.
94      */

95     public String JavaDoc getReferenceValue();
96     
97     /**
98      * Returns the unformatted value of the property, which is the the given
99      * value of the property while ignoring the value template. If it's a
100      * component property and a value was defined in the specific component,
101      * then the specific defined value is returned (other than the default
102      * value). If it's a project or a general property, the returned value
103      * is an ANT reference to the general or the project property, for
104      * example: ${general.src.dir}
105      *
106      * @return String. Unformatted value of the property.
107      */

108     public String JavaDoc getUnformattedValue();
109         
110     /**
111      * Returns the default value defined for this property.
112      * @return String. Default value of the property.
113      */

114     public String JavaDoc getDefaultValue();
115     
116     /**
117      * Returns the actual value of this property, which may either be the
118      * default value or the property or a specific value defined by a specific
119      * project or component. The value template is being ignored.
120      * @return String. Actual value of the property.
121      */

122     public String JavaDoc getActualValue();
123     
124     /**
125      * Returns the description field of the property if specified.
126      * @return String. Description of the property.
127      */

128     public String JavaDoc getDescription();
129 }
Popular Tags