schema2template.example.odf
Class OdfModel

java.lang.Object
  extended by schema2template.example.odf.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 Summary
OdfModel(Map<String,List<String>> nameToFamiliesMap, Map<String,schema2template.example.odf.OdfModel.AttributeDefaults> attributeDefaults)
           
 
Method Summary
 String getDefaultAttributeValue(QNamed attribute, QNamed parentelement)
          Get default value of ODF attribute, depending on the ODF element which contains this attribute.
 Set<String> getDefaultAttributeValues(QNamed attribute)
          Get default values of ODF attribute.
 SortedSet<QNamed> getStyleFamilies()
          Get all defined style family names
 List<QNamed> getStyleFamilies(QNamed element)
          Get defined style families for this ELEMENT Definition.
 boolean isStylable(QNamed element)
          Determine whether an ELEMENT is stylable (a.k.a.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.