KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Copyright (c) 2003-2004, Inversoft, All Rights Reserved
3  */

4 package com.inversoft.savant.ant.types;
5
6
7 import java.util.List JavaDoc;
8 import java.util.Set JavaDoc;
9
10 import org.apache.tools.ant.BuildException;
11 import org.apache.tools.ant.types.DataType;
12
13 import com.inversoft.savant.Dependencies;
14 import com.inversoft.savant.SavantException;
15
16
17 /**
18  * <p>
19  * This class is the ant DataType proxy to the
20  * {@link Dependencies} class.
21  * </p>
22  *
23  * @author Brian Pontarelli
24  */

25 public class DependenciesType extends DataType {
26     private Dependencies proxy = new Dependencies();
27
28
29     /**
30      * Adds the given artifact group to the list of artifact groups in this list
31      * of dependencies.
32      *
33      * @param group The group to add
34      */

35     public void addConfiguredArtifactGroup(ArtifactGroupType group) {
36         try {
37             proxy.addArtifactGroup(group.getProxy());
38         } catch (SavantException se) {
39             throw new BuildException(se);
40         }
41     }
42
43     /**
44      * Removes the given artifact group to the list of artifact groups in this
45      * dependency.
46      *
47      * @param group The group to remove
48      */

49     public void removeArtifactGroup(ArtifactGroupType group) {
50         proxy.removeArtifactGroup(group.getProxy());
51     }
52
53     /**
54      * Adds the given artifact to the list of artifacts in this list of Dependencies.
55      *
56      * @param artifact The artifact to add
57      */

58     public void addConfiguredArtifact(ArtifactType artifact) throws SavantException {
59         try {
60             proxy.addArtifact(artifact.getProxy());
61         } catch (SavantException se) {
62             throw new BuildException(se);
63         }
64     }
65
66     /**
67      * Removes the given artifact to the list of artifact in this dependency.
68      *
69      * @param artifact The artifact to remove
70      */

71     public void removeArtifact(ArtifactType artifact) {
72         proxy.removeArtifact(artifact.getProxy());
73     }
74
75     /**
76      * Returns the artifact group list. This is list immutable.
77      */

78     public List JavaDoc getArtifactGroups() {
79         return proxy.getArtifactGroups();
80     }
81
82     /**
83      * Returns the artifact list. This List is immutable.
84      */

85     public List JavaDoc getArtifacts() {
86         return proxy.getArtifacts();
87     }
88
89     /**
90      * Returns the Set of artifacts contained here or in ArtifactGroups within.
91      */

92     public Set JavaDoc getAllArtifacts() {
93         return proxy.getAllArtifacts();
94     }
95 }
Popular Tags