Package schema2template.grammar
Class OdfModel
java.lang.Object
schema2template.grammar.OdfModel
Model for ODF specific enhancements. Capsulates information from the from the config file. For
example, these might be: - style families used for ODF elements - default value attribute
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetDefaultAttributeValue
(String attributeName, String parentElementName) Get default value of ODF attribute, depending on the ODF element which contains this attribute.getDefaultAttributeValues
(String attributeName) Get default values of ODF attribute.getRepetionAttribute
(String qualifiedElementName) Some attribute represents the number of repetition of its parent element.Get all defined style family namesgetStyleFamilies
(PuzzleComponent element) Get defined style families for this ELEMENT Definition.Get the relation between @style:family value and child property elements, which is being extracted with MSV from the grammar: For instance: <style:style style:family="paragraph"> <style:paragraph-properties /> <style:text-properties /> </style:style>boolean
isRepetionAttribute
(String qualifiedAttributeName) Some attribute represents the number of repetition of its parent element.boolean
isRootOfComponent
(String qualifiedElementName) The name of all elements that are the beginning of a semantic user component, which is usually added/deleted by user aligned with the common user given name!boolean
isStylable
(PuzzleComponent element) Determine whether an ELEMENT is stylable (a.k.a. has at least one defined style family).boolean
Determines whether all subclasses of this JavaBaseClass are stylable or not stylable.
-
Constructor Details
-
OdfModel
-
-
Method Details
-
isStylable
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
- stylable element name- Returns:
- whether there are style families defined for this Definition
-
isStylable
Determines whether all subclasses of this JavaBaseClass are stylable or not stylable.- Returns:
- whether all subclasses are stylable (true) or none (false).
- Throws:
RuntimeException
- if some subclasses are stylable and some are not
-
getStyleFamilies
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
Get all defined style family names- Returns:
- SortedSet of Style Family Names
-
getDefaultAttributeValue
Get default value of ODF attribute, depending on the ODF element which contains this attribute.- Parameters:
attributeName
- Attribute's qualified nameparentElementName
- Parent element's qualified name- Returns:
- Default value for attribute of parent
-
getDefaultAttributeValues
Get default values of ODF attribute.- Parameters:
attributeName
- Attribute qualified name- Returns:
- Default values for attribute
-
getStyleFamilyPropertiesMap
Get the relation between @style:family value and child property elements, which is being extracted with MSV from the grammar: For instance: <style:style style:family="paragraph"> <style:paragraph-properties /> <style:text-properties /> </style:style>- Returns:
- the map showing the realtion between style:family attribute value as key and the style:*-properties element names as values.
-
isRootOfComponent
The name of all elements that are the beginning of a semantic user component, which is usually added/deleted by user aligned with the common user given name!- Parameters:
qualifiedElementName
- the QName of the element
-
isRepetionAttribute
Some attribute represents the number of repetition of its parent element. This method identifies those.- Parameters:
qualifiedAttributeName
- the QName of the attribute- Returns:
- true if the attribute represents the semantic of the repetition of its parent element!
-
getRepetionAttribute
Some attribute represents the number of repetition of its parent element. This method returns such an attribute for a given element.- Parameters:
qualifiedElementName
- the QName of the element- Returns:
- the attribute with the repetition function as PuzzlePiece
-