org.apache.cocoon.components.language.markup
Class CocoonMarkupLanguage
java.lang.Object
|
+--org.apache.avalon.framework.logger.AbstractLoggable
|
+--org.apache.cocoon.components.language.markup.AbstractMarkupLanguage
|
+--org.apache.cocoon.components.language.markup.CocoonMarkupLanguage
- All Implemented Interfaces:
- org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.logger.Loggable, MarkupLanguage, org.apache.avalon.framework.parameters.Parameterizable, org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable
- Direct Known Subclasses:
- SitemapMarkupLanguage, XSPMarkupLanguage
- public abstract class CocoonMarkupLanguage
- extends AbstractMarkupLanguage
Base implementation of MarkupLanguage
. This class uses
logicsheets as the only means of code generation. Code generation
should be decoupled from this context!!!
- Version:
- CVS $Id: CocoonMarkupLanguage.java,v 1.4.2.1 2002/04/20 03:36:11 vgritsenko Exp $
- Author:
- Ricardo Rocha, Sebastien Sahuc, Davanum Srinivas, Ovidiu Predescu, Vadim Gritsenko
Fields inherited from interface org.apache.cocoon.components.language.markup.MarkupLanguage |
ROLE |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable |
getLogger, setLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CocoonMarkupLanguage
public CocoonMarkupLanguage()
- The default constructor.
recycle
public void recycle()
- Recycle this component: clear logic sheet list and dependencies.
- Overrides:
recycle
in class AbstractMarkupLanguage
getPreprocessFilter
protected org.xml.sax.XMLFilter getPreprocessFilter(java.lang.String filename,
ProgrammingLanguage language)
- 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 markup language preprocess filter adds information on the root element
such as creation-date, file-name and file-path, plus it use the the passed
programming language to quote Strings
on PCDATA node.
- Overrides:
getPreprocessFilter
in class AbstractMarkupLanguage
- Parameters:
filename
- The source filenamelanguage
- The target programming language- Returns:
- The preprocess filter
- See Also:
CocoonMarkupLanguage.PreProcessFilter
getTransformerChainBuilder
protected AbstractMarkupLanguage.TransformerChainBuilderFilter getTransformerChainBuilder(LogicsheetCodeGenerator logicsheetMarkupGenerator,
SourceResolver resolver)
- Returns a filter that chain on the fly the requested transformers for source
code generation. This method scans the input SAX events for
<?xml-logicsheet?> processing instructions and top-level
<prefix:logicsheet> elements. Logicsheet declarations are removed from
the input document.
- Overrides:
getTransformerChainBuilder
in class AbstractMarkupLanguage
- Parameters:
logicsheetMarkupGenerator
- the logicsheet markup generatorresolver
- the entity resolver- Returns:
- XMLFilter the filter that build on the fly the transformer chain
addLogicsheetToList
protected void addLogicsheetToList(AbstractMarkupLanguage.LanguageDescriptor language,
java.lang.String logicsheetLocation,
SourceResolver resolver)
throws java.io.IOException,
org.xml.sax.SAXException,
ProcessingException
- Description copied from class:
AbstractMarkupLanguage
- Add a logicsheet to the code generator.
- Overrides:
addLogicsheetToList
in class AbstractMarkupLanguage
- Following copied from class:
org.apache.cocoon.components.language.markup.AbstractMarkupLanguage
- Parameters:
logicsheetLocation
- Location of the logicsheet to be addeddocument
- The input document- Throws:
java.net.MalformedURLException
- If location is invalidjava.io.IOException
- IO Errororg.xml.sax.SAXException
- Logicsheet parse error
addDependency
protected void addDependency(java.lang.String location)
- Add a dependency on an external file to the document for inclusion in
generated code. This is used to populate a list of
File
's
tested for change on each invocation; this information is used to assert
whether regeneration is necessary. XSP uses <xsp:dependency>
elements for this purpose.
- Overrides:
addDependency
in class AbstractMarkupLanguage
- Parameters:
location
- The file path of the dependent file- See Also:
AbstractMarkupLanguage
, ServerPagesGenerator
and AbstractServerPage
getURI
public java.lang.String getURI()
- Returns the namespace URI for this language.
getRootElement
public abstract java.lang.String getRootElement()
- Returns the root element for this language.
Copyright � 1999-2002 Apache Software Foundation. All Rights Reserved.