|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.xml.AbstractXMLProducer org.apache.cocoon.xml.AbstractXMLPipe org.apache.cocoon.transformation.AbstractTransformer org.apache.cocoon.transformation.PatternTransformer
public class PatternTransformer
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>
Nested Class Summary | |
---|---|
static class |
PatternTransformer.LexicalAutomatonEntry
This class represent a entry in a store to cache the lexical automaton. |
Field Summary | |
---|---|
static String |
NS
Namespace for the SAX events. |
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
Fields inherited from interface org.apache.cocoon.transformation.Transformer |
---|
ROLE |
Constructor Summary | |
---|---|
PatternTransformer()
|
Method Summary | |
---|---|
void |
characters(char[] c,
int start,
int len)
Receive notification of character data. |
void |
comment(char[] ch,
int start,
int len)
Report an XML comment anywhere in the document. |
void |
dispose()
The dispose operation is called at the end of a components lifecycle. |
void |
enableLogging(Logger logger)
Provide component with a logger. |
void |
endElement(String uri,
String loc,
String raw)
Receive notification of the end of an element. |
Serializable |
getKey()
Generate the unique key. |
SourceValidity |
getValidity()
Generate the validity object. |
void |
ignorableWhitespace(char[] c,
int start,
int len)
Receive notification of ignorable whitespace in element content. |
void |
parameterize(Parameters parameters)
Provide component with parameters. |
void |
processingInstruction(String target,
String data)
Receive notification of a processing instruction. |
void |
recycle()
Recycle this component. |
void |
service(ServiceManager manager)
Pass the ServiceManager to the Serviceable. |
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. |
void |
startElement(String uri,
String loc,
String raw,
Attributes a)
Receive notification of the beginning of an element. |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe |
---|
endCDATA, endDocument, endDTD, endEntity, endPrefixMapping, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
setConsumer, setContentHandler, setLexicalHandler |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xml.sax.ContentHandler |
---|
endDocument, endPrefixMapping, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping |
Methods inherited from interface org.xml.sax.ext.LexicalHandler |
---|
endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity |
Methods inherited from interface org.apache.cocoon.xml.XMLProducer |
---|
setConsumer |
Field Detail |
---|
public static final String NS
Constructor Detail |
---|
public PatternTransformer()
Method Detail |
---|
public void enableLogging(Logger logger)
enableLogging
in interface LogEnabled
enableLogging
in class AbstractLogEnabled
logger
- the loggerpublic void service(ServiceManager manager)
service
in interface Serviceable
manager
- The ServiceManager which this Serviceable uses.public void parameterize(Parameters parameters) throws ParameterException
parameterize
in interface Parameterizable
parameters
- the parameters
ParameterException
- if parameters are invalidpublic void setup(SourceResolver resolver, Map objectmodel, String src, Parameters parameters) throws ProcessingException, SAXException, IOException
setup
in interface SitemapModelComponent
resolver
- Source resolverobjectmodel
- Object modelsrc
- Sourceparameters
- Parameters
IOException
ProcessingException
SAXException
public Serializable getKey()
getKey
in interface CacheableProcessingComponent
public SourceValidity getValidity()
getValidity
in interface CacheableProcessingComponent
null
if the component is currently not
cacheable.public void recycle()
null
.
recycle
in interface Recyclable
recycle
in class AbstractXMLProducer
public void dispose()
dispose
in interface Disposable
public void startElement(String uri, String loc, String raw, Attributes a) throws SAXException
startElement
in interface ContentHandler
startElement
in class AbstractXMLPipe
uri
- The Namespace URI, or the empty string if the element has no Namespace URI or if
Namespace processing is not being performed.loc
- The local name (without prefix), or the empty string if Namespace processing is not
being performed.raw
- The raw XML 1.0 name (with prefix), or the empty string if raw names are not
available.a
- The attributes attached to the element. If there are no attributes, it shall be an
empty Attributes object.
SAXException
public void endElement(String uri, String loc, String raw) throws SAXException
endElement
in interface ContentHandler
endElement
in class AbstractXMLPipe
uri
- The Namespace URI, or the empty string if the element has no Namespace URI or if
Namespace processing is not being performed.loc
- The local name (without prefix), or the empty string if Namespace processing is not
being performed.raw
- The raw XML 1.0 name (with prefix), or the empty string if raw names are not
available.
SAXException
public void characters(char[] c, int start, int len) throws SAXException
characters
in interface ContentHandler
characters
in class AbstractXMLPipe
c
- The characters from the XML document.start
- The start position in the array.len
- The number of characters to read from the array.
SAXException
public void ignorableWhitespace(char[] c, int start, int len) throws SAXException
ignorableWhitespace
in interface ContentHandler
ignorableWhitespace
in class AbstractXMLPipe
c
- The characters from the XML document.start
- The start position in the array.len
- The number of characters to read from the array.
SAXException
public void processingInstruction(String target, String data) throws SAXException
processingInstruction
in interface ContentHandler
processingInstruction
in class AbstractXMLPipe
target
- The processing instruction target.data
- The processing instruction data, or null if none was supplied.
SAXException
public void comment(char[] ch, int start, int len) throws SAXException
comment
in interface LexicalHandler
comment
in class AbstractXMLPipe
ch
- An array holding the characters in the comment.start
- The starting position in the array.len
- The number of characters to use from the array.
SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |