org.jopendocument.dom
Class StyledNode<S extends Style,D extends ODDocument>

java.lang.Object
  extended by org.jopendocument.dom.ODNode
      extended by org.jopendocument.dom.StyledNode<S,D>
Type Parameters:
S - type of style.
D - type of document.
Direct Known Subclasses:
ImmutableDocStyledNode, TextNode

public abstract class StyledNode<S extends Style,D extends ODDocument>
extends ODNode

A node with a style.

Author:
Sylvain CUAZ

Constructor Summary
  StyledNode(org.jdom.Element local, Class<S> styleClass)
          Create a new instance.
protected StyledNode(org.jdom.Element local, StyleDesc<S> styleDesc)
           
 
Method Summary
abstract  D getODDocument()
           
 S getPrivateStyle()
          Assure that this node's style is only referenced by this.
 S getStyle()
           
protected  S getStyle(ODPackage pkg, org.jdom.Document doc)
           
protected  S getStyle(ODPackage pkg, org.jdom.Document doc, String styleName)
           
protected  S getStyle(String styleName)
           
 StyleDesc<S> getStyleDesc()
           
<S2 extends Style>
StyleDesc<S2>
getStyleDesc(Class<S2> clazz)
           
protected static
<S extends Style>
StyleDesc<S>
getStyleDesc(org.jdom.Element local, Class<S> styleClass)
           
protected  String getStyleName()
           
<S2 extends StyleStyle>
StyleStyleDesc<S2>
getStyleStyleDesc(Class<S2> clazz)
           
static void setStyleName(org.jdom.Element elem, String name)
           
 void setStyleName(String name)
           
 
Methods inherited from class org.jopendocument.dom.ODNode
getElement, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StyledNode

public StyledNode(org.jdom.Element local,
                  Class<S> styleClass)
Create a new instance. We used to find the Style class with reflection but this was slow.

Parameters:
local - our XML model.
styleClass - our class of style, cannot be null.

StyledNode

protected StyledNode(org.jdom.Element local,
                     StyleDesc<S> styleDesc)
Method Detail

getStyleDesc

protected static final <S extends Style> StyleDesc<S> getStyleDesc(org.jdom.Element local,
                                                                   Class<S> styleClass)

setStyleName

public static final void setStyleName(org.jdom.Element elem,
                                      String name)

getODDocument

public abstract D getODDocument()

getStyleDesc

public final StyleDesc<S> getStyleDesc()

getStyleDesc

public final <S2 extends Style> StyleDesc<S2> getStyleDesc(Class<S2> clazz)

getStyleStyleDesc

public final <S2 extends StyleStyle> StyleStyleDesc<S2> getStyleStyleDesc(Class<S2> clazz)

getStyle

public final S getStyle()

getStyle

protected final S getStyle(String styleName)

getStyle

protected final S getStyle(ODPackage pkg,
                           org.jdom.Document doc)

getStyle

protected final S getStyle(ODPackage pkg,
                           org.jdom.Document doc,
                           String styleName)

getPrivateStyle

public final S getPrivateStyle()
Assure that this node's style is only referenced by this. I.e. after this method returns the style of this node can be safely modified without affecting other nodes.

Returns:
this node's style, never null.

getStyleName

protected String getStyleName()

setStyleName

public final void setStyleName(String name)


Copyright © 2010 jOpenDocument All Rights Reserved.