01: /*
02: * Copyright 2005 Joe Walker
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: package org.directwebremoting.extend;
17:
18: /**
19: * An interface to the various methods of compressing web resources.
20: * This primarily means JavaScript, but could in theory extend to other
21: * resources like CSS, HTML, etc.
22: * @author David Marginian [david at butterdev dot com]
23: * @author Joe Walker [joe at getahead dot ltd dot uk]
24: */
25: public interface Compressor {
26: /**
27: * Compress a JavaScript file to a smaller version of the original
28: * @param script The script to compress
29: * @return The compressed script
30: * @throws Exception The implementations of this interface are all likely to
31: * have different things they can throw. We are going to catch Exception
32: * anyway because we can continue (by using uncompressed scripts) so why
33: * force implementors to nest to another exception type when we can just let
34: * them use the original exception?
35: */
36: public String compressJavaScript(String script) throws Exception;
37: }
|