Example usage for org.xml.sax Attributes getValue

List of usage examples for org.xml.sax Attributes getValue

Introduction

In this page you can find the example usage for org.xml.sax Attributes getValue.

Prototype

public abstract String getValue(String qName);

Source Link

Document

Look up an attribute's value by XML qualified (prefixed) name.

Usage

From source file:com.miragedev.mononara.core.io.DictionnaryHandlerImpl.java

public void startElement(String uri, String localName, String qName, Attributes attributes)
        throws SAXException {
    super.startElement(uri, localName, qName, attributes); //To change body of overridden methods use File | Settings | File Templates.
    //System.out.println("Parsing: uri("+uri+") localName("+localName+") qName("+qName+")");
    if (qName.equalsIgnoreCase("dictionnary")) {
        if (attributes.getLength() > 0) {
            numberOfEntry = Integer.parseInt(attributes.getValue("size"));
        }//from w w  w .j  a  va2s .c  o m
    } else if (qName.equalsIgnoreCase("entry")) {
        parentId = Integer.parseInt(attributes.getValue("id"));
        DictionaryEntry dictionnaryEntry = dictionaryEntryDao.findById(parentId);
        if (dictionnaryEntry != null) {
            dictionaryEntryDao.delete(dictionnaryEntry);
        }
        //isNew = false;
        //if (dictionnaryEntry == null) {
        dictionnaryEntry = new DictionaryEntry();
        dictionnaryEntry.setId(parentId);
        dictionaryEntryDao.save(dictionnaryEntry);
        isNew = true;
        //}

    } else if (qName.equalsIgnoreCase("kanji")) {
        inKanji = true;
        inKana = false;
        inRomaji = false;
        inDescription = false;
        inTag = false;
    } else if (qName.equalsIgnoreCase("kana")) {
        inKanji = false;
        inKana = true;
        inRomaji = false;
        inDescription = false;
        inTag = false;
    } else if (qName.equalsIgnoreCase("romaji")) {
        inKanji = false;
        inKana = false;
        inRomaji = true;
        inDescription = false;
        inTag = false;
    } else if (qName.equalsIgnoreCase("description")) {
        inKanji = false;
        inKana = false;
        inRomaji = false;
        inDescription = true;
        inTag = false;
    } else if (qName.equalsIgnoreCase("tag")) {
        inKanji = false;
        inKana = false;
        inRomaji = false;
        inDescription = false;
        inTag = true;
    }
}

From source file:io.github.msdk.io.mzdata.MzDataSaxHandler.java

/** {@inheritDoc} */
public void startElement(String namespaceURI, String lName, String qName, Attributes attrs)
        throws SAXException {

    if (canceled)
        throw new SAXException("Parsing Cancelled");

    // <spectrumList>
    if (qName.equals("spectrumList")) {
        String s = attrs.getValue("count");
        if (s != null)
            totalScans = Integer.parseInt(s);
    }//  w w w  .  j a v  a2  s  .  c  o  m

    // <spectrum>
    if (qName.equalsIgnoreCase("spectrum")) {
        msLevel = 1;
        retentionTime = null;
        polarity = PolarityType.UNKNOWN;
        precursorMz = null;
        precursorCharge = null;
        scanNumber = Integer.parseInt(attrs.getValue("id"));
    }

    // <spectrumInstrument> 1.05 version, <acqInstrument> 1.04 version
    if ((qName.equalsIgnoreCase("spectrumInstrument")) || (qName.equalsIgnoreCase("acqInstrument"))) {
        msLevel = Integer.parseInt(attrs.getValue("msLevel"));
        spectrumInstrumentFlag = true;
    }

    // <cvParam>
    /*
     * The terms time.min, time.sec & mz belongs to mzData 1.04 standard.
     */
    if (qName.equalsIgnoreCase("cvParam")) {
        if (spectrumInstrumentFlag) {
            if ((attrs.getValue("accession").equals(MzDataCV.cvPolarity))
                    || (attrs.getValue("name").equals("Polarity"))) {
                if (attrs.getValue("value").toLowerCase().equals("positive"))
                    polarity = PolarityType.POSITIVE;
                else if (attrs.getValue("value").toLowerCase().equals("negative"))
                    polarity = PolarityType.NEGATIVE;
                else
                    polarity = PolarityType.UNKNOWN;
            }
            if ((attrs.getValue("accession").equals(MzDataCV.cvTimeMin))
                    || (attrs.getValue("name").equals("time.min"))) {
                retentionTime = Float.parseFloat(attrs.getValue("value")) * 60f;
            }

            if ((attrs.getValue("accession").equals(MzDataCV.cvTimeSec))
                    || (attrs.getValue("name").equals("time.sec"))) {
                retentionTime = Float.parseFloat(attrs.getValue("value"));
            }
        }
        if (precursorFlag) {
            if ((attrs.getValue("accession").equals(MzDataCV.cvPrecursorMz))
                    || (attrs.getValue("name").equals("mz"))) {
                precursorMz = Double.parseDouble(attrs.getValue("value"));
            }
            if (attrs.getValue("accession").equals(MzDataCV.cvPrecursorCharge)) {
                precursorCharge = Integer.parseInt(attrs.getValue("value"));
            }
        }
    }

    // <mzArrayBinary>
    if (qName.equalsIgnoreCase("mzArrayBinary")) {
        // clean the current char buffer for the new element
        mzArrayBinaryFlag = true;
    }

    // <intenArrayBinary>
    if (qName.equalsIgnoreCase("intenArrayBinary")) {
        // clean the current char buffer for the new element
        intenArrayBinaryFlag = true;
    }

    // <data>
    if (qName.equalsIgnoreCase("data")) {
        // clean the current char buffer for the new element
        charBuffer.setLength(0);
        if (mzArrayBinaryFlag) {
            endian = attrs.getValue("endian");
            precision = attrs.getValue("precision");
            String len = attrs.getValue("length");
            if (len != null)
                peaksCount = Integer.parseInt(len);
        }
        if (intenArrayBinaryFlag) {
            endian = attrs.getValue("endian");
            precision = attrs.getValue("precision");
            String len = attrs.getValue("length");
            if (len != null)
                peaksCount = Integer.parseInt(len);
        }
    }

    // <precursor>
    if (qName.equalsIgnoreCase("precursor")) {
        precursorFlag = true;
    }
}

From source file:com.esri.geoportal.commons.csw.client.impl.CapabilitiesParse.java

@SuppressWarnings("unchecked")
@Override//www .j  a va 2  s .  c o  m
public void startElement(String uri, String localName, String qName, Attributes attrib) throws SAXException {
    tracking(localName, true);
    text = new StringBuffer();

    if (localName.equals("")) {
        localName = qName;
    }
    LOG.finer("ELEMENT BEGIN " + StringEscapeUtils.escapeJava(localName));

    // Define handling rules 
    text = new StringBuffer();

    if (capabilities && localName.equalsIgnoreCase("operation")) {
        if (chkStr(attrib.getValue("name")).equalsIgnoreCase("GetRecordById")) {
            getRecordById = true;
        } else {
            getRecordById = false;
        }

        if (chkStr(attrib.getValue("name")).equalsIgnoreCase("GetRecords")) {
            getRecords = true;
        } else {
            getRecords = false;
        }
    }

    if (capabilities && getRecordById && localName.equalsIgnoreCase("get")) {
        cap.set_getRecordByIDGetURL(attrib.getValue("xlink:href"));
    }

    if (capabilities && getRecords && localName.equalsIgnoreCase("post")) {
        getRecordsList.push(chkStr(attrib.getValue("xlink:href")));
    }

}

From source file:com.bellman.bible.service.format.osistohtml.strongs.StrongsHandler.java

@Override
public void start(Attributes attrs) {
    // Strongs references
    // example of strongs refs: <w lemma="strong:H0430">God</w> <w lemma="strong:H0853 strong:H01254" morph="strongMorph:TH8804">created</w>
    // better example, because we just use Robinson: <w lemma="strong:G652" morph="robinson:N-NSM" src="2">an apostle</w>
    String strongsLemma = "";
    if (parameters.isShowStrongs() && TagHandlerHelper.isAttr(OSISUtil.ATTRIBUTE_W_LEMMA, attrs)) {
        strongsLemma = attrs.getValue(OSISUtil.ATTRIBUTE_W_LEMMA);
    }/*from  w  ww. ja v  a2s  . com*/
    String morphology = "";
    if (parameters.isShowMorphology() && TagHandlerHelper.isAttr(OSISUtil.ATTRIBUTE_W_MORPH, attrs)) {
        morphology = attrs.getValue(OSISUtil.ATTRIBUTE_W_MORPH);
    }

    if (StringUtils.isNotBlank(strongsLemma) || StringUtils.isNotBlank(morphology)) {
        pendingStrongsAndMorphTags = getStrongsAndMorphTags(strongsLemma, morphology);
    }
}

From source file:catalina.startup.ContextRuleSet.java

public void begin(Attributes attributes) throws Exception {

    // Look up the required parent class loader
    Container container = (Container) digester.peek();
    ClassLoader parentClassLoader = container.getParentClassLoader();

    // Instantiate a new Loader implementation object
    String className = loaderClass;
    if (attributeName != null) {
        String value = attributes.getValue(attributeName);
        if (value != null)
            className = value;/*www .jav  a 2s  . co  m*/
    }
    Class clazz = Class.forName(className);
    Class types[] = { ClassLoader.class };
    Object args[] = { parentClassLoader };
    Constructor constructor = clazz.getDeclaredConstructor(types);
    Loader loader = (Loader) constructor.newInstance(args);

    // Push the new loader onto the stack
    digester.push(loader);
    if (digester.getDebug() >= 1)
        digester.log("new " + loader.getClass().getName());

}

From source file:com.openbravo.pos.printer.TicketParser.java

@Override
public void startElement(String uri, String localName, String qName, Attributes attributes)
        throws SAXException {

    switch (m_iOutputType) {
    case OUTPUT_NONE:
        if ("opendrawer".equals(qName)) {
            m_printer.getDevicePrinter(readString(attributes.getValue("printer"), "1")).openDrawer();
        } else if ("play".equals(qName)) {
            text = new StringBuffer();
        } else if ("ticket".equals(qName)) {
            m_iOutputType = OUTPUT_TICKET;
            m_oOutputPrinter = m_printer.getDevicePrinter(readString(attributes.getValue("printer"), "1"));
            m_oOutputPrinter.beginReceipt();
        } else if ("display".equals(qName)) {
            m_iOutputType = OUTPUT_DISPLAY;
            String animation = attributes.getValue("animation");
            if ("scroll".equals(animation)) {
                m_iVisorAnimation = DeviceDisplayBase.ANIMATION_SCROLL;
            } else if ("flyer".equals(animation)) {
                m_iVisorAnimation = DeviceDisplayBase.ANIMATION_FLYER;
            } else if ("blink".equals(animation)) {
                m_iVisorAnimation = DeviceDisplayBase.ANIMATION_BLINK;
            } else if ("curtain".equals(animation)) {
                m_iVisorAnimation = DeviceDisplayBase.ANIMATION_CURTAIN;
            } else { // "none"
                m_iVisorAnimation = DeviceDisplayBase.ANIMATION_NULL;
            }/*from w w w .java  2 s  .  c o  m*/
            m_sVisorLine1 = null;
            m_sVisorLine2 = null;
            m_oOutputPrinter = null;
        } else if ("fiscalreceipt".equals(qName)) {
            m_iOutputType = OUTPUT_FISCAL;
            m_printer.getFiscalPrinter().beginReceipt();
        } else if ("fiscalzreport".equals(qName)) {
            m_printer.getFiscalPrinter().printZReport();
        } else if ("fiscalxreport".equals(qName)) {
            m_printer.getFiscalPrinter().printXReport();
        }
        break;
    case OUTPUT_TICKET:
        if ("image".equals(qName)) {
            text = new StringBuffer();
        } else if ("barcode".equals(qName)) {
            text = new StringBuffer();
            bctype = attributes.getValue("type");
            bcposition = attributes.getValue("position");
        } else if ("line".equals(qName)) {
            m_oOutputPrinter.beginLine(parseInt(attributes.getValue("size"), DevicePrinter.SIZE_0));
        } else if ("text".equals(qName)) {
            text = new StringBuffer();
            m_iTextStyle = ("true".equals(attributes.getValue("bold")) ? DevicePrinter.STYLE_BOLD
                    : DevicePrinter.STYLE_PLAIN)
                    | ("true".equals(attributes.getValue("underline")) ? DevicePrinter.STYLE_UNDERLINE
                            : DevicePrinter.STYLE_PLAIN);
            String sAlign = attributes.getValue("align");
            if ("right".equals(sAlign)) {
                m_iTextAlign = DevicePrinter.ALIGN_RIGHT;
            } else if ("center".equals(sAlign)) {
                m_iTextAlign = DevicePrinter.ALIGN_CENTER;
            } else {
                m_iTextAlign = DevicePrinter.ALIGN_LEFT;
            }
            m_iTextLength = parseInt(attributes.getValue("length"), 0);
        }
        break;
    case OUTPUT_DISPLAY:
        if ("line".equals(qName)) { // line 1 or 2 of the display
            m_sVisorLine = new StringBuffer();
        } else if ("line1".equals(qName)) { // linea 1 del visor
            m_sVisorLine = new StringBuffer();
        } else if ("line2".equals(qName)) { // linea 2 del visor
            m_sVisorLine = new StringBuffer();
        } else if ("text".equals(qName)) {
            text = new StringBuffer();
            String sAlign = attributes.getValue("align");
            if ("right".equals(sAlign)) {
                m_iTextAlign = DevicePrinter.ALIGN_RIGHT;
            } else if ("center".equals(sAlign)) {
                m_iTextAlign = DevicePrinter.ALIGN_CENTER;
            } else {
                m_iTextAlign = DevicePrinter.ALIGN_LEFT;
            }
            m_iTextLength = parseInt(attributes.getValue("length"));
        }
        break;
    case OUTPUT_FISCAL:
        if ("line".equals(qName)) {
            text = new StringBuffer();
            m_dValue1 = parseDouble(attributes.getValue("price"));
            m_dValue2 = parseDouble(attributes.getValue("units"), 1.0);
            attribute3 = parseInt(attributes.getValue("tax"));

        } else if ("message".equals(qName)) {
            text = new StringBuffer();
        } else if ("total".equals(qName)) {
            text = new StringBuffer();
            m_dValue1 = parseDouble(attributes.getValue("paid"));
        }
        break;
    }
}

From source file:de.l3s.boilerpipe.sax.BoilerpipeHTMLContentHandler.java

private List<Pair<String, String>> convertAttributes(Attributes atts) {
    List<Pair<String, String>> attrs = new ArrayList<>();

    for (int i = 0; i < atts.getLength(); i++) {
        String qName = atts.getQName(i);
        attrs.add(Pair.of(qName, atts.getValue(qName)));
    }//from   w  w  w .  j av  a2 s .  c o m
    return attrs;
}

From source file:info.magnolia.about.app.AboutPresenter.java

String getRepoName() {
    String repoConfigPath = magnoliaProperties.getProperty("magnolia.repositories.config");
    File config = new File(magnoliaProperties.getProperty("magnolia.app.rootdir") + "/" + repoConfigPath);
    final String[] repoName = new String[1];
    try {//from   ww w.  ja  v  a  2 s. c o  m
        SAXParserFactory.newInstance().newSAXParser().parse(config, new DefaultHandler() {
            private boolean inRepo;

            @Override
            public void startElement(String uri, String localName, String qName, Attributes attributes)
                    throws SAXException {
                super.startElement(uri, localName, qName, attributes);
                if ("RepositoryMapping".equals(qName)) {
                    inRepo = true;
                }
                if (inRepo && "Map".equals(qName)) {
                    if ("config".equals(attributes.getValue("name"))) {
                        repoName[0] = attributes.getValue("repositoryName");
                    }
                }
            }

            @Override
            public void endElement(String uri, String localName, String qName) throws SAXException {
                super.endElement(uri, localName, qName);
                if ("RepositoryMapping".equals(localName)) {
                    inRepo = false;
                }
            }
        });
        return repoName[0];
    } catch (Exception e) {
        log.debug("Failed to obtain repository configuration info with {}", e.getMessage(), e);
    }
    return null;
}

From source file:ch.entwine.weblounge.common.impl.content.image.ImageContentReader.java

/**
 * {@inheritDoc}/*from  w  w w.j av a2  s . co  m*/
 * 
 * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String,
 *      java.lang.String, java.lang.String, org.xml.sax.Attributes)
 */
public void startElement(String uri, String local, String raw, Attributes attrs) throws SAXException {

    // start of a new content element
    if ("content".equals(raw)) {
        logger.debug("Started reading image content {}", content);
    }

    // gps position
    else if ("gps".equals(raw)) {
        double gpsLat = Double.parseDouble(attrs.getValue("lat"));
        double gpsLong = Double.parseDouble(attrs.getValue("lng"));
        content.setGpsPosition(gpsLat, gpsLong);
        logger.trace("Image's gps lat is '{}'", content.getGpsLat());
        logger.trace("Image's gps long is '{}'", content.getGpsLong());
    }

    super.startElement(uri, local, raw, attrs);
}

From source file:net.sf.jasperreports.engine.xml.JRAbstractStyleFactory.java

/**
 *
 *//* w  w w . j a  va2  s  .  c  om*/
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.valueOf(radius));
    }

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

    HorizontalTextAlignEnum horizontalTextAlign = HorizontalTextAlignEnum
            .getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_hAlign));
    if (horizontalTextAlign != null) {
        style.setHorizontalTextAlign(horizontalTextAlign);
    }
    horizontalTextAlign = HorizontalTextAlignEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_hTextAlign));
    if (horizontalTextAlign != null) {
        style.setHorizontalTextAlign(horizontalTextAlign);
    }

    VerticalTextAlignEnum verticalTextAlign = VerticalTextAlignEnum
            .getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_vAlign));
    if (verticalTextAlign != null) {
        style.setVerticalTextAlign(verticalTextAlign);
    }
    verticalTextAlign = VerticalTextAlignEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_vTextAlign));
    if (verticalTextAlign != null) {
        style.setVerticalTextAlign(verticalTextAlign);
    }

    HorizontalImageAlignEnum horizontalImageAlign = HorizontalImageAlignEnum
            .getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_hAlign));
    if (horizontalImageAlign != null) {
        style.setHorizontalImageAlign(horizontalImageAlign);
    }
    horizontalImageAlign = HorizontalImageAlignEnum
            .getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_hImageAlign));
    if (horizontalImageAlign != null) {
        style.setHorizontalImageAlign(horizontalImageAlign);
    }

    VerticalImageAlignEnum verticalImageAlign = VerticalImageAlignEnum
            .getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_vAlign));
    if (verticalImageAlign != null) {
        style.setVerticalImageAlign(verticalImageAlign);
    }
    verticalImageAlign = VerticalImageAlignEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_vImageAlign));
    if (verticalImageAlign != null) {
        style.setVerticalImageAlign(verticalImageAlign);
    }

    // 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.valueOf(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.valueOf(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.valueOf(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.valueOf(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.valueOf(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) {
        if (log.isWarnEnabled()) {
            log.warn("The 'lineSpacing' attribute is deprecated. Use the <paragraph> tag instead.");
        }
        style.getParagraph().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(Float.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)));
    }
}