| org.apache.cocoon.transformation.AbstractTransformer org.apache.cocoon.transformation.PatternTransformer
PatternTransformer | public class PatternTransformer extends AbstractTransformer implements LogEnabled,Serviceable,Recyclable,Disposable,Parameterizable,CacheableProcessingComponent(Code) | | This transfomer transforms text pattern of a XML file into lexemes by using a lexicon file.
Input:
<section>
Text 123 bla
</section>
can be transformed into the following output:
<section>
Text
<lexeme symbol="number" text="123"/>
bla
</section>
author: Stephan Michels version: $Id: PatternTransformer.java 433543 2006-08-22 06:22:54Z crossley $ |
Inner Class :public static class LexicalAutomatonEntry implements Serializable | |
Field Summary | |
final public static String | NS Namespace for the SAX events. |
Method Summary | |
public void | characters(char[] c, int start, int len) Receive notification of character data. | public void | comment(char[] ch, int start, int len) Report an XML comment anywhere in the document. | public void | dispose() The dispose operation is called at the end of a components lifecycle. | public void | enableLogging(Logger logger) Provide component with a logger. | public void | endElement(String uri, String loc, String raw) Receive notification of the end of an element. | public Serializable | getKey() Generate the unique key. | public SourceValidity | getValidity() Generate the validity object. | public void | ignorableWhitespace(char[] c, int start, int len) Receive notification of ignorable whitespace in element content. | public void | parameterize(Parameters parameters) Provide component with parameters. | public void | processingInstruction(String target, String data) Receive notification of a processing instruction. | public void | recycle() Recycle this component. | public void | service(ServiceManager manager) Pass the ServiceManager to the Serviceable. | public void | setup(SourceResolver resolver, Map objectmodel, String src, Parameters parameters) Set the SourceResolver, objectModel Map, the source and sitemap Parameters used to process the
request. | public void | startElement(String uri, String loc, String raw, Attributes a) Receive notification of the beginning of an element.
Parameters: uri - The Namespace URI, or the empty string if the element has no Namespace URI or ifNamespace processing is not being performed. Parameters: loc - The local name (without prefix), or the empty string if Namespace processing is notbeing performed. Parameters: raw - The raw XML 1.0 name (with prefix), or the empty string if raw names are notavailable. Parameters: a - The attributes attached to the element. |
NS | final public static String NS(Code) | | Namespace for the SAX events.
|
characters | public void characters(char[] c, int start, int len) throws SAXException(Code) | | Receive notification of character data.
Parameters: c - The characters from the XML document. Parameters: start - The start position in the array. Parameters: len - The number of characters to read from the array. throws: SAXException - |
comment | public void comment(char[] ch, int start, int len) throws SAXException(Code) | | Report an XML comment anywhere in the document.
Parameters: ch - An array holding the characters in the comment. Parameters: start - The starting position in the array. Parameters: len - The number of characters to use from the array. throws: SAXException - |
dispose | public void dispose()(Code) | | The dispose operation is called at the end of a components lifecycle.
|
enableLogging | public void enableLogging(Logger logger)(Code) | | Provide component with a logger.
Parameters: logger - the logger |
endElement | public void endElement(String uri, String loc, String raw) throws SAXException(Code) | | Receive notification of the end of an element.
Parameters: uri - The Namespace URI, or the empty string if the element has no Namespace URI or ifNamespace processing is not being performed. Parameters: loc - The local name (without prefix), or the empty string if Namespace processing is notbeing performed. Parameters: raw - The raw XML 1.0 name (with prefix), or the empty string if raw names are notavailable. throws: SAXException - |
getKey | public Serializable getKey()(Code) | | Generate the unique key. This key must be unique inside the space of this component.
The generated key hashes the src |
getValidity | public SourceValidity getValidity()(Code) | | Generate the validity object.
The generated validity object or null if the component is currently notcacheable. |
ignorableWhitespace | public void ignorableWhitespace(char[] c, int start, int len) throws SAXException(Code) | | Receive notification of ignorable whitespace in element content.
Parameters: c - The characters from the XML document. Parameters: start - The start position in the array. Parameters: len - The number of characters to read from the array. throws: SAXException - |
parameterize | public void parameterize(Parameters parameters) throws ParameterException(Code) | | Provide component with parameters.
Parameters: parameters - the parameters throws: ParameterException - if parameters are invalid |
processingInstruction | public void processingInstruction(String target, String data) throws SAXException(Code) | | Receive notification of a processing instruction.
Parameters: target - The processing instruction target. Parameters: data - The processing instruction data, or null if none was supplied. throws: SAXException - |
recycle | public void recycle()(Code) | | Recycle this component. All instance variables are set to null .
|
service | public void service(ServiceManager manager)(Code) | | Pass the ServiceManager to the Serviceable. The Serviceable implementation should use the
specified ServiceManager to acquire the services it needs for execution.
Parameters: manager - The ServiceManager which this Serviceable uses. |
startElement | public void startElement(String uri, String loc, String raw, Attributes a) throws SAXException(Code) | | Receive notification of the beginning of an element.
Parameters: uri - The Namespace URI, or the empty string if the element has no Namespace URI or ifNamespace processing is not being performed. Parameters: loc - The local name (without prefix), or the empty string if Namespace processing is notbeing performed. Parameters: raw - The raw XML 1.0 name (with prefix), or the empty string if raw names are notavailable. Parameters: a - The attributes attached to the element. If there are no attributes, it shall be anempty Attributes object. throws: SAXException - |
|
|