KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > savant > ant > types > ArtifactType


1 /*
2  * Copyright (c) 2003-2004, Inversoft, All Rights Reserved
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.savant.ant.types;
8
9
10 import java.util.Date JavaDoc;
11
12 import org.apache.tools.ant.types.DataType;
13 import org.apache.tools.ant.types.Reference;
14
15 import com.inversoft.savant.Artifact;
16
17
18 /**
19  * <p>
20  * This class is a single artifact produce by some project.
21  * </p>
22  *
23  * @author Brian Pontarelli
24  */

25 public class ArtifactType extends DataType {
26
27     private Artifact proxy = new Artifact();
28
29
30     /**
31      * Returns the Artifact object that this object is a proxy to.
32      */

33     public Artifact getProxy() {
34         return proxy;
35     }
36
37     /**
38      * Copy everything from the reference into this object rather than delegate.
39      */

40     public void setRefid(Reference reference) {
41         super.setRefid(reference);
42
43         ArtifactType art = (ArtifactType) reference.getReferencedObject(getProject());
44         proxy.setGroup(art.getGroup());
45         proxy.setName(art.getName());
46         proxy.setProjectname(art.getProjectname());
47         proxy.setType(art.getType());
48         proxy.setVersion(art.getVersion());
49     }
50
51     public String JavaDoc getGroup() {
52         return proxy.getGroup();
53     }
54
55     public void setGroup(String JavaDoc group) {
56         if (isReference()) {
57             throw tooManyAttributes();
58         }
59
60         proxy.setGroup(group);
61     }
62
63     public String JavaDoc getProjectname() {
64         return proxy.getProjectname();
65     }
66
67     public void setProjectname(String JavaDoc project) {
68         if (isReference()) {
69             throw tooManyAttributes();
70         }
71
72         proxy.setProjectname(project);
73     }
74
75     public String JavaDoc getName() {
76         return proxy.getName();
77     }
78
79     public void setName(String JavaDoc name) {
80         if (isReference()) {
81             throw tooManyAttributes();
82         }
83
84         proxy.setName(name);
85     }
86
87     public String JavaDoc getVersion() {
88         return proxy.getVersion();
89     }
90
91     public void setVersion(String JavaDoc version) {
92         if (isReference()) {
93             throw tooManyAttributes();
94         }
95
96         proxy.setVersion(version);
97     }
98
99     public String JavaDoc getType() {
100         return proxy.getType();
101     }
102
103     public void setType(String JavaDoc type) {
104         if (isReference()) {
105             throw tooManyAttributes();
106         }
107
108         proxy.setType(type);
109     }
110
111     public int getExpireminutes() {
112         return proxy.getExpireminutes();
113     }
114
115     public void setExpireminutes(int expireMinutes) {
116         proxy.setExpireminutes(expireMinutes);
117     }
118
119     public Date JavaDoc getExpiretime() {
120         return proxy.getExpiretime();
121     }
122
123     public void setExpiretime(Date JavaDoc expireTime) {
124         proxy.setExpiretime(expireTime);
125     }
126 }
Popular Tags