org.ujac.print
Class DefaultStyleParser

java.lang.Object
  extended by org.ujac.print.DefaultStyleParser
All Implemented Interfaces:
StyleParser, TagAttributes

public class DefaultStyleParser
extends Object
implements StyleParser, TagAttributes

Name: DefaultStyleParser
Description: Default StyleParser implementation.

Author:
lauerc

Field Summary
 
Fields inherited from interface org.ujac.print.tag.TagAttributes
ATTR_A, ATTR_ALIAS, ATTR_ALIAS_ALIGNMENT, ATTR_ALIAS_CELL_ALIGNMENT, ATTR_ALLOW_ASSEMBLY, ATTR_ALLOW_COPY, ATTR_ALLOW_DEGRADED_PRINTING, ATTR_ALLOW_FILLIN, ATTR_ALLOW_MODIFY_ANNOTATIONS, ATTR_ALLOW_MODIFY_CONTENTS, ATTR_ALLOW_PRINTING, ATTR_ALLOW_SCREEN_READERS, ATTR_AUTHOR, ATTR_B, ATTR_BACKGROUND_COLOR, ATTR_BAR_COLOR, ATTR_BAR_HEIGHT, ATTR_BAR_WIDTH, ATTR_BASELINE, ATTR_BORDER_COLOR, ATTR_BORDER_STYLE, ATTR_BORDER_TYPE, ATTR_BORDER_WIDTH, ATTR_CELL_HORIZONTAL_ALIGNMENT, ATTR_CELL_VERTICAL_ALIGNMENT, ATTR_CENTER_WINDOW, ATTR_CLASS, ATTR_COLOR, ATTR_COLOR_SPACE, ATTR_COLSPAN, ATTR_COLUMNS, ATTR_CONDITION, ATTR_COUNT, ATTR_CREATION_DATE, ATTR_CREATOR, ATTR_DEFAULT_VALUE, ATTR_DESCRIPTION, ATTR_DESCRIPTION_FONT, ATTR_DESCRIPTION_PATTERN, ATTR_DESCRIPTIONS, ATTR_DIRECTION, ATTR_DISPLAY_DOC_TITLE, ATTR_DISTINCT, ATTR_DRAW_FOREGROUND, ATTR_EDITABLE, ATTR_ENCRYPTION_TYPE, ATTR_FILL, ATTR_FILL_COLOR, ATTR_FILL_ROW, ATTR_FIT_WINDOW, ATTR_FONT, ATTR_FONT_COLOR, ATTR_FONT_DEF, ATTR_FONT_ENCODING, ATTR_FONT_FAMILY, ATTR_FONT_NAME, ATTR_FONT_SIZE, ATTR_FONT_STYLE, ATTR_FORMAT, ATTR_FROM, ATTR_FULL_SCREEN, ATTR_GENERATE_CHECKSUM, ATTR_GROUP_NAME, ATTR_HEIGHT, ATTR_HIDE_MENUBAR, ATTR_HIDE_TOOLBAR, ATTR_HIDE_WINDOW_UI, ATTR_HORIZONTAL_ALIGNMENT, ATTR_ID, ATTR_INDENTATION, ATTR_INDEX, ATTR_INSTANCE, ATTR_KEEP_HEADER, ATTR_KEEP_TOGETHER, ATTR_KEYWORDS, ATTR_LEADING, ATTR_LETTERED, ATTR_LEVEL, ATTR_LEVEL_FILTER, ATTR_LINE_CAP, ATTR_LINE_JOIN, ATTR_LINE_SPACING, ATTR_LINE_WIDTH, ATTR_LIST, ATTR_LIST_ITEMSTART, ATTR_LIST_TYPE, ATTR_LOGICAL_PAGENUMBERING, ATTR_LOGICAL_PAGETEXT, ATTR_LOOP_VARIABLE, ATTR_MARGIN_BOTTOM, ATTR_MARGIN_LEFT, ATTR_MARGIN_RIGHT, ATTR_MARGIN_TOP, ATTR_NAME, ATTR_NEW_PAGE, ATTR_NO_WRAP, ATTR_NON_FULL_SCREEN_PAGE_MODE, ATTR_NUMBER, ATTR_NUMBER_DEPTH, ATTR_NUMBER_STYLE, ATTR_NUMBERED, ATTR_OPTIONAL, ATTR_OWNER_PASSWORD, ATTR_PADDING, ATTR_PADDING_BOTTOM, ATTR_PADDING_LEFT, ATTR_PADDING_RIGHT, ATTR_PADDING_TOP, ATTR_PAGE, ATTR_PAGE_LAYOUT, ATTR_PAGE_MODE, ATTR_PARENT, ATTR_PDF_VERSION, ATTR_PERCENT_FORMAT, ATTR_PHASE, ATTR_PRINT_HEADER, ATTR_RADIUS, ATTR_REFERENCE, ATTR_RENDERED, ATTR_ROTATE, ATTR_RULE_COLOR, ATTR_RULE_WIDTH, ATTR_SCALE_TO_FIT, ATTR_SEQUENCE, ATTR_SIZE, ATTR_SOURCE, ATTR_SPACING_AFTER, ATTR_SPACING_BEFORE, ATTR_SPLIT_LATE, ATTR_SPLIT_ROWS, ATTR_SPOT_COLOR, ATTR_START_STOP_TEXT, ATTR_STATUS, ATTR_STROKE_COLOR, ATTR_STYLE, ATTR_SUBJECT, ATTR_SYMBOL_INDENT, ATTR_TABLE, ATTR_TAG, ATTR_TEXT_ALIGNMENT, ATTR_TEXT_COLOR, ATTR_TEXT_RISE, ATTR_TEXTWRAP, ATTR_TITLE, ATTR_TITLE_FONT, ATTR_TO, ATTR_TOC_NUMBER, ATTR_TRIM_BODY, ATTR_TYPE, ATTR_UNDERLYING, ATTR_UNITS_OFF, ATTR_UNITS_ON, ATTR_URL, ATTR_USER_PASSWORD, ATTR_VALUE, ATTR_VALUE_FORMAT, ATTR_VALUES, ATTR_VERTICAL_ALIGNMENT, ATTR_WIDTH, ATTR_WIDTHS, ATTR_X, ATTR_X1, ATTR_X2, ATTR_X3, ATTR_X4, ATTR_Y, ATTR_Y1, ATTR_Y2, ATTR_Y3, ATTR_Y4, ATTR_ZOOM
 
Constructor Summary
DefaultStyleParser()
           
 
Method Summary
 int parseStyle(Locator locator, String styleDef, Map supportedAttributeMap, Map styleMap)
          Scans the styles from the given string.
protected  void putStyle(Map styleMap, String name, Object value)
          Adds the given style to the alo given style map.
 void setAttributeHandler(AttributeHandler attributeHandler)
          Setter method for the the property attributeHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultStyleParser

public DefaultStyleParser()
Method Detail

setAttributeHandler

public void setAttributeHandler(AttributeHandler attributeHandler)
Setter method for the the property attributeHandler.

Specified by:
setAttributeHandler in interface StyleParser
Parameters:
attributeHandler - The value to set for the property attributeHandler.

parseStyle

public int parseStyle(Locator locator,
                      String styleDef,
                      Map supportedAttributeMap,
                      Map styleMap)
               throws DocumentHandlerException
Scans the styles from the given string.

Specified by:
parseStyle in interface StyleParser
Parameters:
locator - The tag source locator.
styleDef - The style definition (eg 'background-color:#cccccc; text-align:center; font-size:12px;...')"),
supportedAttributeMap - The map of supported attributes.
styleMap - The map to fill the styles in.
Returns:
The number of detected style attributes
Throws:
DocumentHandlerException - In case the parsing failed.

putStyle

protected void putStyle(Map styleMap,
                        String name,
                        Object value)
Adds the given style to the alo given style map.

Parameters:
styleMap - The stylmap to manage.
name - The style name.
value - The style value.


Copyright © 2003-2004 UJAC.org. All Rights Reserved.