org.jopendocument.dom
Class StyledNode<S extends Style,D extends ODDocument>
java.lang.Object
org.jopendocument.dom.ODNode
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
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)
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.