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, java.lang.Class<S> styleClass)
          Create a new instance.
 
Method Summary
abstract  D getODDocument()
           
 S getPrivateStyle()
          Assure that this node's style is only referenced by this.
 S getStyle()
           
 void setStyleName(java.lang.String name)
           
 
Methods inherited from class org.jopendocument.dom.ODNode
getElement, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StyledNode

public StyledNode(org.jdom.Element local,
                  java.lang.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.
Method Detail

getODDocument

public abstract D getODDocument()

getStyle

public final S getStyle()

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.

setStyleName

public final void setStyleName(java.lang.String name)