Given an attribute in a given type finds the corresponding attribute that it is referencing
in that referencing type.

@param attribute  attribute
@param referenced type being referenced
@return optional element it references
359920
Optional<? extends AttributeDescriptor> referencingAttribute(AttributeDescriptor attribute,
                                                                 EntityDescriptor referenced) {
        String referencedColumn = attribute.referencedColumn();
        if (Names.isEmpty(referencedColumn)) {
            // using the id
            List<AttributeDescriptor> keys = referenced.attributes().stream()
                .filter(AttributeDescriptor::isKey).collect(Collectors.toList());

            if (keys.size() == 1) {
                return Optional.of(keys.get(0));
            } else {
                return keys.stream()
                    .filter(other -> other.typeMirror().equals(attribute.typeMirror()))
                    .findFirst();
            }
        } else {
            return referenced.attributes().stream()
                .filter(other -> other.name().equals(referencedColumn))
                .findFirst();
        }
    }
709838
public boolean getAttributeAsBoolean(AnnotationAttributeType attribute) {
		String temp = attributes.get(attribute.getValue());

		return Boolean.parseBoolean(temp);
	}
666225
public String extractType(XAttribute attribute) {
		XAttribute attr = attribute.getAttributes().get(KEY_TYPE);
		if (attr == null) {
			return null;
		} else {
			return ((XAttributeLiteral) attr).getValue();
		}
	}
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;
	}
1153726
@Override
	public String getAttribute(String attributeName) throws WidgetException {
		try {
			WebElement webElement = null;
			String attr = null;

			// WebDriver get attribute
			try {
				webElement = findElement();
				attr = webElement.getAttribute(attributeName);
				highlight(HIGHLIGHT_MODES.GET);
			} catch (NoSuchElementException e) {
				throw e;
			}

			if (attr != null && !attr.equals("")) {
				return attr;
			}

			return "";
		} catch (Exception e) {
			throw new WidgetException("Error while fetching attribute " + attributeName, locator, e);
		}
	}
488800
public NumericAttribute plus(com.gs.fw.finder.attribute.NumericAttribute attribute)
    {
        return MappedAttributeUtil.plus(this, (NumericAttribute) attribute);
    }
343021
@SuppressWarnings("unchecked")
    public <T> T getAttribute(final Attribute _attribute)
        throws EFapsException
    {
        return (T) getAttribute(_attribute.getName());
    }
8504
def referenced_element
      ref = @xml.attributes['ref'].value
      @referenced_element ||= if ref =~ /:/
        prefix, element = ref.split(':')
        schema.find_element(element) || schema.find_attribute("@#{element}") if schema = Schema.find(prefix)
      else
        self.schema.find_element(ref) || self.schema.find_attribute("@#{ref}")
      end
    end
799860
private static String[] getReferenceAttributes(String name) {
        if (name.endsWith(SchemaGenConstants.CFG_REFERENCE_SUFFIX)) {
            return new String[] { name, name.substring(0, name.length() - SchemaGenConstants.CFG_REFERENCE_SUFFIX.length()) };
        }
        return new String[] { name + SchemaGenConstants.CFG_REFERENCE_SUFFIX, name };
    }
506757
def get_attribute(self, reference):
        
        prefix, _, name = reference.rpartition('.')

        match = None
        for attribute in self._contents:
            if name == attribute.name and \
                    (not prefix or prefix == attribute.prefix):
                if match:
                    raise AttributeReferenceError(
                        'Ambiguous attribute reference: {}.'.format(
                            attribute.name))
                else:
                    match = attribute

        if match:
            return match
        raise AttributeReferenceError(
            'Attribute does not exist: {}'.format(reference))
1153409
public Attribute getAttribute(final String attributeName) {
		final Attribute a = attributes.get(attributeName);
		if (a == null)
			throw new IllegalArgumentException("Attribute " + attributeName + " doesn't exists");
		return a;
	}
801787
private String getValue(String attribute)
    {
        Check.notNull(attribute);

        if (root.hasAttribute(attribute))
        {
            return root.getAttribute(attribute);
        }
        throw new LionEngineException(ERROR_ATTRIBUTE + attribute);
    }
858006
public <V extends ModelElementInstance> AttributeReferenceBuilder<V> qNameAttributeReference(Class<V> referenceTargetElement) {
    AttributeImpl<String> attribute = (AttributeImpl<String>) build();
    AttributeReferenceBuilderImpl<V> referenceBuilder = new QNameAttributeReferenceBuilderImpl<V>(attribute, referenceTargetElement);
    setAttributeReference(referenceBuilder);
    return referenceBuilder;
  }
330680
public List<String> getAttributeAsArray(AnnotationAttributeType attribute) {
		String temp = attributes.get(attribute.getValue());

		return AnnotationUtility.extractAsArrayOfString(temp);
	}
613290
protected void checkAttribute(String attribute) {
        if (!hasAttribute(attribute)) {
            String sb = "Attribute: '" + attribute + "' is not defined in model: '" + getModelClass() + ". "
                    + "Available attributes: " +getAttributeNames();
            throw new IllegalArgumentException(sb);
        }
    }
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;
  }
589340
@Nullable
  public final synchronized Object getAttribute(String view, String attribute) {
    if (attributes == null) {
      return null;
    }
    return attributes.get(view, attribute);
  }