KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jk > ant > compilers > LinkerAdapter


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.jk.ant.compilers;
18
19 import org.apache.tools.ant.BuildException;
20 import org.apache.jk.ant.*;
21
22 import java.util.*;
23
24 /* Modeled after javac
25  */

26
27 /**
28  * s/javac/C linker/
29  *
30  * The interface that all compiler adapters must adher to.
31  *
32  * <p>A compiler adapter is an adapter that interprets the javac's
33  * parameters in preperation to be passed off to the compier this
34  * adapter represents. As all the necessary values are stored in the
35  * Javac task itself, the only thing all adapters need is the javac
36  * task, the execute command and a parameterless constructor (for
37  * reflection).</p>
38  *
39  * @author Jay Dickon Glanville <a HREF="mailto:jayglanville@home.com">jayglanville@home.com</a>
40  * @author Costin Manolache
41  */

42 public abstract class LinkerAdapter extends SoTask {
43     protected SoTask so;
44
45     /**
46      * Sets the compiler attributes, which are stored in the Javac task.
47      */

48     public void setSoTask(SoTask so ) {
49     this.so=so;
50     }
51
52     public void execute() throws BuildException {
53     findSourceFiles();
54     link(this.srcList);
55     }
56
57
58     /**
59      * Executes the task.
60      *
61      * @return has the compilation been successful
62      */

63     public abstract boolean link(Vector srcFiles) throws BuildException;
64 }
65
Popular Tags