Validates and returns the given attribute, or {@code null} if it doesn't exist.
778345
@Nullable
  private static RawTextNode getAttributeValue(
      HtmlAttributeNode htmlAttributeNode, String name, ErrorReporter errorReporter) {
    StandaloneNode valueNode = htmlAttributeNode.getChild(1);
    if (valueNode instanceof HtmlAttributeValueNode) {
      HtmlAttributeValueNode attributeValueNode = (HtmlAttributeValueNode) valueNode;
      if (attributeValueNode.numChildren() == 1
          && attributeValueNode.getChild(0) instanceof RawTextNode) {
        return (RawTextNode) attributeValueNode.getChild(0);
      }
    }
    errorReporter.report(valueNode.getSourceLocation(), INVALID_ATTRIBUTE, name);
    return null;
  }
650855
public String readString(String attribute)
    {
        final String value = getValue(attribute);
        if (NULL.equals(value))
        {
            return null;
        }
        return value;
    }
725256
public static Object getAnnotationAttribute(final Annotation annotation, final String attributeName) {
        Object object = null;
        try {
            // Get the annotation method for the given name
            final Method attributeMethod = annotation.annotationType().getDeclaredMethod(attributeName);

            // Call the method to gets the value
            object = attributeMethod.invoke(annotation);

        } catch (NoSuchMethodException | SecurityException e) {
            LOGGER.log(NO_ANNOTATION_PROPERTY, e, attributeName);
        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
            LOGGER.log(NO_ANNOTATION_PROPERTY_VALUE, e, attributeName);
        }
        return object;
    }
993249
public Object getAttribute(String attrName) {
        Lock lock = lockForRead();
        try {
            return attributes != null ? attributes.get(attrName) : null;
        } finally {
            lock.unlock();
        }
    }
29736
public String getAttributeValue(String name) {
        Attr att = node.getAttributeNode(name);
        if (att == null) return null;
        return att.getNodeValue();
    }
1042452
public Object getAttribute(String attributeName) {
    try {
      final int index = Integer.parseInt(attributeName) - 1;
      if (index < reportable.getMaxEntriesToKeep()) {
        return reportable.get(index).getValue();
      }
    } catch (NumberFormatException e) {
      LOGGER.error("Should never happen! Requested attribute should be an integer but was: " + attributeName);
    }
    return null;
  }
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;
    }
102618
@Override
    public String getValue(int index) {
        if (index < 0 || index >= attributesList.size()) {
            return null;
        }
        return attributesList.get(index).value;
    }
1346815
@SuppressWarnings("unchecked")
    private <A> A getRequestAttribute(String name) {

        Object attribute = m_request.getAttribute(name);

        return attribute != null ? (A)attribute : null;
    }
74824
@SuppressWarnings("unchecked")
    public static <T> Optional<T> getAnnotationAttribute(final Annotation anno, final String attrName, final Class<T> attrType) {
        
        try {
            final Method method = anno.annotationType().getMethod(attrName);
            method.setAccessible(true);
            if(!attrType.equals(method.getReturnType())) {
                return Optional.empty();
            }
            
            final Object value = method.invoke(anno);
            return Optional.of((T)value);
            
        } catch (Exception e) {
            return Optional.empty();
        }
        
    }
28459
public String getAttribute(final String name) {
        for(AttributeInfo item : attributes) {
            if(item.name.equals(name)) {
                return item.value;
            }
        }
        
        return null;
    }
443511
private String getRequiredAttribute(Element node, String name) {
        String value = node.getAttribute(name);
        
        if (value.isEmpty()) {
            throw new IllegalArgumentException("Missing " + name + " attribute on node: " + node.getTagName());
        }
        
        return value;
    }
191010
public Object getAttributeValue(String attributeName) {
		Attribute attribute = getAllAttributes().get(attributeName);
		if (attribute != null) {
			return attribute.getValue();
		}
		return null;
	}
45696
public Attribute getAttribute(String name)
  {
    ArrayList<Attribute> attributeList = getAttributeList();
    
    for (int i = attributeList.size() - 1; i >= 0; i--) {
      Attribute attr = attributeList.get(i);

      if (attr.getName().equals(name))
        return attr;
    }

    return null;
  }
18134
public Object get(String name) throws IOException {
        if (name.equalsIgnoreCase(IS_CA)) {
            return (Boolean.valueOf(ca));
        } else if (name.equalsIgnoreCase(PATH_LEN)) {
            return (Integer.valueOf(pathLen));
        } else {
          throw new IOException("Attribute name not recognized by " +
                                "CertAttrSet:BasicConstraints.");
        }
    }
951218
public Object getAttributeValue(ObjectIdentifier oid)
    throws IOException {
        try {
            Object value = getAttribute(oid).getValue();
            return value;
        } catch (NullPointerException ex) {
            throw new IOException("No value found for attribute " + oid);
        }

    }
1119193
@Override
    public Object getAttributeValue(String name) {
        final List<Object> values = this.getAttributeValues(name);
        if (values != null && values.size() > 0) {
            return values.get(0);
        }

        return null;
    }