01: // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
02: // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
03: // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
04: // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
05: // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
06: // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
07: // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
08: // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
09: // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
10: // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
11: // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
12: // POSSIBILITY OF SUCH DAMAGE.
13: //
14: // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
15: package com.metaboss.sdlctools.applications.anttasks.builder;
16:
17: import org.apache.tools.ant.types.Path;
18:
19: /** This abstract class represents the definition of the single element of the module.
20: * It is basically a definition of some submodule inside the module */
21: public abstract class ModuleElementDefinition extends
22: MetaBossBuilderTaskElement {
23: private ModuleDefinition mOwnerModule = null;
24:
25: /** The only available constructor */
26: public ModuleElementDefinition(ModuleDefinition pOwnerModule,
27: ElementMetadata pElementMetadata) {
28: super (pOwnerModule.getOwnerTask(), pElementMetadata);
29: mOwnerModule = pOwnerModule;
30: }
31:
32: /** Returns the owner of this element */
33: public final ModuleDefinition getOwnerModule() {
34: return mOwnerModule;
35: }
36:
37: /** The getter for the compile classpath. Combines own classpath with owner module
38: * classpath to give a combined classpath */
39: public Path getCompileClasspath() {
40: Path lCompileClasspath = super .getCompileClasspath();
41: Path lOwnerCompileClasspath = mOwnerModule
42: .getCompileClasspath();
43: if (lOwnerCompileClasspath == null && lCompileClasspath == null)
44: return null;
45: if (lOwnerCompileClasspath != null && lCompileClasspath == null)
46: return lOwnerCompileClasspath;
47: if (lOwnerCompileClasspath == null && lCompileClasspath != null)
48: return lCompileClasspath;
49: // Need to combine two paths
50: Path lCombinedCompileClasspath = new Path(getOwnerTask()
51: .getProject());
52: lCombinedCompileClasspath.add(lOwnerCompileClasspath);
53: lCombinedCompileClasspath.add(lCompileClasspath);
54: return lCombinedCompileClasspath;
55: }
56: }
|