Class AbstractTraxSerializerFactory
- java.lang.Object
-
- org.apache.sling.rewriter.impl.components.AbstractTraxSerializerFactory
-
- All Implemented Interfaces:
SerializerFactory
- Direct Known Subclasses:
TraxHtmlSerializerFactory
,TraxXHtmlSerializerFactory
public abstract class AbstractTraxSerializerFactory extends Object implements SerializerFactory
Base class for trax based serializers.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractTraxSerializerFactory.NamespaceAsAttributes
A pipe that ensures that all namespace prefixes are also present as 'xmlns:' attributes.
-
Constructor Summary
Constructors Constructor Description AbstractTraxSerializerFactory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
activate(org.osgi.service.component.ComponentContext ctx)
Serializer
createSerializer()
Create a new serializer for the pipeline.protected void
deactivat(org.osgi.service.component.ComponentContext ctx)
protected abstract String
getDoctypePublic()
protected abstract String
getDoctypeSystem()
protected abstract String
getOutputFormat()
protected boolean
needsNamespacesAsAttributes()
Checks if the used Trax implementation correctly handles namespaces set usingstartPrefixMapping()
, but wants them also as 'xmlns:' attributes.
-
-
-
Method Detail
-
getOutputFormat
protected abstract String getOutputFormat()
-
getDoctypePublic
protected abstract String getDoctypePublic()
-
getDoctypeSystem
protected abstract String getDoctypeSystem()
-
createSerializer
public Serializer createSerializer()
Description copied from interface:SerializerFactory
Create a new serializer for the pipeline.- Specified by:
createSerializer
in interfaceSerializerFactory
- Returns:
- A new serializer.
- See Also:
SerializerFactory.createSerializer()
-
activate
protected void activate(org.osgi.service.component.ComponentContext ctx)
-
deactivat
protected void deactivat(org.osgi.service.component.ComponentContext ctx)
-
needsNamespacesAsAttributes
protected boolean needsNamespacesAsAttributes() throws Exception
Checks if the used Trax implementation correctly handles namespaces set usingstartPrefixMapping()
, 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.- Throws:
Exception
-
-