org.jopendocument.dom.style.data
Class DataStyle
java.lang.Object
org.jopendocument.dom.ODNode
org.jopendocument.dom.Style
org.jopendocument.dom.style.data.DataStyle
- Direct Known Subclasses:
- BooleanStyle, CurrencyStyle, DateStyle, NumberStyle, PercentStyle, TextStyle, TimeStyle
public abstract class DataStyle
- extends Style
| 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 java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
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
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