1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 */ 18 package org.apache.tools.ant.taskdefs.optional.jsp.compilers; 19 20 import org.apache.tools.ant.BuildException; 21 import org.apache.tools.ant.taskdefs.optional.jsp.JspC; 22 import org.apache.tools.ant.taskdefs.optional.jsp.JspMangler; 23 24 /** 25 * The interface that all jsp compiler adapters must adher to. 26 * 27 * <p>A compiler adapter is an adapter that interprets the jspc's 28 * parameters in preperation to be passed off to the compier this 29 * adapter represents. As all the necessary values are stored in the 30 * Jspc task itself, the only thing all adapters need is the jsp 31 * task, the execute command and a parameterless constructor (for 32 * reflection).</p> 33 * 34 */ 35 36 public interface JspCompilerAdapter { 37 38 /** 39 * Sets the compiler attributes, which are stored in the Jspc task. 40 * @param attributes the jsp compiler attributes 41 */ 42 void setJspc(JspC attributes); 43 44 /** 45 * Executes the task. 46 * 47 * @return has the compilation been successful 48 * @throws BuildException on error 49 */ 50 boolean execute() throws BuildException; 51 52 /** 53 * @return an instance of the mangler this compiler uses 54 */ 55 56 JspMangler createMangler(); 57 58 /** 59 * ask if compiler can sort out its own dependencies 60 * @return true if the compiler wants to do its own 61 * depends 62 */ 63 boolean implementsOwnDependencyChecking(); 64 } 65