Class OdfStyleBase

    • Method Detail

      • getStyleProperties

        public Map<OdfStyleProperty,​String> getStyleProperties()
        get a map containing all properties of this style and their values.
        Returns:
        map of properties. @Deprecated Broken by design as the same OdfStlyeProperty can occur multiple times and would be overwritten (e.g. background color exist 3times in cells).
      • getStylePropertiesDeep

        public Map<OdfStyleProperty,​String> getStylePropertiesDeep()
        get a map containing all properties of this style and their values. The map will also include any properties set by parent styles
        Returns:
        a map of all the properties. @Deprecated Broken by design as the same OdfStlyeProperty can occur multiple times and would be overwritten (e.g. background color exist 3times in cells).
      • getStyleUserCount

        public int getStyleUserCount()
      • getStyleUsers

        public Iterable<OdfStylableElement> getStyleUsers()
        Returns an iterator for all OdfStylableElement elements using this style.
        Returns:
        an iterator for all OdfStylableElement elements using this style
      • getFamilyName

        public String getFamilyName()
      • getPropertiesElement

        public OdfStylePropertiesBase getPropertiesElement​(OdfStylePropertiesSet set)
        Parameters:
        set -
        Returns:
        the style:*-properties element for the given set. Returns null if such element does not exist yet.
      • getOrCreatePropertiesElement

        public OdfStylePropertiesBase getOrCreatePropertiesElement​(OdfStylePropertiesSet set)
        Parameters:
        set -
        Returns:
        the style:*-properties element for the given set. If such element does not yet exist, it is created.
      • getProperty

        public String getProperty​(OdfStyleProperty prop)
        Description copied from interface: OdfStylePropertySet
        returns the given property from this styleable element or style. If it is not directly set, the value of this property from a parent style will be returned.
        Specified by:
        getProperty in interface OdfStylePropertySet
        Parameters:
        prop - is the property which value will be returned.
        Returns:
        a property value.
      • hasProperty

        public boolean hasProperty​(OdfStyleProperty prop)
        Description copied from interface: OdfStylePropertySet
        checks if this styleable element or style has this property directly set.
        Specified by:
        hasProperty in interface OdfStylePropertySet
        Parameters:
        prop - is the property to check.
        Returns:
        true if this property is directly set at this instance or false if not.
      • setProperty

        public void setProperty​(OdfStyleProperty property,
                                String value)
        Description copied from interface: OdfStylePropertySet
        sets a single style property for this element.
        Specified by:
        setProperty in interface OdfStylePropertySet
        Parameters:
        property - is the property that you want to set.
        value - is the value the property is set to.
      • compareTo

        public int compareTo​(Object obj)
        compare one style to another one. This implements a total order on style objects.
        Specified by:
        compareTo in interface Comparable
        Parameters:
        obj - - the reference object with which to compare2.
        Returns:
        0 if this object is the same as the obj argument; -1 if this object is less than the obj argument; 1 if this object is greater than the obj argument
      • equals

        public boolean equals​(Object obj)
        Indicates if some other object is equal to this one. The attribute style:name is ignored during compare2.
        Overrides:
        equals in class OdfElement
        Parameters:
        obj - - the reference object with which to compare2.
        Returns:
        true if this object is the same as the obj argument; false otherwise.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getFamily

        public OdfStyleFamily getFamily()
        Returns:
        the style family of the style or null if none existent
      • getParentStyle

        public OdfStyleBase getParentStyle()
        Returns:
        the style parent of the style or null if none existent