| java.util.HashMap org.apache.poi.hpsf.CustomProperties
CustomProperties | public class CustomProperties extends HashMap (Code) | | Maintains the instances of
CustomProperty that belong to a
DocumentSummaryInformation . The class maintains the names of the
custom properties in a dictionary. It implements the
Map interface
and by this provides a simplified view on custom properties: A property's
name is the key that maps to a typed value. This implementation hides
property IDs from the developer and regards the property names as keys to
typed values.
While this class provides a simple API to custom properties, it ignores
the fact that not names, but IDs are the real keys to properties. Under the
hood this class maintains a 1:1 relationship between IDs and names. Therefore
you should not use this class to process property sets with several IDs
mapping to the same name or with properties without a name: the result will
contain only a subset of the original properties. If you really need to deal
such property sets, use HPSF's low-level access methods.
An application can call the
CustomProperties.isPure method to check whether a
property set parsed by
CustomProperties is still pure (i.e.
unmodified) or whether one or more properties have been dropped.
This class is not thread-safe; concurrent access to instances of this
class must be syncronized.
author: Rainer Klute author: href="mailto:klute@rainer-klute.de"><klute@rainer-klute.de> since: 2006-02-09 version: $Id$ |
Method Summary | |
public Object | get(String name) | public int | getCodepage() | Map | getDictionary() Gets the dictionary which contains IDs and names of the named custom
properties. | public boolean | isPure() | public Object | put(Object name, Object customProperty) Puts a
CustomProperty into this map. | public Object | put(String name, String value) Adds a named string property.
Parameters: name - The property's name. Parameters: value - The property's value. | public Object | put(String name, Long value) Adds a named long property.
Parameters: name - The property's name. Parameters: value - The property's value. | public Object | put(String name, Double value) Adds a named double property.
Parameters: name - The property's name. Parameters: value - The property's value. | public Object | put(String name, Integer value) Adds a named integer property.
Parameters: name - The property's name. Parameters: value - The property's value. | public Object | put(String name, Boolean value) Adds a named boolean property.
Parameters: name - The property's name. Parameters: value - The property's value. | public Object | put(String name, Date value) Adds a named date property.
Parameters: name - The property's name. Parameters: value - The property's value. | public Object | remove(String name) | public void | setCodepage(int codepage) | public void | setPure(boolean isPure) |
get | public Object get(String name)(Code) | | Gets a named value from the custom properties.
Parameters: name - the name of the value to get the value or null if a value with the specifiedname is not found in the custom properties. |
getCodepage | public int getCodepage()(Code) | | Gets the codepage.
the codepage or -1 if the codepage is undefined. |
getDictionary | Map getDictionary()(Code) | | Gets the dictionary which contains IDs and names of the named custom
properties.
the dictionary. |
isPure | public boolean isPure()(Code) | | Tells whether this
CustomProperties instance is pure or one or
more properties of the underlying low-level property set has been
dropped.
true if the CustomProperties is pure, elsefalse . |
put | public Object put(String name, String value)(Code) | | Adds a named string property.
Parameters: name - The property's name. Parameters: value - The property's value. the property that was stored under the specified name before, ornull if there was no such property before. |
put | public Object put(String name, Long value)(Code) | | Adds a named long property.
Parameters: name - The property's name. Parameters: value - The property's value. the property that was stored under the specified name before, ornull if there was no such property before. |
put | public Object put(String name, Double value)(Code) | | Adds a named double property.
Parameters: name - The property's name. Parameters: value - The property's value. the property that was stored under the specified name before, ornull if there was no such property before. |
put | public Object put(String name, Integer value)(Code) | | Adds a named integer property.
Parameters: name - The property's name. Parameters: value - The property's value. the property that was stored under the specified name before, ornull if there was no such property before. |
put | public Object put(String name, Boolean value)(Code) | | Adds a named boolean property.
Parameters: name - The property's name. Parameters: value - The property's value. the property that was stored under the specified name before, ornull if there was no such property before. |
put | public Object put(String name, Date value)(Code) | | Adds a named date property.
Parameters: name - The property's name. Parameters: value - The property's value. the property that was stored under the specified name before, ornull if there was no such property before. |
setCodepage | public void setCodepage(int codepage)(Code) | | Sets the codepage.
Parameters: codepage - the codepage |
setPure | public void setPure(boolean isPure)(Code) | | Sets the purity of the custom property set.
Parameters: isPure - the purity |
|
|