org.jopendocument.dom.style.data
Class DataStyle

java.lang.Object
  extended by org.jopendocument.dom.ODNode
      extended by org.jopendocument.dom.Style
          extended by org.jopendocument.dom.style.data.DataStyle
Direct Known Subclasses:
BooleanStyle, CurrencyStyle, DateStyle, NumberStyle, PercentStyle, TextStyle, TimeStyle

public abstract class DataStyle
extends Style


Nested Class Summary
static class DataStyle.DataStyleDesc<S extends DataStyle>
           
 
Field Summary
static java.util.Set<java.lang.Class<? extends DataStyle>> DATA_STYLES
           
static int DEFAULT_DECIMAL_PLACES
           
 
Method Summary
static void addStringLiteral(java.lang.StringBuilder formatSB, java.lang.String s)
           
 boolean canFormat(java.lang.Class<?> toFormat)
          Whether instances of the passed class can be formatted.
 java.lang.Object convert(java.lang.Object o)
          Convert the passed object to something that format(Object, CellStyle, boolean) can accept.
abstract  java.lang.String format(java.lang.Object o, CellStyle defaultStyle, boolean lenient)
           
 ODValueType getDataType()
           
static int getDecimalPlaces(CellStyle defaultStyle)
           
static
<S extends DataStyle>
DataStyle.DataStyleDesc<S>
getDesc(java.lang.Class<S> clazz, XMLVersion version)
           
 ODEpoch getEpoch()
           
 TextStyle.StyleTextProperties getTextProperties()
           
 java.lang.String getTitle()
           
static void registerDesc()
           
 
Methods inherited from class org.jopendocument.dom.Style
dup, equals, getFormattingProperties, getFormattingProperties, getFormattingProperties, getName, getNS, getReferencedStyle, getReferencedStyleElement, getReferences, getStyle, getStyleDesc, getStyleStyleDesc, hashCode, isReferencedAtMostOnce, isStandardStyleResolution, register, registerAllVersions, setStandardStyleResolution, warp
 
Methods inherited from class org.jopendocument.dom.ODNode
getElement, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_DECIMAL_PLACES

public static final int DEFAULT_DECIMAL_PLACES
See Also:
Constant Field Values

DATA_STYLES

public static final java.util.Set<java.lang.Class<? extends DataStyle>> DATA_STYLES
Method Detail

getDecimalPlaces

public static int getDecimalPlaces(CellStyle defaultStyle)

addStringLiteral

public static void addStringLiteral(java.lang.StringBuilder formatSB,
                                    java.lang.String s)

registerDesc

public static void registerDesc()

getDesc

public static <S extends DataStyle> DataStyle.DataStyleDesc<S> getDesc(java.lang.Class<S> clazz,
                                                                       XMLVersion version)

getDataType

public final ODValueType getDataType()

getEpoch

public final ODEpoch getEpoch()

convert

public final java.lang.Object convert(java.lang.Object o)
                               throws java.lang.NullPointerException
Convert the passed object to something that format(Object, CellStyle, boolean) can accept.

Parameters:
o - the object to convert.
Returns:
an object that can be formatted, null if o cannot be converted.
Throws:
java.lang.NullPointerException - if o is null.
See Also:
canFormat(Class)

canFormat

public final boolean canFormat(java.lang.Class<?> toFormat)
Whether instances of the passed class can be formatted.

Parameters:
toFormat - the class.
Returns:
true if instances of toFormat can be formatted.

getTitle

public final java.lang.String getTitle()

getTextProperties

public final TextStyle.StyleTextProperties getTextProperties()

format

public abstract java.lang.String format(java.lang.Object o,
                                        CellStyle defaultStyle,
                                        boolean lenient)
                                 throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException