FileDocCategorySizeDatePackage
SectionIDMap.javaAPI DocApache Poi 3.0.16802Mon Jan 01 12:39:34 GMT 2007org.apache.poi.hpsf.wellknown

SectionIDMap

public class SectionIDMap extends HashMap

Maps section format IDs to {@link PropertyIDMap}s. It is initialized with two well-known section format IDs: those of the \005SummaryInformation stream and the \005DocumentSummaryInformation stream.

If you have a section format ID you can use it as a key to query this map. If you get a {@link PropertyIDMap} returned your section is well-known and you can query the {@link PropertyIDMap} for PID strings. If you get back null you are on your own.

This {@link java.util.Map} expects the byte arrays of section format IDs as keys. A key maps to a {@link PropertyIDMap} describing the property IDs in sections with the specified section format ID.

author
Rainer Klute (klute@rainer-klute.de)
version
$Id: SectionIDMap.java 489730 2006-12-22 19:18:16Z bayard $
since
2002-02-09

Fields Summary
public static final byte[]
SUMMARY_INFORMATION_ID

The SummaryInformation's section's format ID.

public static final byte[]
DOCUMENT_SUMMARY_INFORMATION_ID

The DocumentSummaryInformation's first and second sections' format ID.

public static final String
UNDEFINED

A property without a known name is described by this string.

private static SectionIDMap
defaultMap

The default section ID map. It maps section format IDs to {@link PropertyIDMap}s.

Constructors Summary
Methods Summary
public org.apache.poi.hpsf.wellknown.PropertyIDMapget(byte[] sectionFormatID)

Returns the {@link PropertyIDMap} for a given section format ID.

param
sectionFormatID the section format ID
return
the property ID map

        return (PropertyIDMap) super.get(new String(sectionFormatID));
    
public java.lang.Objectget(java.lang.Object sectionFormatID)

Returns the {@link PropertyIDMap} for a given section format ID.

param
sectionFormatID A section format ID as a byte[] .
deprecated
Use {@link #get(byte[])} instead!
return
the property ID map

        return get((byte[]) sectionFormatID);
    
public static org.apache.poi.hpsf.wellknown.SectionIDMapgetInstance()

Returns the singleton instance of the default {@link SectionIDMap}.

return
The instance value




                      
       
    
        if (defaultMap == null)
        {
            final SectionIDMap m = new SectionIDMap();
            m.put(SUMMARY_INFORMATION_ID,
                  PropertyIDMap.getSummaryInformationProperties());
            m.put(DOCUMENT_SUMMARY_INFORMATION_ID[0],
                  PropertyIDMap.getDocumentSummaryInformationProperties());
            defaultMap = m;
        }
        return defaultMap;
    
public static java.lang.StringgetPIDString(byte[] sectionFormatID, long pid)

Returns the property ID string that is associated with a given property ID in a section format ID's namespace.

param
sectionFormatID Each section format ID has its own name space of property ID strings and thus must be specified.
param
pid The property ID
return
The well-known property ID string associated with the property ID pid in the name space spanned by sectionFormatID . If the pid /sectionFormatID combination is not well-known, the string "[undefined]" is returned.

        final PropertyIDMap m = getInstance().get(sectionFormatID);
        if (m == null)
            return UNDEFINED;
        else
        {
            final String s = (String) m.get(pid);
            if (s == null)
                return UNDEFINED;
            return s;
        }
    
public java.lang.Objectput(byte[] sectionFormatID, org.apache.poi.hpsf.wellknown.PropertyIDMap propertyIDMap)

Associates a section format ID with a {@link PropertyIDMap}.

param
sectionFormatID the section format ID
param
propertyIDMap the property ID map
return
as defined by {@link java.util.Map#put}

        return super.put(new String(sectionFormatID), propertyIDMap);
    
public java.lang.Objectput(java.lang.Object key, java.lang.Object value)

deprecated
Use {@link #put(byte[], PropertyIDMap)} instead!
see
#put(byte[], PropertyIDMap)
param
key This parameter remains undocumented since the method is deprecated.
param
value This parameter remains undocumented since the method is deprecated.
return
The return value remains undocumented since the method is deprecated.

        return put((byte[]) key, (PropertyIDMap) value);