Class POIXMLProperties.CustomProperties

  • Enclosing class:
    POIXMLProperties

    public static class POIXMLProperties.CustomProperties
    extends Object
    Custom document properties
    • Field Detail

      • FORMAT_ID

        public static final String FORMAT_ID
        Each custom property element contains an fmtid attribute with the same GUID value ({D5CDD505-2E9C-101B-9397-08002B2CF9AE}).
        See Also:
        Constant Field Values
    • Method Detail

      • getUnderlyingProperties

        public CTProperties getUnderlyingProperties()
      • addProperty

        public void addProperty​(String name,
                                String value)
        Add a new string property
        Parameters:
        name - the property name
        value - the property value
        Throws:
        IllegalArgumentException - if a property with this name already exists
      • addProperty

        public void addProperty​(String name,
                                double value)
        Add a new double property
        Parameters:
        name - the property name
        value - the property value
        Throws:
        IllegalArgumentException - if a property with this name already exists
      • addProperty

        public void addProperty​(String name,
                                int value)
        Add a new integer property
        Parameters:
        name - the property name
        value - the property value
        Throws:
        IllegalArgumentException - if a property with this name already exists
      • addProperty

        public void addProperty​(String name,
                                boolean value)
        Add a new boolean property
        Parameters:
        name - the property name
        value - the property value
        Throws:
        IllegalArgumentException - if a property with this name already exists
      • contains

        public boolean contains​(String name)
        Check if a property with this name already exists in the collection of custom properties
        Parameters:
        name - the name to check
        Returns:
        whether a property with the given name exists in the custom properties
      • getProperty

        public CTProperty getProperty​(String name)
        Retrieve the custom property with this name, or null if none exists. You will need to test the various isSetX methods to work out what the type of the property is, before fetching the appropriate value for it.
        Parameters:
        name - the name of the property to fetch
        Returns:
        the custom property with this name, or null if none exists