| org.apache.cocoon.components.language.markup.AbstractMarkupLanguage
All known Subclasses: org.apache.cocoon.components.language.markup.CocoonMarkupLanguage,
AbstractMarkupLanguage | abstract public class AbstractMarkupLanguage extends AbstractLogEnabled implements MarkupLanguage,Serviceable,Configurable,Recyclable,Disposable(Code) | | Base implementation of MarkupLanguage . This class uses
logicsheets as the only means of code generation. Code generation
should be decoupled from this context!!!
author: Ricardo Rocha author: Davanum Srinivas author: Ovidiu Predescu version: CVS $Id: AbstractMarkupLanguage.java 433543 2006-08-22 06:22:54Z crossley $ |
Inner Class :protected static class LanguageDescriptor | |
Inner Class :public class TransformerChainBuilderFilter extends AbstractXMLPipe | |
ATTR_INTERPOLATION | final public static String ATTR_INTERPOLATION(Code) | | Name "attr-interpolation" of boolean attribute to enable
expression interpolation in attribute values.
|
TEXT_INTERPOLATION | final public static String TEXT_INTERPOLATION(Code) | | Name "text-interpolation" of boolean attribute to enable
expression interpolation inside text nodes.
|
languages | protected Map languages(Code) | | The supported language table
|
logicsheetCache | protected Store logicsheetCache(Code) | | The code-generation logicsheet cache
|
manager | protected ServiceManager manager(Code) | | The service manager
|
AbstractMarkupLanguage | public AbstractMarkupLanguage()(Code) | | The default constructor.
|
configure | public void configure(Configuration conf) throws ConfigurationException(Code) | | Process additional configuration. Load supported programming
language definitions
Parameters: conf - The language configuration exception: ConfigurationException - If an error occurs loading logichseets |
dispose | public void dispose()(Code) | | Release all resources.
|
generateCode | public String generateCode(Source source, String filename, ProgrammingLanguage programmingLanguage) throws Exception(Code) | | Generate source code from the input document for the target
ProgrammingLanguage . After preprocessing the input
document, this method applies logicsheets in the following
order:
- User-defined logicsheets
- Namespace-mapped logicsheets
- Language-specific logicsheet
Parameters: source - The input source Parameters: filename - The input document's original filename Parameters: programmingLanguage - The target programming language The generated source code exception: Exception - If an error occurs during code generation |
getEncoding | public String getEncoding()(Code) | | Return the source document's encoding. This can be null for
the platform's default encoding. The default implementation returns
null , but derived classes may override it if encoding applies to
their concrete languages.
FIXME: There should be a way to get the
XML document's encoding as seen by the parser; unfortunately, this
information is not returned by current DOM or SAX parsers...
The document-specified encoding |
getLogicsheetFilter | protected LogicsheetFilter getLogicsheetFilter()(Code) | | Return the optional filter to prepocess logicsheets.
|
getName | public String getName()(Code) | | Return the markup language name. Two markup languages are
well-know at the moment: sitemap and xsp.
The language name. |
getPrefix | public String getPrefix()(Code) | | Returns the namespace prefix for this language.
|
getPreprocessFilter | protected AbstractXMLPipe getPreprocessFilter(String filename, AbstractXMLPipe filter, ProgrammingLanguage language)(Code) | | Prepare the input source for logicsheet processing and code
generation with a preprocess filter. The return
XMLFilter object is the first filter on the
transformer chain. The default implementation does nothing by
returning a identity filter, but derived classes should (at
least) use the passed programming language to quote
Strings
Parameters: filename - The source filename Parameters: language - The target programming language The preprocess filter |
getTransformerChainBuilder | protected TransformerChainBuilderFilter getTransformerChainBuilder(LogicsheetCodeGenerator logicsheetMarkupGenerator)(Code) | | Returns a filter that chains on the fly the requested
transformers for source code generation. This method scans the
input SAX events for built-in logicsheet declared as namespace
attribute on the root element. Derived class should overide
this method and the public inner class in order to add more
specif action and to build a more specific transformer chain.
Parameters: logicsheetMarkupGenerator - the logicsheet markup generator XMLFilter the filter that build on the fly the transformer chain |
getURI | public String getURI()(Code) | | Returns the namespace URI for this language.
|
hasAttrInterpolation | public boolean hasAttrInterpolation()(Code) | | Returns true if expansion of attribute expressions is enabled
for this language.
|
hasTextInterpolation | public boolean hasTextInterpolation()(Code) | | Returns true if expansion of expressions inside text nodes is enabled
for this language.
|
recycle | public void recycle()(Code) | | Recycle this component: clear logic sheet list and dependencies.
|
service | public void service(ServiceManager manager) throws ServiceException(Code) | | Set the global service manager.
Parameters: manager - The sitemap-specified service manager |
|
|