Inspector | Message | Severity | Location |
---|---|---|---|
Java Inspector 048 | Copyrights information should be present in each file. | 1 | |
Java Inspector 085 | Do not declare runtime exceptions in the throws clause. | 2 | 53:5 |
Java Inspector 085 | Do not declare runtime exceptions in the throws clause. | 2 | 72:5 |
Java Inspector 089 | Type documentation is too short. It is only 1 words. Should be at least 3 words. | 2 | 17:1 |
Java Inspector 089 | Method is not properly documented | 2 | 25:9 |
Java Inspector 089 | Method return value is not properly documented | 2 | 25:9 |
Java Inspector 089 | Method documentation is too short. It is only 2 words. Should be at least 3 words. | 2 | 34:9 |
Java Inspector 089 | Parameter name is not documented | 2 | 34:9 |
Java Inspector 089 | Undocumented parameter property | 2 | 49:5 |
Java Inspector 089 | Javadoc contains tag for non-existent parameter name | 2 | 49:5 |
Java Inspector 089 | Undocumented method | 2 | 53:5 |
Java Inspector 089 | Undocumented method | 2 | 68:5 |
Java Inspector 089 | Undocumented method | 2 | 72:5 |
Java Inspector 026 | Avoid hardwired string literals. Allowed literals: [] | 3 | 56:50 |
Java Inspector 026 | Avoid hardwired string literals. Allowed literals: [] | 3 | 60:50 |
Java Inspector 026 | Avoid hardwired string literals. Allowed literals: [] | 3 | 74:42 |
Java Inspector 026 | Avoid hardwired string literals. Allowed literals: [] | 3 | 78:42 |
1/*
2 * Param.java
3 *
4 * Created on October 1, 2002, 11:01 AM
5 */
6
7package biz.hammurapi.ant;
8
9import org.apache.tools.ant.BuildException;
10
11/**
12 * Parameter
13 * @ant.type name="parameter" category="Common"
14 * @author Pavel Vlasov
15 * @version $Revision: 1.2 $
16 */
17public class Param extends ObjectEntry {
18
19 private String name=null;
20
21 /**
22 * @ant.ignore
23 * @return
24 */
25 public String getName() {
26 return name;
27 }
28
29 /**
30 * Parameter name.
31 * @ant.required
32 * @param name
33 */
34 public void setName(String name) {
35 this.name = name;
36 }
37
38 /**
39 * Reads value from the property.
40 */
41 private String property=null;
42
43 /**
44 * Property to get value from. Value will not be set if property is not set.
45 * Mutually exclusive with value and className
46 * @ant.not-required
47 * @param name
48 */
49 public void setProperty(String property) {
50 this.property=property;
51 }
52
53 public Object getObject(ClassLoader masterClassLoader) throws BuildException {
54 if (property!=null) {
55 if (getValue()!=null) {
56 throw new BuildException("property and value attributes are mutually exclusive");
57 }
58
59 if (getClassName()!=null) {
60 throw new BuildException("property and className attributes are mutually exclusive");
61 }
62
63 return getProject()==null ? null : getProject().getProperty(property);
64 }
65 return super.getObject(masterClassLoader);
66 }
67
68 public String getProperty() {
69 return property;
70 }
71
72 public void execute() throws BuildException {
73 if (name==null){
74 throw new BuildException("Name attribute is mandatory");
75 }
76
77 if (getValue()==null && property==null && getClassName()==null) {
78 throw new BuildException("Either value, property or className must be set");
79 }
80 }
81}
82