org.at4j.zip.ef
Class ZipEntryExtraFieldParserRegistry

java.lang.Object
  extended by org.at4j.zip.ef.ZipEntryExtraFieldParserRegistry

public class ZipEntryExtraFieldParserRegistry
extends Object

This is a registry for ZipEntryExtraFieldParser objects. The objects are accessed by the codes that identify them in the Zip file.

The registry is used by the ZipFile object when parsing the Zip file.

Since:
1.0
Author:
Karl Gustafsson

Constructor Summary
ZipEntryExtraFieldParserRegistry()
          Create the registry.
 
Method Summary
 ZipEntryExtraFieldParser forCode(UnsignedShort code)
          Get the extra field parser registered under the supplied code.
 void registerParser(ZipEntryExtraFieldParser p)
          Register a new extra field parser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipEntryExtraFieldParserRegistry

public ZipEntryExtraFieldParserRegistry()
Create the registry. By default the registry contains all factories from this package.

Method Detail

registerParser

public void registerParser(ZipEntryExtraFieldParser p)
Register a new extra field parser.

If another parser is already registered for the same extra field code, that parser is unregistered.

Parameters:
p - The parser to register.

forCode

public ZipEntryExtraFieldParser forCode(UnsignedShort code)
Get the extra field parser registered under the supplied code. If no parser is registered for that code, an UnparsedZipEntryExtraFieldParser is returned.

Parameters:
code - The code identifying the extra field in the Zip file.
Returns:
An extra field parser.