Example usage for org.w3c.dom Element getAttribute

List of usage examples for org.w3c.dom Element getAttribute

Introduction

In this page you can find the example usage for org.w3c.dom Element getAttribute.

Prototype

public String getAttribute(String name);

Source Link

Document

Retrieves an attribute value by name.

Usage

From source file:com.consol.citrus.selenium.xml.SetInputActionParser.java

/**
 * @param element/*from  ww  w  .  j av a  2s  .co  m*/
 * @param parserContext
 * @return
 */
@Override
public BeanDefinition parse(Element element, ParserContext parserContext) {
    actionClass = SetInputAction.class;
    BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(actionClass);
    this.doParse(element, builder);

    Map<By, String> fields = new LinkedHashMap<>();
    List<Element> fieldElements = DomUtils.getChildElementsByTagName(element, "field");
    for (Element fieldElement : fieldElements) {
        String value = fieldElement.getAttribute("value");
        By by = getByFromElement(fieldElement);
        fields.put(by, value);
    }
    builder.addPropertyValue("fields", fields);

    return builder.getBeanDefinition();
}

From source file:com.springcryptoutils.core.spring.certificate.CertificateRegistryByAliasBeanDefinitionParser.java

@Override
protected void doParse(Element element, BeanDefinitionBuilder bean) {
    bean.addPropertyReference("keyStoreRegistry", element.getAttribute("keystoreRegistry-ref"));
}

From source file:com.springcryptoutils.core.spring.signature.SignerWithChooserByPrivateKeyIdBeanDefinitionParser.java

@Override
protected void doParse(Element element, BeanDefinitionBuilder bean) {
    bean.addPropertyReference("privateKeyMap", element.getAttribute("privateKeyMap-ref"));
    bean.addPropertyValue("algorithm", element.getAttribute("algorithm"));
    bean.addPropertyValue("provider", element.getAttribute("provider"));
}

From source file:com.bluexml.side.Integration.alfresco.xforms.webscript.XmlParser.java

public String getQualifiedName(Element e) {
    return e.getAttribute("qualifiedName");
}

From source file:com.bstek.dorado.data.config.xml.PreloadDataProviderParser.java

@Override
protected Object doParse(Node node, ParseContext context) throws Exception {
    DataParseContext dataContext = (DataParseContext) context;
    Element element = ((Element) node);

    String name = element.getAttribute(XmlConstants.ATTRIBUTE_NAME);
    if (StringUtils.isEmpty(name)) {
        throw new XmlParseException("[" + XmlConstants.ATTRIBUTE_NAME + "] attribute of ["
                + DataXmlConstants.DATA_PROVIDER + "] can not be empty - [" + dataContext.getResource() + "]",
                element, context);//from w  w w.j  a  v  a2s  . co  m
    }

    Map<String, NodeWrapper> configuredDataProviders = dataContext.getConfiguredDataProviders();
    if (configuredDataProviders.containsKey(name)) {
        boolean overwrite = BooleanUtils.toBoolean(element.getAttribute(DataXmlConstants.ATTRIBUTE_OVERWRITE));
        if (!overwrite) {
            throw new XmlParseException(DataXmlConstants.DATA_PROVIDER + " [" + name + "] is not unique!",
                    element, context);
        }
    }

    configuredDataProviders.put(name, new NodeWrapper(node, context.getResource()));
    return null;
}

From source file:com.springcryptoutils.core.spring.cipher.symmetric.Base64EncodedSymmetricCiphererBeanDefinitionParser.java

@Override
protected void doParse(Element element, BeanDefinitionBuilder bean) {
    bean.addPropertyValue("keyAlgorithm", element.getAttribute("keyAlgorithm"));
    bean.addPropertyValue("cipherAlgorithm", element.getAttribute("cipherAlgorithm"));
    bean.addPropertyValue("mode", element.getAttribute("mode"));
    bean.addPropertyValue("chunkOutput", element.getAttribute("chunkOutput"));
    bean.addPropertyValue("charsetName", element.getAttribute("charset"));
    bean.addPropertyValue("provider", element.getAttribute("provider"));
}

From source file:com.springcryptoutils.core.spring.cipher.symmetric.SymmetricCiphererWithStaticKeyBeanDefinitionParser.java

@Override
protected void doParse(Element element, BeanDefinitionBuilder bean) {
    bean.addPropertyValue("keyAlgorithm", element.getAttribute("keyAlgorithm"));
    bean.addPropertyValue("cipherAlgorithm", element.getAttribute("cipherAlgorithm"));
    bean.addPropertyValue("key", element.getAttribute("key"));
    bean.addPropertyValue("initializationVector", element.getAttribute("initializationVector"));
    bean.addPropertyValue("mode", element.getAttribute("mode"));
    bean.addPropertyValue("provider", element.getAttribute("provider"));
}

From source file:org.devefx.httpmapper.spring.config.ListenersBeanDefinitionParser.java

private ManagedList<String> getIncludePatterns(Element listener, String elementName) {
    List<Element> paths = DomUtils.getChildElementsByTagName(listener, elementName);
    ManagedList<String> patterns = new ManagedList<String>(paths.size());
    for (Element path : paths) {
        patterns.add(path.getAttribute("path"));
    }/*from   w ww  . j av a2s  . c  om*/
    return patterns;
}

From source file:com.springcryptoutils.core.spring.signature.Base64EncodedVerifierWithChooserByPublicKeyIdBeanDefinitionParser.java

@Override
protected void doParse(Element element, BeanDefinitionBuilder bean) {
    bean.addPropertyReference("publicKeyMap", element.getAttribute("publicKeyMap-ref"));
    bean.addPropertyValue("algorithm", element.getAttribute("algorithm"));
    bean.addPropertyValue("charsetName", element.getAttribute("charset"));
    bean.addPropertyValue("provider", element.getAttribute("provider"));
}