Class OdfModel


  • public class OdfModel
    extends Object
    Model for ODF specific enhancements. For example, these might be style families used for ODF elements or attribute default values.
    • Constructor Detail

      • OdfModel

        public OdfModel​(Map<String,​List<String>> nameToFamiliesMap,
                        Map<String,​schema2template.example.odf.OdfModel.AttributeDefaults> attributeDefaults)
    • Method Detail

      • isStylable

        public boolean isStylable​(QNamed element)
        Determine whether an ELEMENT is stylable (a.k.a. has at least one defined style family). Note: All Definitions sharing the same name share the same style families.
        Parameters:
        element - Element
        Returns:
        whether there are style families defined for this Definition
      • getStyleFamilies

        public List<QNamed> getStyleFamilies​(QNamed element)
        Get defined style families for this ELEMENT Definition. Note: All Definitions sharing the same name share the same style families.
        Parameters:
        element - Element
        Returns:
        list of style family names
      • getStyleFamilies

        public SortedSet<QNamed> getStyleFamilies()
        Get all defined style family names
        Returns:
        SortedSet of Style Family Names
      • getDefaultAttributeValue

        public String getDefaultAttributeValue​(QNamed attribute,
                                               QNamed parentelement)
        Get default value of ODF attribute, depending on the ODF element which contains this attribute.
        Parameters:
        attribute - Attribute
        parentelement - Parent element
        Returns:
        Default value for attribute of parent
      • getDefaultAttributeValues

        public Set<String> getDefaultAttributeValues​(QNamed attribute)
        Get default values of ODF attribute.
        Parameters:
        attribute - Attribute
        Returns:
        Default values for attribute