com.adobe.icc.ddg
Class ContentConverterUtil

java.lang.Object
  extended by com.adobe.icc.ddg.ContentConverterUtil

public class ContentConverterUtil
extends java.lang.Object


Field Summary
static java.lang.String BULLET_CONTENT_POSTFIX
           
static java.util.regex.Pattern flashHtmlPattern
           
static java.lang.Double MM_TO_POINT_FACTOR
           
static java.util.regex.Pattern tlfPattern
           
static java.util.regex.Pattern xhtmlPattern
           
 
Constructor Summary
ContentConverterUtil()
           
 
Method Summary
 void addBulletFlashHtml(Element textFormat, java.lang.String bulletChar)
          Adds the Bullet character in given flashHtml TEXTFORMAT Element.
 void addBulletTlf(Element paraElement, java.lang.String bulletChar)
          Adds the Bullet character in given TLF Para Element.
 void addBulletXhtml(Element paraElement, java.lang.String bulletChar)
          Adds the Bullet character in given Xhtml Para Element.
 Element appendStyleAsAttribute(Element element, java.lang.String targetAttribute, java.lang.Double value)
          Appends the value to the existing targetAttribute value associated with the element.
 Element appendXHTMLStyle(Element element, java.lang.String targetAttribute, java.lang.Double value)
          Appends the value to the existing attribute value associated with the element of XHTML.
 java.lang.String convertLists(java.lang.String content, java.lang.Double indentValue)
           
 java.lang.String convertNewLinesToXhml(java.lang.String richText)
           
 java.lang.String convertXhtmlLists(java.lang.String resolvedContent, java.lang.Double indentValue)
           
 Element copyXhtmlSpanForBullet(Element span)
           
 java.lang.String extractPlainText(java.lang.String richText, boolean escapeNewLines)
          Formats the specified rich text as plain text.
 Element findFirstXhtmlSpan(java.lang.String contentXML, java.lang.String paraXpath)
           
 java.lang.String findXhtmlStyleAttr(java.lang.String attr, Element el)
           
 java.io.Serializable getTypedData(java.io.Serializable value, DataType dataType, LocalizedDataFormatInfo sourceFormat, LocalizedDataFormatInfo targetFormat)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MM_TO_POINT_FACTOR

public static final java.lang.Double MM_TO_POINT_FACTOR

BULLET_CONTENT_POSTFIX

public static java.lang.String BULLET_CONTENT_POSTFIX

xhtmlPattern

public static final java.util.regex.Pattern xhtmlPattern

tlfPattern

public static final java.util.regex.Pattern tlfPattern

flashHtmlPattern

public static final java.util.regex.Pattern flashHtmlPattern
Constructor Detail

ContentConverterUtil

public ContentConverterUtil()
Method Detail

extractPlainText

public java.lang.String extractPlainText(java.lang.String richText,
                                         boolean escapeNewLines)
Formats the specified rich text as plain text. Handles rich text that has no root.

Parameters:
richText - The rich text (XHTML or Flash HTML) to format as plain text.
escapeNewLines - If true, new lines will be escaped to the literal '\n' so that the plain text can be used in script.
Returns:
The plain text version of the rich text.

convertNewLinesToXhml

public java.lang.String convertNewLinesToXhml(java.lang.String richText)

convertLists

public java.lang.String convertLists(java.lang.String content,
                                     java.lang.Double indentValue)

convertXhtmlLists

public java.lang.String convertXhtmlLists(java.lang.String resolvedContent,
                                          java.lang.Double indentValue)

findXhtmlStyleAttr

public java.lang.String findXhtmlStyleAttr(java.lang.String attr,
                                           Element el)

findFirstXhtmlSpan

public Element findFirstXhtmlSpan(java.lang.String contentXML,
                                  java.lang.String paraXpath)
                           throws DocumentException
Throws:
DocumentException

copyXhtmlSpanForBullet

public Element copyXhtmlSpanForBullet(Element span)

appendStyleAsAttribute

public Element appendStyleAsAttribute(Element element,
                                      java.lang.String targetAttribute,
                                      java.lang.Double value)
Appends the value to the existing targetAttribute value associated with the element. Mainly used for flashHtml and TLF manipulation

Parameters:
element -
targetAttribute -
value -
Returns:

appendXHTMLStyle

public Element appendXHTMLStyle(Element element,
                                java.lang.String targetAttribute,
                                java.lang.Double value)
Appends the value to the existing attribute value associated with the element of XHTML.

Parameters:
element -
targetAttribute -
value -
Returns:

addBulletFlashHtml

public void addBulletFlashHtml(Element textFormat,
                               java.lang.String bulletChar)
Adds the Bullet character in given flashHtml TEXTFORMAT Element. an extra tab is appended at the end of bullet character to align bullets around the tab stop. The TextFormat is further given negative indent to shift the bullet to left so that they appear to be proper list.

Parameters:
textFormat -
bulletChar -

addBulletXhtml

public void addBulletXhtml(Element paraElement,
                           java.lang.String bulletChar)
Adds the Bullet character in given Xhtml Para Element. an extra tab span is added at the end of bullet span to align bullets around the tab stop. The Para Element is further given negative indent to shift the bullet to left so that they appear to be proper list.

Parameters:
paraElement -
bulletChar -

addBulletTlf

public void addBulletTlf(Element paraElement,
                         java.lang.String bulletChar)
Adds the Bullet character in given TLF Para Element. an extra tab is added at the end of bullet to align bullets around the tab stop. The Para Element is further given negative indent to shift the bullet to left so that they appear to be proper list.

Parameters:
paraElement -
bulletChar -

getTypedData

public java.io.Serializable getTypedData(java.io.Serializable value,
                                         DataType dataType,
                                         LocalizedDataFormatInfo sourceFormat,
                                         LocalizedDataFormatInfo targetFormat)


[an error occurred while processing this directive] [an error occurred while processing this directive]