public class ZipArchiveNGSerializer extends AbstractSerializer implements Disposable, Serviceable
Modifier and Type | Field and Description |
---|---|
protected byte[] |
_buffer
Temporary byte buffer to read source data
|
protected int |
_contentDepth
Current depth of the serialized content
|
private SAXException |
_exception
Store exception
|
protected ServiceManager |
_manager
The component manager
|
private NamespaceSupport |
_nsSupport
Used to collect namespaces
|
protected SourceResolver |
_resolver
The resolver to get sources
|
protected ServiceSelector |
_selector
The serializer component selector
|
protected Serializer |
_serializer
Serializer used when in IN_CONTENT state
|
protected int |
_state
The current state
|
protected ZipArchiveOutputStream |
_zipOutput
The Zip stream where entries will be written
|
private static int |
IN_CONTENT_STATE |
private static int |
IN_ZIP_STATE |
private static int |
START_STATE |
static String |
ZIP_NAMESPACE
The namespace for elements handled by this serializer,
"http://apache.org/cocoon/zip-archive/1.0".
|
output
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
ROLE
Constructor and Description |
---|
ZipArchiveNGSerializer() |
Modifier and Type | Method and Description |
---|---|
protected void |
addEntry(Attributes atts)
Add an entry in the archive.
|
void |
characters(char[] buffer,
int offset,
int length) |
void |
dispose() |
void |
endDocument() |
void |
endElement(String namespaceURI,
String localName,
String qName) |
void |
endPrefixMapping(String prefix) |
String |
getMimeType()
Returns default mime type for zip archives,
application/zip . |
void |
recycle() |
void |
service(ServiceManager manager) |
void |
startDocument() |
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes atts) |
void |
startPrefixMapping(String prefix,
String uri)
Begin the scope of a prefix-URI Namespace mapping.
|
setOutputStream, shouldSetContentLength
comment, endCDATA, endDTD, endEntity, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDTD, startEntity
setConsumer, setContentHandler, setLexicalHandler
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity
setConsumer
public static final String ZIP_NAMESPACE
private static final int START_STATE
private static final int IN_ZIP_STATE
private static final int IN_CONTENT_STATE
protected ServiceManager _manager
protected ServiceSelector _selector
protected ZipArchiveOutputStream _zipOutput
protected int _state
protected SourceResolver _resolver
protected byte[] _buffer
protected Serializer _serializer
protected int _contentDepth
private NamespaceSupport _nsSupport
private SAXException _exception
public ZipArchiveNGSerializer()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public String getMimeType()
application/zip
. Can be overridden
in the sitemap.getMimeType
in interface SitemapOutputComponent
getMimeType
in class AbstractSerializer
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class AbstractXMLPipe
SAXException
public void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping
in interface ContentHandler
startPrefixMapping
in class AbstractXMLPipe
prefix
- The Namespace prefix being declared.uri
- The Namespace URI the prefix is mapped to.SAXException
public void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping
in interface ContentHandler
endPrefixMapping
in class AbstractXMLPipe
SAXException
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
startElement
in interface ContentHandler
startElement
in class AbstractXMLPipe
SAXException
public void characters(char[] buffer, int offset, int length) throws SAXException
characters
in interface ContentHandler
characters
in class AbstractXMLPipe
SAXException
protected void addEntry(Attributes atts) throws SAXException
atts
- the attributes that describe the entrySAXException
- if an error occurredpublic void endElement(String namespaceURI, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class AbstractXMLPipe
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
endDocument
in class AbstractXMLPipe
SAXException
public void recycle()
recycle
in interface Recyclable
recycle
in class AbstractSerializer
public void dispose()
dispose
in interface Disposable