|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.util.AbstractLogEnabled org.apache.cocoon.xml.AbstractXMLProducer org.apache.cocoon.xml.AbstractXMLPipe org.apache.cocoon.serialization.AbstractSerializer org.apache.cocoon.serialization.AbstractTextSerializer
Nested Class Summary | |
static class |
AbstractTextSerializer.NamespaceAsAttributes
A pipe that ensures that all namespace prefixes are also present as 'xmlns:' attributes. |
Field Summary | |
protected Properties |
format
The Properties used by this serializer. |
Fields inherited from class org.apache.cocoon.serialization.AbstractSerializer |
output |
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
Fields inherited from interface org.apache.cocoon.serialization.Serializer |
ROLE |
Constructor Summary | |
AbstractTextSerializer()
|
Method Summary | |
void |
configure(Configuration conf)
Deprecated. use property injection instead |
protected static String |
createCachingKey(Properties format)
Create the caching key from the formating properties used by the transformer handler that is used for serialization. |
Serializable |
getKey()
Generate the unique key. |
protected SAXTransformerFactory |
getTransformerFactory()
Helper for TransformerFactory. |
protected TransformerHandler |
getTransformerHandler()
Helper for TransformerHandler. |
SourceValidity |
getValidity()
Generate the validity object. |
void |
init()
Initialize logger, caching key, transformer handler and namespace pipe |
protected boolean |
needsNamespacesAsAttributes()
Checks if the used Trax implementation correctly handles namespaces set using startPrefixMapping() , but wants them also as 'xmlns:' attributes. |
void |
recycle()
Recycle serializer by removing references |
void |
service(ServiceManager manager)
Deprecated. use property injection instead |
void |
setConsumer(org.apache.cocoon.xml.XMLConsumer consumer)
Interpose namespace pipe if needed. |
void |
setContentHandler(ContentHandler handler)
Interpose namespace pipe if needed. |
void |
setDefaultEncoding(String defaultEncoding)
Set the default encoding. |
void |
setFormat(Properties format)
Set the properties used for transformer handler used by the serializer see OutputKeys for possible settings. |
void |
setLexicalHandler(LexicalHandler handler)
Interpose namespace pipe if needed. |
void |
setTransformerFactory(String transformerFactoryClass)
Optionally set the transformer factory used for creating the transformer handler that is used for serialization. |
Methods inherited from class org.apache.cocoon.serialization.AbstractSerializer |
getMimeType, setOutputStream, shouldSetContentLength |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe |
characters, comment, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping |
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled |
getLogger, setLogger |
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 |
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping |
Methods inherited from interface org.xml.sax.ext.LexicalHandler |
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity |
Field Detail |
protected Properties format
Properties
used by this serializer.
Constructor Detail |
public AbstractTextSerializer()
Method Detail |
public void setFormat(Properties format)
OutputKeys
for possible settings.
format
- public void setDefaultEncoding(String defaultEncoding)
defaultEncoding
- public void init() throws Exception
Exception
public void setTransformerFactory(String transformerFactoryClass)
TransformerFactory
).
transformerFactoryClass
- the name of the classpublic void setConsumer(org.apache.cocoon.xml.XMLConsumer consumer)
setConsumer
in interface org.apache.cocoon.xml.XMLProducer
setConsumer
in class AbstractXMLProducer
consumer
- xml consumer, should never be null.public void setContentHandler(ContentHandler handler)
setContentHandler
in class AbstractXMLProducer
handler
- content handler, should never be null.public void setLexicalHandler(LexicalHandler handler)
setLexicalHandler
in class AbstractXMLProducer
handler
- lexical handler, should never be null.protected SAXTransformerFactory getTransformerFactory()
protected TransformerHandler getTransformerHandler() throws TransformerException
TransformerException
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)
public void configure(Configuration conf) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
public void recycle()
AbstractSerializer
recycle
in interface Recyclable
recycle
in class AbstractSerializer
Recyclable.recycle()
protected static String createCachingKey(Properties format)
format
- public Serializable getKey()
getKey
in interface org.apache.cocoon.caching.CacheableProcessingComponent
0
if the component
is currently not cacheable.public SourceValidity getValidity()
getValidity
in interface org.apache.cocoon.caching.CacheableProcessingComponent
null
if the
component is currently not cacheable.protected boolean needsNamespacesAsAttributes() throws Exception
startPrefixMapping()
, but wants them also as 'xmlns:' attributes.
The check consists in sending SAX events representing a minimal namespaced document
with namespaces defined only with calls to startPrefixMapping
(no
xmlns:xxx attributes) and check if they are present in the resulting text.
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |