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.thoughtworks.go.legacywrapper.TestSuiteExtractor.java

private BuildTestSuite createSingleTestSuite(Attributes attributes) {
    String name = attributes.getValue("name");
    float duration = Float.parseFloat(StringUtils.defaultString(attributes.getValue("time"), "0.0"));
    int tests = Integer.parseInt(StringUtils.defaultString(attributes.getValue("tests"), "0"));
    int failures = Integer.parseInt(StringUtils.defaultString(attributes.getValue("failures"), "0"));
    int errors = Integer.parseInt(StringUtils.defaultString(attributes.getValue("errors"), "0"));
    return new BuildTestSuite(name, duration);
}

From source file:com.w20e.socrates.factories.NodeFactory.java

/**
 * Create Node//from   w  w w  .  ja  va  2s.c  o  m
 * @param attrs
 *            Attributes of the items stumbled upon.
 * @throws Exception
 *             if stuff fails
 * @return an ItemWrapper
 */
public final NodeImpl createObject(final Attributes attrs) throws Exception {

    LOGGER.fine("Creating node " + attrs.getValue("name"));

    final NodeImpl node = new NodeImpl(attrs.getValue("name"));

    return node;
}

From source file:br.univali.celine.lms.config.BeanSetterAttribute.java

@Override
public void begin(String namespace, String name, Attributes attributes) throws Exception {

    this.attributeName = attributes.getValue("name");
    attributeName = attributeName.substring(0, 1).toUpperCase() + attributeName.substring(1);
}

From source file:com.bellman.bible.service.format.osistohtml.taghandler.MilestoneHandler.java

@Override
public void start(Attributes attrs) {
    String type = attrs.getValue(OSISUtil.OSIS_ATTR_TYPE);
    if (StringUtils.isNotEmpty(type)) {
        switch (type) {
        case "x-p":
        case "line":
            if (passageInfo.isAnyTextWritten) {
                // if no verse text has yet been written then place the BR before the verse number
                writer.writeOptionallyBeforeVerse(HTML.BR, verseInfo);
            }//from   w  w w  .j a v a 2 s .c om
            break;
        case "cQuote":
            String marker = TagHandlerHelper.getAttribute(OSISUtil2.OSIS_ATTR_MARKER, attrs, HTML_QUOTE_ENTITY);
            writer.write(marker);
            break;
        default:
            log.debug("Verse " + verseInfo.currentVerseNo + " unsupported milestone type:" + type);
            break;
        }
    }
}

From source file:com.w20e.socrates.factories.PropertiesFactory.java

/**
 * Create Node/*  w ww . ja v a2  s .  co  m*/
 * @param attrs
 *            Attributes of the items stumbled upon.
 * @throws Exception
 *             if stuff fails
 * @return an ItemWrapper
 */
public final ItemPropertiesImpl createObject(final Attributes attrs) throws Exception {

    LOGGER.fine("Creating properties " + attrs.getValue("id"));

    final ItemPropertiesImpl props = new ItemPropertiesImpl(attrs.getValue("id"));

    return props;
}

From source file:net.bible.service.format.osistohtml.FigureHandler.java

public void start(Attributes attrs) {
    // Refer to Gen 3:14 in ESV for example use of type=x-indent
    String src = attrs.getValue(OSISUtil.ATTRIBUTE_FIGURE_SRC);

    if (StringUtils.isNotEmpty(src)) {
        writer.write("<img src='" + parameters.getModuleBasePath() + "/" + src + "'/>");
    }//from   w ww . j  a v a 2 s  . c  o m
}

From source file:com.w20e.socrates.factories.ControlFactory.java

/**
 * Create specific control, based on configured classes. Control must have
 * the widget attribute!//from  w w  w.j av a  2 s  .c  om
 * 
 * @author Duco Dokter
 * @param attrs
 *            Attributes of the items stumbled upon.
 * @throws Exception
 *             if stuff fails
 * @return an ItemWrapper
 */
public final Control createObject(final Attributes attrs) throws Exception {

    LOGGER.fine("Creating control for " + attrs.getValue("type"));

    return (Control) Class.forName(cfg.getString("layout.controlclasses." + attrs.getValue("type")))
            .newInstance();
}

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

@Override
public void begin(String namespace, String name, Attributes attributes) throws Exception {
    String attrValue = attributes.getValue(attributeName);
    if (attrValue != null) {
        Object value = toPropertyValue(attrValue);
        if (value != null) {
            Object top = digester.peek();

            if (log.isDebugEnabled()) {
                log.debug("Setting property " + propertyName + " on " + top + " to " + value
                        + " from attribute \"" + attrValue + "\"");
            }/*from   w ww.j  a  v  a2s.co m*/

            BeanUtils.setProperty(top, propertyName, value);
        } else {
            if (log.isDebugEnabled()) {
                log.debug("Attribute value " + attrValue + " resulted in null property value, not setting");
            }
        }
    }
}

From source file:com.bellman.bible.service.format.osistohtml.taghandler.FigureHandler.java

@Override
public void start(Attributes attrs) {
    // Refer to Gen 3:14 in ESV for example use of type=x-indent
    String src = attrs.getValue(OSISUtil.ATTRIBUTE_FIGURE_SRC);

    if (StringUtils.isNotEmpty(src)) {
        writer.write("<img class='sword' src='" + parameters.getModuleBasePath() + "/" + src + "'/>");
    }/*from  w  w  w.jav a 2  s.c om*/
}

From source file:eu.planets_project.pp.plato.xml.plato.OrdinalTransformerMappingFactory.java

@Override
public Object createObject(Attributes arg0) throws Exception {
    TargetValueObject o = new TargetValueObject();
    o.setValue(Double.parseDouble(arg0.getValue("target")));
    return o;/*from w  w  w  . j av  a2  s  .c  o m*/
}