org.jopendocument.dom
Class StyleDesc<S extends StyleStyle>

java.lang.Object
  extended by org.jopendocument.dom.StyleDesc<S>
Type Parameters:
S - type of style

public abstract class StyleDesc<S extends StyleStyle>
extends Object

Describe a family of style.

Author:
Sylvain CUAZ

Constructor Summary
protected StyleDesc(Class<S> clazz, XMLVersion version, String family, String baseName)
           
protected StyleDesc(Class<S> clazz, XMLVersion version, String family, String baseName, String ns)
           
protected StyleDesc(Class<S> clazz, XMLVersion version, String family, String baseName, String ns, List<String> refQNames)
           
 
Method Summary
static
<C extends StyleStyle>
StyleDesc<C>
copy(StyleDesc<C> toClone, XMLVersion version)
           
abstract  S create(ODPackage pkg, org.jdom.Element e)
           
 S createAutoStyle(ODPackage pkg)
           
 S createAutoStyle(ODPackage pkg, String baseName)
          Create a new automatic style in the content of pkg.
 S findStyle(ODPackage pkg, org.jdom.Document doc, String name)
          Resolve the passed style name.
 String getBaseName()
           
 String getFamily()
           
protected  CollectionMap<String,String> getMultiRefElementsMap()
           
protected  Collection<String> getRefElements()
          The list of elements that can point to this family of style.
protected  CollectionMap<String,String> getRefElementsMap()
           
 XMLVersion getVersion()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StyleDesc

protected StyleDesc(Class<S> clazz,
                    XMLVersion version,
                    String family,
                    String baseName,
                    String ns)

StyleDesc

protected StyleDesc(Class<S> clazz,
                    XMLVersion version,
                    String family,
                    String baseName,
                    String ns,
                    List<String> refQNames)

StyleDesc

protected StyleDesc(Class<S> clazz,
                    XMLVersion version,
                    String family,
                    String baseName)
Method Detail

copy

public static <C extends StyleStyle> StyleDesc<C> copy(StyleDesc<C> toClone,
                                                       XMLVersion version)

create

public abstract S create(ODPackage pkg,
                         org.jdom.Element e)

getVersion

public final XMLVersion getVersion()

getFamily

public final String getFamily()

getBaseName

public final String getBaseName()

getRefElements

protected final Collection<String> getRefElements()
The list of elements that can point to this family of style.

Returns:
a list of qualified names, e.g. ["text:h", "text:p"].

getRefElementsMap

protected final CollectionMap<String,String> getRefElementsMap()

getMultiRefElementsMap

protected final CollectionMap<String,String> getMultiRefElementsMap()

findStyle

public final S findStyle(ODPackage pkg,
                         org.jdom.Document doc,
                         String name)
Resolve the passed style name.

Parameters:
pkg - the package of the searched for style.
doc - the document of the searched for style.
name - the name of the style.
Returns:
a corresponding StyleStyle.

createAutoStyle

public final S createAutoStyle(ODPackage pkg)

createAutoStyle

public final S createAutoStyle(ODPackage pkg,
                               String baseName)
Create a new automatic style in the content of pkg.

Parameters:
pkg - where to add the new style.
baseName - the base name for the new style, eg "ce".
Returns:
the new style, eg named "ce3".


Copyright © 2010 jOpenDocument All Rights Reserved.