|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ujac.print.BaseDocumentTag
public abstract class BaseDocumentTag
Name: BaseDocumentTag
Description: Base implementation for tags, processed by the DocumentHandler class.
Field Summary | |
---|---|
protected String |
actualContent
The item's actual content, used for debugging issues. |
protected Attributes |
attributes
The item's attributes. |
protected Condition |
condition
The condition. |
protected StringBuffer |
content
The item's content. |
protected Map |
customAttributes
The item's custom attributes. |
static DocumentFont |
DEFAULT_FONT
The default font. |
static Color |
DEFAULT_FONT_COLOR
The default font color. |
static String |
DEFAULT_FONT_ENCODING
The default font encoding. |
static String |
DEFAULT_FONT_FAMILY
The default font family. |
static float |
DEFAULT_FONT_SIZE
The default font size. |
static int |
DEFAULT_FONT_STYLE
The default font style. |
static float |
DEFAULT_LEADING
The default fixed vertical leading distance. |
static float |
DEFAULT_LINE_SPACING
The factor by which to multiply the font size to get the default leading. |
protected int |
depth
The item's depth in the document tree. |
protected DocumentHandler |
documentHandler
The document handler. |
static String |
IMAGE_CHUNK_ATTR
The IMAGE chunk attribute. |
protected org.apache.commons.logging.Log |
log
The logger. |
static String |
NUMBER_OF_PAGES_TEMPLATES
The resource name of the number of pages template. |
protected BaseDocumentTag |
parentItem
The parent item. |
protected BaseDocumentTag |
previousItem
The previous item. |
protected StyleHolder |
styleParent
The parent style holder. |
protected AttributeDefinitionMap |
supportedAttributeMap
The supported attribute map. |
protected ChildDefinitionMap |
supportedChildMap
The supported child map. |
protected AttributeDefinitionMap |
supportedStyleAttributeMap
The supported attribute map. |
protected DocumentTagFactory |
tagFactory
The tag factory. |
Constructor Summary | |
---|---|
BaseDocumentTag()
Constructs a BaseDocumentTag instance with no specific attributes. |
|
BaseDocumentTag(String name)
Constructs a BaseDocumentTag instance with specific attributes. |
Method Summary | |
---|---|
protected void |
addAttributeDefinition(AttributeDefinition definition)
Adds the given attribute definition to the set of supported attributes. |
com.lowagie.text.Phrase |
addChunk(BaseDocumentTag tag,
com.lowagie.text.Phrase phrase,
String chunk,
DocumentFont font,
float fixedLeading,
float lineSpacing)
Adds the given chunk to the root phrase. |
com.lowagie.text.Phrase |
addChunk(com.lowagie.text.Phrase phrase,
com.lowagie.text.Chunk chunk,
float fixedLeading,
float lineSpacing)
Adds the given chunk to the root phrase. |
com.lowagie.text.Phrase |
addChunk(com.lowagie.text.Phrase phrase,
float fixedLeading,
float lineSpacing)
Adds the current content to the given root phrase while taking care of ${pageCount} expressions. |
void |
addContent(char[] content,
int offset,
int length)
Adds the specified subset of the given character array to the content buffer. |
void |
addContent(String content)
Adds the given String to the content buffer. |
protected void |
addStyleAttributeDefinition(AttributeDefinition definition)
Adds the given attribute definition to the set of supported attributes. |
protected void |
addToLatestCellContainer(com.lowagie.text.Cell cell)
Adds the cell at the latest parent item. |
protected void |
addToLatestElementContainer(com.lowagie.text.Element element)
Adds the element at the latest parent item. |
protected void |
addToLatestPdfCellContainer(com.lowagie.text.pdf.PdfPCell cell)
Adds the cell at the latest parent item. |
protected AttributeDefinitionMap |
buildSupportedAttributes()
Builds the map of supported attributes. |
protected ChildDefinitionMap |
buildSupportedChilds()
Builds the map of supported child definitions. |
protected AttributeDefinitionMap |
buildSupportedStyleAttributes()
Builds the map of supported style attributes. |
protected void |
checkAttributes()
Checks for unsupported attributes. |
void |
closeItem()
Closes the item. |
protected Color |
colorFromString(String attrName,
Object color,
boolean evaluate)
Gets the color from the given String. |
protected com.lowagie.text.Chunk |
createChunk(String text,
DocumentFont font)
Creates a new chunk. |
protected DocumentFont |
createFont(String family,
String encoding,
float size,
int style,
float textRise,
Color color)
Creates the item's font according to the item's attributes. |
protected com.lowagie.text.pdf.PdfTemplate |
ensureNumberOfPagesTemplate(DocumentFont font,
com.lowagie.text.pdf.PdfContentByte cb)
Ensures the 'number of pages' template for the given font. |
Object |
evalAttribute(AttributeDefinition attrDef)
Gets the value for the given attribute definition. |
Object |
evalAttribute(String name)
Gets the value for the given attribute's name. |
protected void |
extendLeading(com.lowagie.text.Phrase phrase,
com.lowagie.text.Chunk extender,
float fixedLeading,
float lineSpacing)
Extends the leading of the given phrase. |
protected void |
extendLeading(com.lowagie.text.Phrase phrase,
float leading)
Extends the leading of the given phrase. |
protected void |
extendLeading(com.lowagie.text.Phrase phrase,
com.lowagie.text.Font font,
float fixedLeading,
float lineSpacing)
Extends the leading of the given phrase. |
protected void |
extendLeading(com.lowagie.text.Phrase phrase,
com.lowagie.text.Phrase extender)
Extends the leading of the given phrase. |
protected void |
filterContents(BaseDocumentTag tag,
String contents,
StringBuffer buffer,
boolean trimHead)
Processes the escape sequences from the given content string and writes the result into the given buffer. |
void |
flushContent()
Flushes the content buffer. |
String |
getActualContent()
Gets the actual content. |
Object |
getAttribute(AttributeDefinition attrDef,
boolean evaluate,
AttributeDefinition styleAttrDef,
TypedAttributeHandler attrHandler)
Gets the value for the given attribute's name. |
Object |
getAttribute(AttributeDefinition attrDef,
Object defaultValue,
boolean evaluate,
AttributeDefinition styleAttrDef,
TypedAttributeHandler attrHandler)
Gets the value for the given attribute's name. |
AttributeDefinition |
getAttributeDefinition(String name)
Gets the attribute definition for the given name |
AttributeHandler |
getAttributeHandler()
Getter method for the the property attributeHandler. |
Attributes |
getAttributes()
Gets the item's attributes. |
Color |
getBackgroundColor()
Getter method for the the property backgroundColor. |
boolean |
getBooleanAttribute(AttributeDefinition attrDef,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the boolean value for the given attribute's name. |
boolean |
getBooleanAttribute(AttributeDefinition attrDef,
boolean defaultValue,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the boolean value for the given attribute's name. |
int |
getBorderAttribute(AttributeDefinition attrDef,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the border value for the given attribute's name. |
int |
getBorderAttribute(AttributeDefinition attrDef,
int defaultValue,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the border value for the given attribute's name. |
Color |
getColorAttribute(AttributeDefinition attrDef,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the color value for the given attribute's name. |
Color |
getColorAttribute(AttributeDefinition attrDef,
Color defaultValue,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the color value for the given attribute's name. |
CommonAttributesHolder |
getCommonAttributesHolder()
Gets the element container. |
String |
getContent()
Gets the current content. |
Map |
getCustomAttributes()
Gets the item's custom attributes. |
int |
getDepth()
Gets the item's depth in the document tree. |
abstract String |
getDescription()
Gets a description for the item. |
float |
getDimensionAttribute(AttributeDefinition attrDef,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the dimension value for the given attribute's name. |
float |
getDimensionAttribute(AttributeDefinition attrDef,
float defaultValue,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the dimension value for the given attribute's name. |
float |
getDimensionAttribute(AttributeDefinition attrDef,
Float defaultValue,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the dimension value for the given attribute's name. |
DocumentHandler |
getDocumentHandler()
Gets the document handler. |
String |
getExamples()
Gets examples for the item. |
float |
getFloatAttribute(AttributeDefinition attrDef,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the float value for the given attribute's name. |
float |
getFloatAttribute(AttributeDefinition attrDef,
float defaultValue,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the float value for the given attribute's name. |
DocumentFont |
getFont()
Gets the font from the surrounding FontHolder tag. |
int |
getHorizontalAlignmentAttribute(AttributeDefinition attrDef,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the horizontal alignment value for the given attribute's name. |
int |
getHorizontalAlignmentAttribute(AttributeDefinition attrDef,
int defaultValue,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the horizontal alignment value for the given attribute's name. |
int |
getIntegerAttribute(AttributeDefinition attrDef,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the integer value for the given attribute's name. |
int |
getIntegerAttribute(AttributeDefinition attrDef,
int defaultValue,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the integer value for the given attribute's name. |
Object |
getLocalAttribute(String name,
boolean evaluate)
Gets the local value for the given attribute's name. |
DocumentFont |
getLocalFont()
Gets the locally defined font. |
Object |
getLocalStyleAttribute(String name)
Gets the style attribute with the given name. |
String |
getName()
Gets the item's name. |
BaseDocumentTag |
getParentItem()
Gets the parent item. |
protected String |
getPhraseContent(com.lowagie.text.Phrase item)
Gets the content of the given phrase. |
protected float |
getPhraseHeight(com.lowagie.text.Phrase item)
Gets the height of the given phrase. |
protected float |
getPhraseWidth(com.lowagie.text.Phrase item)
Gets the width of the given phrase. |
BaseDocumentTag |
getPreviousItem()
Gets the previous item. |
String |
getRawAttribute(String name)
Gets the raw value for the given attribute's name. |
List |
getSortedAttributeDefinitions()
Gets the sorted list of supported attributes. |
List |
getSortedStyleAttributeDefinitions()
Gets the sorted list of supported style attributes. |
String |
getStringAttribute(AttributeDefinition attrDef,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the value for the given attribute's name. |
String |
getStringAttribute(AttributeDefinition attrDef,
String defaultValue,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the value for the given attribute's name. |
String |
getStringAttribute(String attrName,
String defaultValue,
boolean evaluate,
String styleAttrName)
Gets the value for the given attribute's name. |
String |
getStyle()
Gets the inline style attributes. |
Object |
getStyleAttribute(AttributeDefinition styleAttrDef)
Gets the style attribute with the given name. |
Object |
getStyleAttribute(String name)
Gets the style attribute with the given name. |
AttributeDefinition |
getStyleAttributeDefinition(String name)
Gets the attribute definition for the given name |
Map |
getStyleAttributes()
Gets the style attribute with the given name. |
String |
getStyleClass()
Gets the style class. |
AttributeDefinitionMap |
getSupportedAttributes()
Gets the map of supported attributes. |
ChildDefinitionMap |
getSupportedChilds()
Gets the list of supported childs. |
List |
getSupportedChildTags()
Finds the supported child tags from the DocumentTagFactory using the informations from the methods getSupportedChilds and getExcludedChilds. |
AttributeDefinitionMap |
getSupportedStyleAttributes()
Gets the map of supported style attributes. |
DocumentTagFactory |
getTagFactory()
Gets the document tag factory. |
String |
getTextAttribute(AttributeDefinition attrDef,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the value for the given attribute's name. |
String |
getTextAttribute(AttributeDefinition attrDef,
String defaultValue,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the value for the given attribute's name. |
String |
getTrimmedContent()
Gets the trimmed content. |
int |
getVerticalAlignmentAttribute(AttributeDefinition attrDef,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the vertical alignment value for the given attribute's name. |
int |
getVerticalAlignmentAttribute(AttributeDefinition attrDef,
int defaultValue,
boolean evaluate,
AttributeDefinition styleAttrDef)
Gets the vertical alignment value for the given attribute's name. |
void |
handleContent(PhraseHolder phraseHolder)
Adds the current content to the given PhraseHolder while taking care of ${pageCount} expressions. |
protected void |
handleFontAttributes()
Handles the font attributes. |
boolean |
hasContent()
Gets the current content. |
void |
initialize()
Initializes the item. |
protected String |
int2FontStyle(int fontStyle)
Gets the font style from the given integer. |
boolean |
isAttributeDefined(AttributeDefinition attrDef)
Checks whether the given attribute is defined or not. |
boolean |
isAttributeDefined(AttributeDefinition attrDef,
AttributeDefinition styleAttrDef)
Checks whether the given attribute is defined or not. |
boolean |
isAttributeDefined(String name)
Checks whether the given attribute is defined or not. |
boolean |
isAttributeDefined(String name,
String styleName)
Checks whether the given attribute is defined or not. |
boolean |
isAttributeSupported(AttributeDefinition attrDef)
Checks, if the given attribute is supported. |
boolean |
isAttributeSupported(AttributeDefinition attrDef,
AttributeDefinition styleAttrDef)
Checks, if the given attribute or style attribute is supported. |
boolean |
isAttributeSupported(String name)
Checks, if the given attribute is supported. |
boolean |
isAttributeSupported(String name,
String styleName)
Checks, if the given attribute or style attribute is supported. |
boolean |
isDocumentRoot()
Is the item a possible document root tag, such as <document> or <module>. |
protected boolean |
isEmptyContent()
Checks if the content contains no or no real data. |
protected boolean |
isEmptyString(String text)
Checks if the given string contains no or no real data. |
protected boolean |
isIgnoreFlush()
Gets the ignore flush flag. |
boolean |
isItemClosed()
Gets the item closed flag. |
boolean |
isItemOpened()
Gets the item opened flag. |
protected boolean |
isPhraseEmpty(com.lowagie.text.Phrase phrase)
Tells whether the given phrase is empty or not. |
protected boolean |
isRendered()
Tells whether or not this tag is rendered. |
boolean |
isStructureChecksDisabled()
Tells whether or not to disable checks which test if this tag fits into its parent tag. |
boolean |
isStyleable()
Tells whether or not this tag does respect style attributes or not. |
boolean |
isStyleAttributeDefined(String name)
Checks whether the given attribute is defined or not. |
boolean |
isTextBodyAllowed()
Tells whether textual content is allowed for the tag or not. |
boolean |
isTrimBody()
Getter method for the the property trimBody. |
boolean |
isTrimNextHead()
Gets the 'trim next head' flag. |
protected boolean |
isValid()
Checks whether the condition is valid or not. |
boolean |
isVirtualContainer()
Is the item virtual container, such as <if>, <else> or <foreach>. |
Locator |
locator()
Gets the document locator, which describes the position of this item. |
void |
openItem()
Opens the item. |
void |
preInitialize()
Pre-initializes the item. |
protected void |
printPhrase(com.lowagie.text.pdf.PdfTemplate template,
com.lowagie.text.Phrase phrase,
float xPos,
float yPos)
Prints a phrase into the given template. |
com.lowagie.text.Phrase |
processContents(BaseDocumentTag tag,
com.lowagie.text.Phrase phrase,
String contents,
DocumentFont font,
float fixedLeading,
float lineSpacing)
Processes the given contents an adds the computed elements to the given phrase. |
com.lowagie.text.Phrase |
processContents(float fixedLeading,
float lineSpacing)
Creates a chunk for the current content. |
void |
resetContent()
Clears the current content. |
protected com.lowagie.text.Phrase |
rotatePhrase(com.lowagie.text.Phrase phrase,
float rotate)
Rotates the given phrase. |
protected void |
setAttributes(Attributes attributes)
Sets the item's attributes. |
protected void |
setBackgroundColor(Color backgroundColor)
Setter method for the the property backgroundColor. |
void |
setCustomAttributes(Map customAttributes)
Sets the item's custom attributes. |
protected void |
setDepth(int depth)
Sets the item's depht in the document tree. |
protected void |
setDocumentHandler(DocumentHandler documentHandler)
Sets the document handler. |
void |
setItemClosed(boolean itemClosed)
Sets the item closed flag. |
void |
setItemOpened(boolean itemOpened)
Sets the item opened flag. |
protected void |
setLocalFont(DocumentFont localFont)
Sets the local font. |
protected void |
setLocalFont(String fontDef)
Sets the local font. |
protected void |
setName(String name)
Sets the item's name. |
void |
setParentItem(BaseDocumentTag item)
Sets the parent item. |
protected void |
setPreviousItem(BaseDocumentTag item)
Sets the previous item. |
protected void |
setTagFactory(DocumentTagFactory tagFactory)
Sets the document tag factory. |
void |
setTrimBody(boolean trimBody)
Setter method for the the property trimBody. |
void |
setTrimNextHead(boolean trimNextHead)
Sets the 'trim next head' flag in dependency of the 'trim body' flag. |
protected void |
trimContentHead()
Trims off the heading white spaces of the content buffer. |
protected void |
trimContentTail()
Trims off the trailing white spaces of the content buffer. |
protected Object |
typeCastValue(String text,
String type)
Gets a well typed value for the given one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String IMAGE_CHUNK_ATTR
public static final String NUMBER_OF_PAGES_TEMPLATES
public static final String DEFAULT_FONT_FAMILY
public static final String DEFAULT_FONT_ENCODING
public static final float DEFAULT_FONT_SIZE
public static final Color DEFAULT_FONT_COLOR
public static final int DEFAULT_FONT_STYLE
public static DocumentFont DEFAULT_FONT
public static final float DEFAULT_LEADING
public static final float DEFAULT_LINE_SPACING
protected org.apache.commons.logging.Log log
protected DocumentHandler documentHandler
protected DocumentTagFactory tagFactory
protected int depth
protected AttributeDefinitionMap supportedAttributeMap
protected AttributeDefinitionMap supportedStyleAttributeMap
protected ChildDefinitionMap supportedChildMap
protected Attributes attributes
protected Map customAttributes
protected String actualContent
protected StringBuffer content
protected BaseDocumentTag parentItem
protected BaseDocumentTag previousItem
protected Condition condition
protected StyleHolder styleParent
Constructor Detail |
---|
public BaseDocumentTag()
public BaseDocumentTag(String name)
name
- The tag name.Method Detail |
---|
public String getName()
protected void setName(String name)
name
- The name to set.public abstract String getDescription()
public String getExamples()
public AttributeDefinitionMap getSupportedAttributes()
public AttributeDefinitionMap getSupportedStyleAttributes()
public ChildDefinitionMap getSupportedChilds()
protected AttributeDefinitionMap buildSupportedAttributes()
protected AttributeDefinitionMap buildSupportedStyleAttributes()
protected ChildDefinitionMap buildSupportedChilds()
public List getSortedAttributeDefinitions()
public List getSortedStyleAttributeDefinitions()
public boolean isVirtualContainer()
public boolean isDocumentRoot()
public boolean isTextBodyAllowed()
public boolean isStructureChecksDisabled()
public List getSupportedChildTags() throws TagInstantiationException
TagInstantiationException
- In case the method DocumentTagFactory.getAllPossibleChilds
failed.public DocumentHandler getDocumentHandler()
protected void setDocumentHandler(DocumentHandler documentHandler)
documentHandler
- The document handler to set.public DocumentTagFactory getTagFactory()
protected void setTagFactory(DocumentTagFactory tagFactory)
tagFactory
- The document tag factory to set.public int getDepth()
protected void setDepth(int depth)
depth
- The depth to set.public Attributes getAttributes()
protected void setAttributes(Attributes attributes)
attributes
- The attributes to set.public Map getCustomAttributes()
public void setCustomAttributes(Map customAttributes)
customAttributes
- The custom attributes to set.public BaseDocumentTag getParentItem()
public void setParentItem(BaseDocumentTag item)
item
- The parent item to set.public BaseDocumentTag getPreviousItem()
protected void setPreviousItem(BaseDocumentTag item)
item
- The previous item to set.public void setItemOpened(boolean itemOpened)
itemOpened
- The item opened flag to set.public boolean isItemOpened()
public boolean isTrimBody()
public void setTrimBody(boolean trimBody)
trimBody
- The value to set for the property trimBody.public void setTrimNextHead(boolean trimNextHead)
trimNextHead
- The 'trim next head' flag to set.public boolean isTrimNextHead()
public void setItemClosed(boolean itemClosed)
itemClosed
- The item closed flag to set.public boolean isItemClosed()
public Locator locator()
public void preInitialize() throws DocumentHandlerException
DocumentHandlerException
- If something went badly wrong.public void initialize() throws DocumentHandlerException
DocumentHandlerException
- If something went badly wrong.protected void checkAttributes() throws TagAttributeException
TagAttributeException
- If an unsupported attribute was detected.public void resetContent()
public void addContent(char[] content, int offset, int length)
content
- The given content.offset
- The offset from which to add the content.length
- The number of characters to copy.public void addContent(String content)
content
- The content to add.public boolean hasContent()
public String getContent()
public String getActualContent()
public String getTrimmedContent()
public void flushContent() throws DocumentHandlerException
DocumentHandlerException
- In case a problem occured while processing the content.protected void trimContentHead()
protected void trimContentTail()
protected boolean isIgnoreFlush()
public boolean isAttributeSupported(String name)
name
- The attribute name.
public boolean isAttributeSupported(AttributeDefinition attrDef)
attrDef
- The attribute definition.
public boolean isAttributeSupported(String name, String styleName)
name
- The attribute name.styleName
- The style attribute name.
public boolean isAttributeSupported(AttributeDefinition attrDef, AttributeDefinition styleAttrDef)
attrDef
- The attribute definition.styleAttrDef
- The style attribute definition.
public AttributeDefinition getAttributeDefinition(String name)
name
- The attribute name.
protected void addAttributeDefinition(AttributeDefinition definition)
definition
- The attribute definition to register with the tag.public boolean isAttributeDefined(AttributeDefinition attrDef)
attrDef
- The attribute definition.
public boolean isAttributeDefined(String name)
name
- The attribute's name.
public boolean isAttributeDefined(String name, String styleName)
name
- The attribute's name.styleName
- The according style name.
public boolean isAttributeDefined(AttributeDefinition attrDef, AttributeDefinition styleAttrDef)
attrDef
- The attribute definition.styleAttrDef
- The style attribute definition.
public AttributeDefinition getStyleAttributeDefinition(String name)
name
- The attribute name.
protected void addStyleAttributeDefinition(AttributeDefinition definition)
definition
- The attribute definition to register with the tag.public boolean isStyleAttributeDefined(String name)
name
- The attribute's name.
public Object evalAttribute(String name) throws TagAttributeException
name
- The attribute's name.
TagAttributeException
- if the item contains an invalid value or an required attribute was not defined.public String getRawAttribute(String name) throws TagAttributeException
name
- The attribute's name.
TagAttributeException
- if the item contains an invalid value or an required attribute was not defined.public Object evalAttribute(AttributeDefinition attrDef) throws TagAttributeException
attrDef
- The attribute definition.
TagAttributeException
- if the item contains an invalid value or an required attribute was not defined.public Object getAttribute(AttributeDefinition attrDef, boolean evaluate, AttributeDefinition styleAttrDef, TypedAttributeHandler attrHandler) throws TagAttributeException
attrDef
- The attribute definition.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The style attribute to consider.attrHandler
- The attribute handler to use.
TagAttributeException
- if the item contains an invalid value or an required attribute was not defined.public Object getAttribute(AttributeDefinition attrDef, Object defaultValue, boolean evaluate, AttributeDefinition styleAttrDef, TypedAttributeHandler attrHandler) throws TagAttributeException
attrDef
- The attribute definition.defaultValue
- The default value in case the attribute was not defined.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The style attribute to consider.attrHandler
- The attribute handler to use.
TagAttributeException
- if the item contains an invalid value or an required attribute was not defined.public Object getLocalAttribute(String name, boolean evaluate) throws TagAttributeException
name
- The attribute's name.evaluate
- If this flag is set to true, the attribute will get evaluated.
TagAttributeException
- if the item contains an invalid value or an required attribute was not defined.public boolean isStyleable()
false
as default.public Object getStyleAttribute(String name) throws TagAttributeException
name
- The name of the style attribute to get.
TagAttributeException
- In case the tag attribute evaluation failed.public Object getStyleAttribute(AttributeDefinition styleAttrDef) throws TagAttributeException
styleAttrDef
- The definition of the style attribute to get.
TagAttributeException
- In case the tag attribute evaluation failed.public Object getLocalStyleAttribute(String name) throws TagAttributeException
name
- The name of the style attribute to get.
TagAttributeException
- In case the tag attribute evaluation failed.public Map getStyleAttributes()
name
- The name of the style attribute to get.
TagAttributeException
- In case the tag attribute evaluation failed.public AttributeHandler getAttributeHandler()
public String getTextAttribute(AttributeDefinition attrDef, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
getStringAttribute(java.lang.String, boolean)
but takes care of escape sequences.
attrDef
- The attribute definition.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- if the item contains an invalid value or an required attribute was not defined.public String getTextAttribute(AttributeDefinition attrDef, String defaultValue, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
getStringAttribute(java.lang.String, java.lang.String, boolean)
but takes care of escape sequences.
attrDef
- The attribute definition.defaultValue
- The default value in case the attribute was not defined.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- if the item contains an invalid value or an required attribute was not defined.public String getStringAttribute(AttributeDefinition attrDef, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- if the item contains an invalid value or an required attribute was not defined.public String getStringAttribute(AttributeDefinition attrDef, String defaultValue, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.defaultValue
- The default value in case the attribute was not defined.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- if the item contains an invalid value or an required attribute was not defined.public String getStringAttribute(String attrName, String defaultValue, boolean evaluate, String styleAttrName) throws TagAttributeException
attrName
- The attribute name.defaultValue
- The default value in case the attribute was not defined.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrName
- The name of the style to consider.
TagAttributeException
- if the item contains an invalid value or an required attribute was not defined.public float getFloatAttribute(AttributeDefinition attrDef, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- Thrown in case the item contained an invalid value.public float getFloatAttribute(AttributeDefinition attrDef, float defaultValue, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.defaultValue
- The default value in case the attribute was not defined.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- Thrown in case the item contained an invalid value.public float getDimensionAttribute(AttributeDefinition attrDef, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- Thrown in case the item contained an invalid value.public float getDimensionAttribute(AttributeDefinition attrDef, float defaultValue, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.defaultValue
- The default value in case the attribute was not defined.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- Thrown in case the item contained an invalid value.public float getDimensionAttribute(AttributeDefinition attrDef, Float defaultValue, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.defaultValue
- The default value in case the attribute was not defined.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- Thrown in case the item contained an invalid value.public int getIntegerAttribute(AttributeDefinition attrDef, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- Thrown in case the item contained an invalid value.public int getIntegerAttribute(AttributeDefinition attrDef, int defaultValue, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.defaultValue
- The default value in case the attribute was not defined.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- Thrown in case the item contained an invalid value.public boolean getBooleanAttribute(AttributeDefinition attrDef, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- if the item contains an invalid value or an required attribute was not defined.public boolean getBooleanAttribute(AttributeDefinition attrDef, boolean defaultValue, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.defaultValue
- The default value in case the attribute was not defined.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- if the item contains an invalid value or an required attribute was not defined.public Color getColorAttribute(AttributeDefinition attrDef, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- Thrown in case the item contained an invalid value.public Color getColorAttribute(AttributeDefinition attrDef, Color defaultValue, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.defaultValue
- The default value in case the attribute was not defined.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- Thrown in case the item contained an invalid value.public int getBorderAttribute(AttributeDefinition attrDef, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- Thrown in case the item contained an invalid value.public int getBorderAttribute(AttributeDefinition attrDef, int defaultValue, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.defaultValue
- The default value in case the attribute was not defined.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- Thrown in case the item contained an invalid value.public int getHorizontalAlignmentAttribute(AttributeDefinition attrDef, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- Thrown in case the item contained an invalid value.public int getHorizontalAlignmentAttribute(AttributeDefinition attrDef, int defaultValue, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.defaultValue
- The default value in case the attribute was not defined.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- Thrown in case the item contained an invalid value.public int getVerticalAlignmentAttribute(AttributeDefinition attrDef, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- Thrown in case the item contained an invalid value.public int getVerticalAlignmentAttribute(AttributeDefinition attrDef, int defaultValue, boolean evaluate, AttributeDefinition styleAttrDef) throws TagAttributeException
attrDef
- The attribute definition.defaultValue
- The default value to use in case the attribute was not defined.evaluate
- If this flag is set to true, the attribute will get evaluated.styleAttrDef
- The definition of the style to consider.
TagAttributeException
- Thrown in case the item contained an invalid value.public void openItem() throws DocumentHandlerException
DocumentHandlerException
- Thrown in case something went wrong while opening the document item.protected void handleFontAttributes() throws DocumentHandlerException
DocumentHandlerException
protected String int2FontStyle(int fontStyle)
fontStyle
- The font style to transform into text.
public void closeItem() throws DocumentHandlerException
DocumentHandlerException
- Thrown in case something went wrong while closing the document item.public com.lowagie.text.Phrase addChunk(com.lowagie.text.Phrase phrase, float fixedLeading, float lineSpacing) throws DocumentHandlerException
phrase
- The phrase to add the content to.fixedLeading
- The fixed vertical leading distance.lineSpacing
- The line spacing factor.
DocumentHandlerException
- In case the document processing failed.public void handleContent(PhraseHolder phraseHolder) throws DocumentHandlerException
phraseHolder
- The PhraseHolder to submit the content to.
DocumentHandlerException
- In case the content processing failed.public com.lowagie.text.Phrase addChunk(com.lowagie.text.Phrase phrase, com.lowagie.text.Chunk chunk, float fixedLeading, float lineSpacing)
phrase
- The phrase to add the chunk to.chunk
- The chunk to add to the root phrase.fixedLeading
- The fixed vertical leading distance.lineSpacing
- The line spacing factor.
public com.lowagie.text.Phrase addChunk(BaseDocumentTag tag, com.lowagie.text.Phrase phrase, String chunk, DocumentFont font, float fixedLeading, float lineSpacing) throws DocumentHandlerException
tag
- The document tag instance.phrase
- The phrase to add the chunk to.chunk
- The chunk to add to the root phrase.font
- The font to use.fixedLeading
- The fixed vertical leading distance.lineSpacing
- The line spacing factor.
DocumentHandlerException
- In case the document processing failed.public com.lowagie.text.Phrase processContents(float fixedLeading, float lineSpacing) throws DocumentHandlerException
fixedLeading
- The fixed vertical leading distance.lineSpacing
- The line spacing factor.
DocumentHandlerException
- In case the document processing failed.public com.lowagie.text.Phrase processContents(BaseDocumentTag tag, com.lowagie.text.Phrase phrase, String contents, DocumentFont font, float fixedLeading, float lineSpacing) throws DocumentHandlerException
tag
- The document tag.phrase
- The phrase to add the contents to. In case null is given, an empty phrase is created.contents
- The contents to process.font
- The font to use.fixedLeading
- The fixed vertical leading distance.lineSpacing
- The line spacing factor.
DocumentHandlerException
- In case the document processing failed.protected void filterContents(BaseDocumentTag tag, String contents, StringBuffer buffer, boolean trimHead) throws DocumentHandlerException
tag
- The tag used to tell the document position.contents
- The contents to parse for escape sequencesbuffer
- The buffer to write to.trimHead
- Tells whether or not to trim the leading white spaces
DocumentHandlerException
protected void extendLeading(com.lowagie.text.Phrase phrase, float leading)
phrase
- The phrase to alter.leading
- The size up to which to extend the leading.protected void extendLeading(com.lowagie.text.Phrase phrase, com.lowagie.text.Font font, float fixedLeading, float lineSpacing)
phrase
- The phrase to alter.font
- The font that wants to extend the leading of the given phrase.fixedLeading
- The fixed vertical leading distance.lineSpacing
- The line spacing factor.protected void extendLeading(com.lowagie.text.Phrase phrase, com.lowagie.text.Chunk extender, float fixedLeading, float lineSpacing)
phrase
- The phrase to alter.extender
- The chunk that wants to extend the leading of the given phrase.fixedLeading
- The fixed vertical leading distance.lineSpacing
- The line spacing factor.protected void extendLeading(com.lowagie.text.Phrase phrase, com.lowagie.text.Phrase extender)
phrase
- The phrase to alter.extender
- The phrase that wants to extend the leading of the given phrase.protected com.lowagie.text.Chunk createChunk(String text, DocumentFont font)
text
- The text for the chunk to be created.font
- The font to use.
protected Color colorFromString(String attrName, Object color, boolean evaluate) throws TagAttributeException
attrName
- The attribute name.color
- The color given as String.evaluate
- If this flag is set to true, the attribute will get evaluated.
TagAttributeException
- In case the given string doesn't resolve to a color
in the color map and is a invalid color code.public DocumentFont getFont()
public DocumentFont getLocalFont()
protected void setLocalFont(DocumentFont localFont)
localFont
- The local font to set.protected void setLocalFont(String fontDef) throws TagAttributeException
fontDef
- The name of the attribute that font definition to use.
TagAttributeException
- In case the given font does not exist.public Color getBackgroundColor()
protected void setBackgroundColor(Color backgroundColor)
backgroundColor
- The value to set for the property backgroundColor.public String getStyleClass()
public String getStyle()
protected void addToLatestElementContainer(com.lowagie.text.Element element) throws DocumentHandlerException
element
- The element to add at the parent.
DocumentHandlerException
- In case the inserting of the given element has failed.protected void addToLatestCellContainer(com.lowagie.text.Cell cell) throws DocumentHandlerException
cell
- The cell to add at the parent.
DocumentHandlerException
- In case the inserting of the given cell has failed.protected void addToLatestPdfCellContainer(com.lowagie.text.pdf.PdfPCell cell) throws DocumentHandlerException
cell
- The cell to add at the parent.
DocumentHandlerException
- In case the inserting of the given cell has failed.protected boolean isEmptyContent()
protected boolean isEmptyString(String text)
text
- The string to check.
protected boolean isValid() throws DocumentHandlerException
DocumentHandlerException
- In case a document handling problem occurred.protected boolean isRendered()
protected DocumentFont createFont(String family, String encoding, float size, int style, float textRise, Color color) throws DocumentHandlerException
family
- The font family.encoding
- The font encoding.size
- The font size.style
- The font style.textRise
- The text displacement relative to the baseline.
Positive values rise the text, negative values lower the text.color
- The font color.
DocumentHandlerException
- In case the font could not be created.protected float getPhraseWidth(com.lowagie.text.Phrase item)
item
- The phrase to determine the width for.
protected float getPhraseHeight(com.lowagie.text.Phrase item)
item
- The phrase to determine the width for.
protected String getPhraseContent(com.lowagie.text.Phrase item)
item
- The phrase to get the content for.
protected com.lowagie.text.Phrase rotatePhrase(com.lowagie.text.Phrase phrase, float rotate) throws DocumentHandlerException
phrase
- The phrase to rotate.rotate
- The rotation angle.
DocumentHandlerException
- Thrown in case something went wrong while rotating the phrase.protected void printPhrase(com.lowagie.text.pdf.PdfTemplate template, com.lowagie.text.Phrase phrase, float xPos, float yPos) throws DocumentHandlerException
template
- The template to output the phrase to.phrase
- The phrase to output.xPos
- The horizontal position releative to the template.yPos
- The vertical position releative to the template.
DocumentHandlerException
- Thrown in case something went wrong while rotating the phrase.protected Object typeCastValue(String text, String type) throws DocumentHandlerException
text
- The text to parse the value from.type
- The type name to cast to.
DocumentHandlerException
- In case the type conversion failed.protected com.lowagie.text.pdf.PdfTemplate ensureNumberOfPagesTemplate(DocumentFont font, com.lowagie.text.pdf.PdfContentByte cb)
font
- The font to use for the number of pages output.cb
- The PDF content byte.
protected boolean isPhraseEmpty(com.lowagie.text.Phrase phrase)
phrase
- The phrase to check.
public CommonAttributesHolder getCommonAttributesHolder()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |