01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: package org.apache.cocoon.components.language.markup;
18:
19: import org.apache.avalon.framework.component.Component;
20: import org.apache.cocoon.components.language.programming.ProgrammingLanguage;
21: import org.apache.excalibur.source.Source;
22:
23: /**
24: * This interface defines a markup language whose SAX producer's instance are to
25: * be translated into an executable program capable or transforming the original
26: * document augmenting it with dynamic content
27: *
28: * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
29: * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
30: * @version CVS $Id: MarkupLanguage.java 433543 2006-08-22 06:22:54Z crossley $
31: */
32: public interface MarkupLanguage extends Component {
33:
34: String ROLE = MarkupLanguage.class.getName();
35:
36: /**
37: * Return the input document's encoding or <code>null</code> if it is the
38: * platform's default encoding.
39: * This method should be called after <code>generateCode<code> method.
40: *
41: * @return The input document's encoding
42: */
43: String getEncoding();
44:
45: /**
46: * Generate source code from the input source for the target
47: * <code>ProgrammingLanguage</code>.
48: *
49: * @param source The source document
50: * @param filename The input document's original filename
51: * @param programmingLanguage The target programming language
52: * @return The generated source code
53: * @exception Exception If an error occurs during code generation
54: */
55: String generateCode(Source source, String filename,
56: ProgrammingLanguage programmingLanguage) throws Exception;
57: }
|