public Object createObject(Attributes atts) {
    JRBasePrintGraphicElement graphicElement = (JRBasePrintGraphicElement) digester.peek();

    Byte pen = (Byte) JRXmlConstants.getPenMap().get(atts.getValue(JRXmlConstants.ATTRIBUTE_pen));
    if (pen != null) {
      if (log.isWarnEnabled())
        log.warn("The 'pen' attribute is deprecated. Use the <pen> tag instead.");

      JRPenUtil.setLinePenFromPen(pen, graphicElement.getLinePen());
    }

    Byte fill =
        (Byte) JRXmlConstants.getFillMap().get(atts.getValue(JRXmlConstants.ATTRIBUTE_fill));
    if (fill != null) {
      graphicElement.setFill(fill);
    }

    return graphicElement;
  }
 /** @deprecated Replaced by {@link #getLineBox()} */
 public void setBottomBorder(Byte bottomBorder) {
   JRPenUtil.setLinePenFromPen(bottomBorder, getLineBox().getBottomPen());
 }
 /** @deprecated Replaced by {@link #getLineBox()} */
 public Byte getOwnBottomBorder() {
   return JRPenUtil.getOwnPenFromLinePen(getLineBox().getBottomPen());
 }
 /** @deprecated Replaced by {@link #getLineBox()} */
 public void setLeftBorder(Byte leftBorder) {
   JRPenUtil.setLinePenFromPen(leftBorder, getLineBox().getLeftPen());
 }
 /** @deprecated Replaced by {@link #getLineBox()} */
 public byte getLeftBorder() {
   return JRPenUtil.getPenFromLinePen(getLineBox().getLeftPen());
 }
 /** @deprecated Replaced by {@link #getLineBox()} */
 public void setTopBorder(Byte topBorder) {
   JRPenUtil.setLinePenFromPen(topBorder, getLineBox().getTopPen());
 }
 /** @deprecated Replaced by {@link #getLineBox()} */
 public Byte getOwnTopBorder() {
   return JRPenUtil.getOwnPenFromLinePen(getLineBox().getTopPen());
 }
  public Object createObject(Attributes atts) {
    JRDesignConditionalStyle style = (JRDesignConditionalStyle) digester.peek();

    // get JRElement attributes
    Byte mode =
        (Byte) JRXmlConstants.getModeMap().get(atts.getValue(JRXmlConstants.ATTRIBUTE_mode));
    if (mode != null) {
      style.setMode(mode);
    }

    String forecolor = atts.getValue(JRXmlConstants.ATTRIBUTE_forecolor);
    style.setForecolor(JRXmlConstants.getColor(forecolor, null));

    String backcolor = atts.getValue(JRXmlConstants.ATTRIBUTE_backcolor);
    style.setBackcolor(JRXmlConstants.getColor(backcolor, null));

    // get graphic element attributes
    Byte pen = (Byte) JRXmlConstants.getPenMap().get(atts.getValue(JRXmlConstants.ATTRIBUTE_pen));
    if (pen != null) {
      if (log.isWarnEnabled())
        log.warn("The 'pen' attribute is deprecated. Use the <pen> tag instead.");

      JRPenUtil.setLinePenFromPen(pen, style.getLinePen());
    }

    Byte fill =
        (Byte) JRXmlConstants.getFillMap().get(atts.getValue(JRXmlConstants.ATTRIBUTE_fill));
    style.setFill(fill);

    // get rectangle attributes
    String radius = atts.getValue(JRXmlConstants.ATTRIBUTE_radius);
    if (radius != null && radius.length() > 0) {
      style.setRadius(Integer.parseInt(radius));
    }

    // get image attributes
    Byte scaleImage =
        (Byte)
            JRXmlConstants.getScaleImageMap()
                .get(atts.getValue(JRXmlConstants.ATTRIBUTE_scaleImage));
    if (scaleImage != null) {
      style.setScaleImage(scaleImage);
    }

    Byte horizontalAlignment =
        (Byte)
            JRXmlConstants.getHorizontalAlignMap()
                .get(atts.getValue(JRXmlConstants.ATTRIBUTE_hAlign));
    if (horizontalAlignment != null) {
      style.setHorizontalAlignment(horizontalAlignment);
    }

    Byte verticalAlignment =
        (Byte)
            JRXmlConstants.getVerticalAlignMap()
                .get(atts.getValue(JRXmlConstants.ATTRIBUTE_vAlign));
    if (verticalAlignment != null) {
      style.setVerticalAlignment(verticalAlignment);
    }

    // get box attributes
    Byte border =
        (Byte) JRXmlConstants.getPenMap().get(atts.getValue(JRXmlConstants.ATTRIBUTE_border));
    if (border != null) {
      if (log.isWarnEnabled())
        log.warn("The 'border' attribute is deprecated. Use the <pen> tag instead.");

      JRPenUtil.setLinePenFromPen(border, style.getLineBox().getPen());
    }

    Color borderColor =
        JRXmlConstants.getColor(atts.getValue(JRXmlConstants.ATTRIBUTE_borderColor), null);
    if (borderColor != null) {
      if (log.isWarnEnabled())
        log.warn("The 'borderColor' attribute is deprecated. Use the <pen> tag instead.");

      style.getLineBox().getPen().setLineColor(borderColor);
    }

    String padding = atts.getValue(JRXmlConstants.ATTRIBUTE_padding);
    if (padding != null && padding.length() > 0) {
      if (log.isWarnEnabled())
        log.warn("The 'padding' attribute is deprecated. Use the <box> tag instead.");

      style.getLineBox().setPadding(Integer.parseInt(padding));
    }

    border =
        (Byte) JRXmlConstants.getPenMap().get(atts.getValue(JRXmlConstants.ATTRIBUTE_topBorder));
    if (border != null) {
      if (log.isWarnEnabled())
        log.warn("The 'topBorder' attribute is deprecated. Use the <pen> tag instead.");

      JRPenUtil.setLinePenFromPen(border, style.getLineBox().getTopPen());
    }

    borderColor =
        JRXmlConstants.getColor(
            atts.getValue(JRXmlConstants.ATTRIBUTE_topBorderColor), Color.black);
    if (borderColor != null) {
      if (log.isWarnEnabled())
        log.warn("The 'topBorderColor' attribute is deprecated. Use the <pen> tag instead.");

      style.getLineBox().getTopPen().setLineColor(borderColor);
    }

    padding = atts.getValue(JRXmlConstants.ATTRIBUTE_topPadding);
    if (padding != null && padding.length() > 0) {
      if (log.isWarnEnabled())
        log.warn("The 'topPadding' attribute is deprecated. Use the <box> tag instead.");

      style.getLineBox().setTopPadding(Integer.parseInt(padding));
    }

    border =
        (Byte) JRXmlConstants.getPenMap().get(atts.getValue(JRXmlConstants.ATTRIBUTE_leftBorder));
    if (border != null) {
      if (log.isWarnEnabled())
        log.warn("The 'leftBorder' attribute is deprecated. Use the <pen> tag instead.");

      JRPenUtil.setLinePenFromPen(border, style.getLineBox().getLeftPen());
    }

    borderColor =
        JRXmlConstants.getColor(
            atts.getValue(JRXmlConstants.ATTRIBUTE_leftBorderColor), Color.black);
    if (borderColor != null) {
      if (log.isWarnEnabled())
        log.warn("The 'leftBorderColor' attribute is deprecated. Use the <pen> tag instead.");

      style.getLineBox().getLeftPen().setLineColor(borderColor);
    }

    padding = atts.getValue(JRXmlConstants.ATTRIBUTE_leftPadding);
    if (padding != null && padding.length() > 0) {
      if (log.isWarnEnabled())
        log.warn("The 'leftPadding' attribute is deprecated. Use the <box> tag instead.");

      style.getLineBox().setLeftPadding(Integer.parseInt(padding));
    }

    border =
        (Byte) JRXmlConstants.getPenMap().get(atts.getValue(JRXmlConstants.ATTRIBUTE_bottomBorder));
    if (border != null) {
      if (log.isWarnEnabled())
        log.warn("The 'bottomBorder' attribute is deprecated. Use the <pen> tag instead.");

      JRPenUtil.setLinePenFromPen(border, style.getLineBox().getBottomPen());
    }

    borderColor =
        JRXmlConstants.getColor(
            atts.getValue(JRXmlConstants.ATTRIBUTE_bottomBorderColor), Color.black);
    if (borderColor != null) {
      if (log.isWarnEnabled())
        log.warn("The 'bottomBorderColor' attribute is deprecated. Use the <pen> tag instead.");

      style.getLineBox().getBottomPen().setLineColor(borderColor);
    }

    padding = atts.getValue(JRXmlConstants.ATTRIBUTE_bottomPadding);
    if (padding != null && padding.length() > 0) {
      if (log.isWarnEnabled())
        log.warn("The 'bottomPadding' attribute is deprecated. Use the <box> tag instead.");

      style.getLineBox().setBottomPadding(Integer.parseInt(padding));
    }

    border =
        (Byte) JRXmlConstants.getPenMap().get(atts.getValue(JRXmlConstants.ATTRIBUTE_rightBorder));
    if (border != null) {
      if (log.isWarnEnabled())
        log.warn("The 'rightBorder' attribute is deprecated. Use the <pen> tag instead.");

      JRPenUtil.setLinePenFromPen(border, style.getLineBox().getRightPen());
    }

    borderColor =
        JRXmlConstants.getColor(
            atts.getValue(JRXmlConstants.ATTRIBUTE_rightBorderColor), Color.black);
    if (borderColor != null) {
      if (log.isWarnEnabled())
        log.warn("The 'rightBorderColor' attribute is deprecated. Use the <pen> tag instead.");

      style.getLineBox().getRightPen().setLineColor(borderColor);
    }

    padding = atts.getValue(JRXmlConstants.ATTRIBUTE_rightPadding);
    if (padding != null && padding.length() > 0) {
      if (log.isWarnEnabled())
        log.warn("The 'rightPadding' attribute is deprecated. Use the <box> tag instead.");

      style.getLineBox().setRightPadding(Integer.parseInt(padding));
    }

    Byte rotation =
        (Byte)
            JRXmlConstants.getRotationMap().get(atts.getValue(JRXmlConstants.ATTRIBUTE_rotation));
    if (rotation != null) {
      style.setRotation(rotation);
    }

    Byte lineSpacing =
        (Byte)
            JRXmlConstants.getLineSpacingMap()
                .get(atts.getValue(JRXmlConstants.ATTRIBUTE_lineSpacing));
    if (lineSpacing != null) {
      style.setLineSpacing(lineSpacing);
    }

    style.setMarkup(atts.getValue(JRXmlConstants.ATTRIBUTE_markup));

    String isStyledText = atts.getValue(JRXmlConstants.ATTRIBUTE_isStyledText);
    if (isStyledText != null && isStyledText.length() > 0) {
      if (log.isWarnEnabled())
        log.warn("The 'isStyledText' attribute is deprecated. Use the 'markup' attribute instead.");

      style.setStyledText(Boolean.valueOf(isStyledText));
    }

    style.setPattern(atts.getValue(JRXmlConstants.ATTRIBUTE_pattern));

    String isBlankWhenNull = atts.getValue(JRXmlConstants.ATTRIBUTE_isBlankWhenNull);
    if (isBlankWhenNull != null && isBlankWhenNull.length() > 0) {
      style.setBlankWhenNull(Boolean.valueOf(isBlankWhenNull));
    }

    if (atts.getValue(JRXmlConstants.ATTRIBUTE_fontName) != null)
      style.setFontName(atts.getValue(JRXmlConstants.ATTRIBUTE_fontName));

    if (atts.getValue(JRXmlConstants.ATTRIBUTE_isBold) != null)
      style.setBold(Boolean.valueOf(atts.getValue(JRXmlConstants.ATTRIBUTE_isBold)));

    if (atts.getValue(JRXmlConstants.ATTRIBUTE_isItalic) != null)
      style.setItalic(Boolean.valueOf(atts.getValue(JRXmlConstants.ATTRIBUTE_isItalic)));

    if (atts.getValue(JRXmlConstants.ATTRIBUTE_isUnderline) != null)
      style.setUnderline(Boolean.valueOf(atts.getValue(JRXmlConstants.ATTRIBUTE_isUnderline)));

    if (atts.getValue(JRXmlConstants.ATTRIBUTE_isStrikeThrough) != null)
      style.setStrikeThrough(
          Boolean.valueOf(atts.getValue(JRXmlConstants.ATTRIBUTE_isStrikeThrough)));

    if (atts.getValue(JRXmlConstants.ATTRIBUTE_fontSize) != null)
      style.setFontSize(Integer.valueOf(atts.getValue(JRXmlConstants.ATTRIBUTE_fontSize)));

    if (atts.getValue(JRXmlConstants.ATTRIBUTE_pdfFontName) != null)
      style.setPdfFontName(atts.getValue(JRXmlConstants.ATTRIBUTE_pdfFontName));

    if (atts.getValue(JRXmlConstants.ATTRIBUTE_pdfEncoding) != null)
      style.setPdfEncoding(atts.getValue(JRXmlConstants.ATTRIBUTE_pdfEncoding));

    if (atts.getValue(JRXmlConstants.ATTRIBUTE_isPdfEmbedded) != null)
      style.setPdfEmbedded(Boolean.valueOf(atts.getValue(JRXmlConstants.ATTRIBUTE_isPdfEmbedded)));

    return style;
  }
 /** @deprecated Replaced by {@link #getBox()} */
 public byte getRightBorder() {
   return JRPenUtil.getPenFromLinePen(lineBox.getRightPen());
 }
 /** @deprecated Replaced by {@link #getBox()} */
 public byte getBottomBorder() {
   return JRPenUtil.getPenFromLinePen(lineBox.getBottomPen());
 }
 /** @deprecated Replaced by {@link #getBox()} */
 public void setBottomBorder(byte bottomBorder) {
   JRPenUtil.setLinePenFromPen(bottomBorder, lineBox.getBottomPen());
 }
 /** @deprecated Replaced by {@link #getBox()} */
 public void setLeftBorder(byte leftBorder) {
   JRPenUtil.setLinePenFromPen(leftBorder, lineBox.getLeftPen());
 }
 /** @deprecated Replaced by {@link #getBox()} */
 public Byte getOwnLeftBorder() {
   return JRPenUtil.getOwnPenFromLinePen(lineBox.getLeftPen());
 }
 /** @deprecated Replaced by {@link #getBox()} */
 public void setTopBorder(byte topBorder) {
   JRPenUtil.setLinePenFromPen(topBorder, lineBox.getTopPen());
 }
 /** @deprecated Replaced by {@link #getLineBox()} */
 public Byte getOwnRightBorder() {
   return JRPenUtil.getOwnPenFromLinePen(getLineBox().getRightPen());
 }
Exemple #16
0
  private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();

    if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2) {
      modeValue = ModeEnum.getByValue(mode);
      horizontalAlignmentValue = HorizontalAlignEnum.getByValue(horizontalAlignment);
      verticalAlignmentValue = VerticalAlignEnum.getByValue(verticalAlignment);
      rotationValue = RotationEnum.getByValue(rotation);
      lineSpacingValue = LineSpacingEnum.getByValue(lineSpacing);
      scaleImageValue = ScaleImageEnum.getByValue(scaleImage);
      fillValue = FillEnum.getByValue(fill);

      mode = null;
      horizontalAlignment = null;
      verticalAlignment = null;
      rotation = null;
      lineSpacing = null;
      scaleImage = null;
      fill = null;
    }

    if (linePen == null) {
      linePen = new JRBasePen(this);
      JRPenUtil.setLinePenFromPen(pen, linePen);
      pen = null;
    }

    if (lineBox == null) {
      lineBox = new JRBaseLineBox(this);
      JRBoxUtil.setToBox(
          border,
          topBorder,
          leftBorder,
          bottomBorder,
          rightBorder,
          borderColor,
          topBorderColor,
          leftBorderColor,
          bottomBorderColor,
          rightBorderColor,
          padding,
          topPadding,
          leftPadding,
          bottomPadding,
          rightPadding,
          lineBox);
      border = null;
      topBorder = null;
      leftBorder = null;
      bottomBorder = null;
      rightBorder = null;
      borderColor = null;
      topBorderColor = null;
      leftBorderColor = null;
      bottomBorderColor = null;
      rightBorderColor = null;
      padding = null;
      topPadding = null;
      leftPadding = null;
      bottomPadding = null;
      rightPadding = null;
    }

    if (isStyledText != null) {
      markup =
          isStyledText.booleanValue() ? JRCommonText.MARKUP_STYLED_TEXT : JRCommonText.MARKUP_NONE;
      isStyledText = null;
    }

    if (paragraph == null) {
      paragraph = new JRBaseParagraph(this);
      paragraph.setLineSpacing(lineSpacingValue);
      lineSpacingValue = null;
    }
  }
 /** @deprecated Replaced by {@link #getLineBox()} */
 public void setRightBorder(Byte rightBorder) {
   JRPenUtil.setLinePenFromPen(rightBorder, getLineBox().getRightPen());
 }
  protected void setCommonStyle(JRStyle style, Attributes atts) {
    // get JRElement attributes
    ModeEnum mode = ModeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_mode));
    if (mode != null) {
      style.setMode(mode);
    }

    String forecolor = atts.getValue(JRXmlConstants.ATTRIBUTE_forecolor);
    style.setForecolor(JRColorUtil.getColor(forecolor, null));

    String backcolor = atts.getValue(JRXmlConstants.ATTRIBUTE_backcolor);
    style.setBackcolor(JRColorUtil.getColor(backcolor, null));

    // get graphic element attributes
    PenEnum pen = PenEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_pen));
    if (pen != null) {
      if (log.isWarnEnabled()) {
        log.warn("The 'pen' attribute is deprecated. Use the <pen> tag instead.");
      }

      JRPenUtil.setLinePenFromPen(pen, style.getLinePen());
    }

    FillEnum fill = FillEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_fill));
    if (fill != null) {
      style.setFill(fill);
    }

    // get rectangle attributes
    String radius = atts.getValue(JRXmlConstants.ATTRIBUTE_radius);
    if (radius != null && radius.length() > 0) {
      style.setRadius(Integer.parseInt(radius));
    }

    // get image attributes
    ScaleImageEnum scaleImage =
        ScaleImageEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_scaleImage));
    if (scaleImage != null) {
      style.setScaleImage(scaleImage);
    }

    HorizontalAlignEnum horizontalAlignment =
        HorizontalAlignEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_hAlign));
    if (horizontalAlignment != null) {
      style.setHorizontalAlignment(horizontalAlignment);
    }

    VerticalAlignEnum verticalAlignment =
        VerticalAlignEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_vAlign));
    if (verticalAlignment != null) {
      style.setVerticalAlignment(verticalAlignment);
    }

    // get box attributes
    PenEnum border = PenEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_border));
    if (border != null) {
      if (log.isWarnEnabled()) {
        log.warn("The 'border' attribute is deprecated. Use the <pen> tag instead.");
      }
      JRPenUtil.setLinePenFromPen(border, style.getLineBox().getPen());
    }

    Color borderColor =
        JRColorUtil.getColor(atts.getValue(JRXmlConstants.ATTRIBUTE_borderColor), null);
    if (borderColor != null) {
      if (log.isWarnEnabled()) {
        log.warn("The 'borderColor' attribute is deprecated. Use the <pen> tag instead.");
      }
      style.getLineBox().getPen().setLineColor(borderColor);
    }

    String padding = atts.getValue(JRXmlConstants.ATTRIBUTE_padding);
    if (padding != null && padding.length() > 0) {
      if (log.isWarnEnabled()) {
        log.warn("The 'padding' attribute is deprecated. Use the <box> tag instead.");
      }
      style.getLineBox().setPadding(Integer.parseInt(padding));
    }

    border = PenEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_topBorder));
    if (border != null) {
      if (log.isWarnEnabled()) {
        log.warn("The 'topBorder' attribute is deprecated. Use the <pen> tag instead.");
      }
      JRPenUtil.setLinePenFromPen(border, style.getLineBox().getTopPen());
    }

    borderColor =
        JRColorUtil.getColor(atts.getValue(JRXmlConstants.ATTRIBUTE_topBorderColor), Color.black);
    if (borderColor != null) {
      if (log.isWarnEnabled()) {
        log.warn("The 'topBorderColor' attribute is deprecated. Use the <pen> tag instead.");
      }
      style.getLineBox().getTopPen().setLineColor(borderColor);
    }

    padding = atts.getValue(JRXmlConstants.ATTRIBUTE_topPadding);
    if (padding != null && padding.length() > 0) {
      if (log.isWarnEnabled()) {
        log.warn("The 'topPadding' attribute is deprecated. Use the <box> tag instead.");
      }
      style.getLineBox().setTopPadding(Integer.parseInt(padding));
    }

    border = PenEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_leftBorder));
    if (border != null) {
      if (log.isWarnEnabled()) {
        log.warn("The 'leftBorder' attribute is deprecated. Use the <pen> tag instead.");
      }
      JRPenUtil.setLinePenFromPen(border, style.getLineBox().getLeftPen());
    }

    borderColor =
        JRColorUtil.getColor(atts.getValue(JRXmlConstants.ATTRIBUTE_leftBorderColor), Color.black);
    if (borderColor != null) {
      if (log.isWarnEnabled()) {
        log.warn("The 'leftBorderColor' attribute is deprecated. Use the <pen> tag instead.");
      }
      style.getLineBox().getLeftPen().setLineColor(borderColor);
    }

    padding = atts.getValue(JRXmlConstants.ATTRIBUTE_leftPadding);
    if (padding != null && padding.length() > 0) {
      if (log.isWarnEnabled()) {
        log.warn("The 'leftPadding' attribute is deprecated. Use the <box> tag instead.");
      }
      style.getLineBox().setLeftPadding(Integer.parseInt(padding));
    }

    border = PenEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_bottomBorder));
    if (border != null) {
      if (log.isWarnEnabled()) {
        log.warn("The 'bottomBorder' attribute is deprecated. Use the <pen> tag instead.");
      }
      JRPenUtil.setLinePenFromPen(border, style.getLineBox().getBottomPen());
    }

    borderColor =
        JRColorUtil.getColor(
            atts.getValue(JRXmlConstants.ATTRIBUTE_bottomBorderColor), Color.black);
    if (borderColor != null) {
      if (log.isWarnEnabled()) {
        log.warn("The 'bottomBorderColor' attribute is deprecated. Use the <pen> tag instead.");
      }
      style.getLineBox().getBottomPen().setLineColor(borderColor);
    }

    padding = atts.getValue(JRXmlConstants.ATTRIBUTE_bottomPadding);
    if (padding != null && padding.length() > 0) {
      if (log.isWarnEnabled()) {
        log.warn("The 'bottomPadding' attribute is deprecated. Use the <box> tag instead.");
      }
      style.getLineBox().setBottomPadding(Integer.parseInt(padding));
    }

    border = PenEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_rightBorder));
    if (border != null) {
      if (log.isWarnEnabled()) {
        log.warn("The 'rightBorder' attribute is deprecated. Use the <pen> tag instead.");
      }
      JRPenUtil.setLinePenFromPen(border, style.getLineBox().getRightPen());
    }

    borderColor =
        JRColorUtil.getColor(atts.getValue(JRXmlConstants.ATTRIBUTE_rightBorderColor), Color.black);
    if (borderColor != null) {
      if (log.isWarnEnabled()) {
        log.warn("The 'rightBorderColor' attribute is deprecated. Use the <pen> tag instead.");
      }
      style.getLineBox().getRightPen().setLineColor(borderColor);
    }

    padding = atts.getValue(JRXmlConstants.ATTRIBUTE_rightPadding);
    if (padding != null && padding.length() > 0) {
      if (log.isWarnEnabled()) {
        log.warn("The 'rightPadding' attribute is deprecated. Use the <box> tag instead.");
      }
      style.getLineBox().setRightPadding(Integer.parseInt(padding));
    }

    RotationEnum rotation =
        RotationEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_rotation));
    if (rotation != null) {
      style.setRotation(rotation);
    }

    LineSpacingEnum lineSpacing =
        LineSpacingEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_lineSpacing));
    if (lineSpacing != null) {
      style.setLineSpacing(lineSpacing);
    }

    style.setMarkup(atts.getValue(JRXmlConstants.ATTRIBUTE_markup));

    String isStyledText = atts.getValue(JRXmlConstants.ATTRIBUTE_isStyledText);
    if (isStyledText != null && isStyledText.length() > 0) {
      if (log.isWarnEnabled()) {
        log.warn("The 'isStyledText' attribute is deprecated. Use the 'markup' attribute instead.");
      }
      style.setMarkup(
          Boolean.valueOf(isStyledText)
              ? JRCommonText.MARKUP_STYLED_TEXT
              : JRCommonText.MARKUP_NONE);
    }

    style.setPattern(atts.getValue(JRXmlConstants.ATTRIBUTE_pattern));

    String isBlankWhenNull = atts.getValue(JRXmlConstants.ATTRIBUTE_isBlankWhenNull);
    if (isBlankWhenNull != null && isBlankWhenNull.length() > 0) {
      style.setBlankWhenNull(Boolean.valueOf(isBlankWhenNull));
    }

    if (atts.getValue(JRXmlConstants.ATTRIBUTE_fontName) != null) {
      style.setFontName(atts.getValue(JRXmlConstants.ATTRIBUTE_fontName));
    }
    if (atts.getValue(JRXmlConstants.ATTRIBUTE_isBold) != null) {
      style.setBold(Boolean.valueOf(atts.getValue(JRXmlConstants.ATTRIBUTE_isBold)));
    }
    if (atts.getValue(JRXmlConstants.ATTRIBUTE_isItalic) != null) {
      style.setItalic(Boolean.valueOf(atts.getValue(JRXmlConstants.ATTRIBUTE_isItalic)));
    }
    if (atts.getValue(JRXmlConstants.ATTRIBUTE_isUnderline) != null) {
      style.setUnderline(Boolean.valueOf(atts.getValue(JRXmlConstants.ATTRIBUTE_isUnderline)));
    }
    if (atts.getValue(JRXmlConstants.ATTRIBUTE_isStrikeThrough) != null) {
      style.setStrikeThrough(
          Boolean.valueOf(atts.getValue(JRXmlConstants.ATTRIBUTE_isStrikeThrough)));
    }
    if (atts.getValue(JRXmlConstants.ATTRIBUTE_fontSize) != null) {
      style.setFontSize(Integer.valueOf(atts.getValue(JRXmlConstants.ATTRIBUTE_fontSize)));
    }
    if (atts.getValue(JRXmlConstants.ATTRIBUTE_pdfFontName) != null) {
      style.setPdfFontName(atts.getValue(JRXmlConstants.ATTRIBUTE_pdfFontName));
    }
    if (atts.getValue(JRXmlConstants.ATTRIBUTE_pdfEncoding) != null) {
      style.setPdfEncoding(atts.getValue(JRXmlConstants.ATTRIBUTE_pdfEncoding));
    }
    if (atts.getValue(JRXmlConstants.ATTRIBUTE_isPdfEmbedded) != null) {
      style.setPdfEmbedded(Boolean.valueOf(atts.getValue(JRXmlConstants.ATTRIBUTE_isPdfEmbedded)));
    }
  }