public class DocumentStyle extends Object
DocumentStyle contain a generic representation of the style for a document
A DocumentStyle is a map of styles identified by their name (like the class in HTML), followed by a map of couples (property, value) and the function to manipulate them.
DocumentStyle contains a set of constants representing the minimal set of styles a DocumentWriter should support.
DocumentWriter
Modifier and Type | Field and Description |
---|---|
static String |
COLOR |
static String |
FONT_SIZE |
static String |
HEIGHT |
static String |
LIST_TYPE |
static String |
TABLE_BORDER |
static String |
WIDTH |
Constructor and Description |
---|
DocumentStyle() |
Modifier and Type | Method and Description |
---|---|
void |
addProperties(Object[] properties)
Add all the properties to the style
|
void |
addProperty(String property,
Object value)
Add a property with a value to the current style
|
void |
addProperty(String style,
String property,
Object value)
Add a property with a value to the style
|
void |
addStyle(String value)
Create a new style identified by value.
The current style is set to it. |
String |
getCurrentStyle()
Return the current style
|
Map |
getPropertiesForStyle(String style)
Return all the properties for a style
|
Iterator<String> |
getPropertiesIteratorForStyle(String style)
Return an iterator over the properties for a style
|
Iterator<String> |
getStyleIterator()
Return an iterator over the styles identifiers.
|
public static final String LIST_TYPE
public static final String COLOR
public static final String WIDTH
public static final String HEIGHT
public static final String FONT_SIZE
public static final String TABLE_BORDER
public void addStyle(String value)
value
- the style's class (HTML sense)public void addProperty(String property, Object value)
property
- value
- public void addProperty(String style, String property, Object value)
style
- property
- value
- public void addProperties(Object[] properties) throws ArrayIndexOutOfBoundsException
properties
- the array, must looks like [property, value, property, value, ...]ArrayIndexOutOfBoundsException
public String getCurrentStyle()
public Iterator<String> getStyleIterator()
public Map getPropertiesForStyle(String style)
style
- the style's identifierCopyright © 2005–2020. All rights reserved.