Get an attribute value if it exists, or <code>null</code>
330002
static final String attr(Element element, String name, boolean ignoreNamespace) {
        NamedNodeMap attributes = element.getAttributes();

        for (int i = 0; i < attributes.getLength(); i++) {
            String localName = attributes.item(i).getNodeName();

            // [#103] If namespaces are ignored, consider only local
            // part of possibly namespace-unaware Element
            if (ignoreNamespace)
                localName = stripNamespace(localName);

            if (name.equals(localName))
                return attributes.item(i).getNodeValue();
        }

        return null;
    }
845019
public final String getAttribute(String name)
	{
		synchronized (attributes) {
			for (final Iterator i = attributes.iterator(); i.hasNext();) {
				final Attribute a = (Attribute) i.next();
				if (a.getName().equals(name))
					return a.getValue();
			}
		}
		return null;
	}
679864
public static String getValue(final Element elem, final String attrName) {
        final Attr attr = elem.getAttributeNode(attrName);
        if (attr != null && !attr.getValue().isEmpty()) {
            return attr.getValue();
        }
        return null;
    }
991941
public static AttributeKeyAndValue getAttributeKeyValueByName(final ListObjectAttributesResult attributesResult,
                                                                  final String attributeName) {
        return attributesResult.getAttributes().stream()
            .filter(a -> a.getKey().getName().equalsIgnoreCase(attributeName))
            .findFirst()
            .orElse(null);
    }
1046673
public T findOneByAttribute(String attribute, Object value) {
        CriteriaBuilder cb = getEntityManager().getCriteriaBuilder();
        CriteriaQuery<T> query = cb.createQuery(getEntityClass());
        Root<T> from = query.from(getEntityClass());

        query.where(cb.equal(from.get(attribute), value));

        try {
            return getEntityManager().createQuery(query).getSingleResult();
        } catch (NoResultException e) {
            return null;
        }
    }
741531
@Nullable
    public String getString(String name) {
        Attribute attribute = get(name);
        if (attribute == null) {
            return null;
        }
        return attribute.getValue();
    }
44658
public static Optional<Attribute> getValue(Attribute.Compound attribute, String name) {
    return attribute.getElementValues().entrySet().stream()
        .filter(e -> e.getKey().getSimpleName().contentEquals(name))
        .map(Map.Entry::getValue)
        .findFirst();
  }
1154385
public Object getAttribute(String name) {
        Object value = null;
        synchronized (mutex) {
            if (deleteAttributes != null && deleteAttributes.contains(name)) {
                return null;
            }
            value = window.get(name);
            if (value == null) {
                value = super.getAttribute(name);
            }
        }
        return value;
    }
137473
private String getAttribute(BeanDefinition beanDefinition, String attributeName) {
        String value = null;
        
        while (beanDefinition != null) {
            value = (String) beanDefinition.getAttribute(attributeName);
            
            if (value != null) {
                break;
            }
            
            beanDefinition = beanDefinition.getOriginatingBeanDefinition();
        }
        
        return value;
    }
120317
public String getAttribute(String attributeName) {
		if (attributeName != null){
			return this.attributes.get(attributeName);
		}
		
		return null;
	}
519831
@Override
    public Object getAttribute(String name) {
        if (name == null) {
            logger.logp(Level.SEVERE, CLASS_NAME, "getAttribute", servlet40NLS.getString("name.is.null"));
            throw new java.lang.NullPointerException(servlet40NLS.getString("name.is.null"));
        }

        return super.getAttribute(name);
    }
1168090
public Object getAttributeValue(FeatureDescriptor feature,
                                    String attributeName) {

        if (feature == null || attributeName == null) {
            return null;
        }

        return feature.getValue(attributeName);
    }
993249
public Object getAttribute(String attrName) {
        Lock lock = lockForRead();
        try {
            return attributes != null ? attributes.get(attrName) : null;
        } finally {
            lock.unlock();
        }
    }
1035625
static void extractAttributeValue(Elements elementUtils, Element item, String annotationName, AnnotationAttributeType attribute, OnAttributeFoundListener listener) {
		List<? extends AnnotationMirror> annotationList = elementUtils.getAllAnnotationMirrors(item);
		for (AnnotationMirror annotation : annotationList) {			
			if (annotationName.equals(annotation.getAnnotationType().asElement().toString())) {
				// found annotation
				for (Entry<? extends ExecutableElement, ? extends AnnotationValue> annotationItem : elementUtils.getElementValuesWithDefaults(annotation).entrySet()) {
					if (attribute.isEquals(annotationItem.getKey())) {
						listener.onFound(annotationItem.getValue().toString());
						return;
					}
				}
			}
		}
	}
311875
private static String getAttribute(String name, Element firstElement, Element secondElement) {
        String val = firstElement.getAttribute(name);
        if (val.length() == 0 && secondElement != null) {
            val = secondElement.getAttribute(name);
        }
        return val;
    }
500045
public Object getAttribute(String key) {
		Object result;
		if (attributes == null) {
			result = null;
		} else {
			result = attributes.get(key);
		}
		return result;
	}
60622
@SuppressWarnings("unchecked")
    public <T> T getAttribute( String attrName, Class<T> adaptee ) {
        if (attrName == null) {
            return null;
        }
        if (adaptee == null) {
            adaptee = (Class<T>) String.class;
        }

        Object attribute = feature.getAttribute(attrName);
        if (attribute == null) {
            return null;
        }
        if (attribute instanceof Number) {
            Number num = (Number) attribute;
            if (adaptee.isAssignableFrom(Double.class)) {
                return adaptee.cast(num.doubleValue());
            } else if (adaptee.isAssignableFrom(Float.class)) {
                return adaptee.cast(num.floatValue());
            } else if (adaptee.isAssignableFrom(Integer.class)) {
                return adaptee.cast(num.intValue());
            } else if (adaptee.isAssignableFrom(Long.class)) {
                return adaptee.cast(num.longValue());
            } else if (adaptee.isAssignableFrom(String.class)) {
                return adaptee.cast(num.toString());
            } else {
                throw new IllegalArgumentException();
            }
        } else if (attribute instanceof String) {
            if (adaptee.isAssignableFrom(Double.class)) {
                try {
                    Double parsed = Double.parseDouble((String) attribute);
                    return adaptee.cast(parsed);
                } catch (Exception e) {
                    return null;
                }
            } else if (adaptee.isAssignableFrom(Float.class)) {
                try {
                    Float parsed = Float.parseFloat((String) attribute);
                    return adaptee.cast(parsed);
                } catch (Exception e) {
                    return null;
                }
            } else if (adaptee.isAssignableFrom(Integer.class)) {
                try {
                    Integer parsed = Integer.parseInt((String) attribute);
                    return adaptee.cast(parsed);
                } catch (Exception e) {
                    return null;
                }
            } else if (adaptee.isAssignableFrom(String.class)) {
                return adaptee.cast(attribute);
            } else {
                throw new IllegalArgumentException();
            }
        } else if (attribute instanceof Geometry) {
            return null;
        } else {
            throw new IllegalArgumentException("Can't adapt attribute of type: " + attribute.getClass().getCanonicalName());
        }
    }