Matches a {@link NamedElement} for its exact name.

@param name The expected name.
@param <T>  The type of the matched object.
@return An element matcher for a named element's exact name.
970898
public static <T extends NamedElement> ElementMatcher.Junction<T> named(String name) {
        return new NameMatcher<T>(new StringMatcher(name, StringMatcher.Mode.EQUALS_FULLY));
    }
598196
public static String getElementQualifiedName(XMLStreamReader xmlReader, Map<String, String> namespaces) {
		String namespaceUri = null;
		String localName = null;
		
		switch(xmlReader.getEventType()) {
			case XMLStreamConstants.START_ELEMENT:
			case XMLStreamConstants.END_ELEMENT:
				namespaceUri = xmlReader.getNamespaceURI();
				localName = xmlReader.getLocalName();
				break;
			default:
				localName = StringUtils.EMPTY;
				break;
		}
		
		return namespaces.get(namespaceUri) + ":" + localName;
	}
1189182
public static Matcher constructor(final String name) {
    return new Matcher() {
      @Override public boolean matches(Node node, NodeMetadata metadata) {
        JSDocInfo info = node.getJSDocInfo();
        if (info != null && info.isConstructor()) {
          Node firstChild = node.getFirstChild();
          // TODO(mknichel): Make sure this works with the following cases:
          // ns = {
          //   /** @constructor */
          //   name: function() {}
          // }
          if (name == null) {
            return true;
          }
          if ((firstChild.isGetProp() || firstChild.isName())
              && firstChild.matchesQualifiedName(name)) {
            return true;
          }
        }
        return false;
      }
    };
  }
156443
private String findQualifierName(VariableElement element) {
    String name = null;
    if (element.getAnnotationMirrors().isEmpty()) {
      return name;
    }

    for (AnnotationMirror annotationMirror : element.getAnnotationMirrors()) {
      TypeElement annotationTypeElement = (TypeElement) annotationMirror.getAnnotationType().asElement();
      if (isSameType(annotationTypeElement, "javax.inject.Named")) {
        checkIfAlreadyHasName(element, name);
        name = getValueOfAnnotation(annotationMirror);
      } else if (annotationTypeElement.getAnnotation(javax.inject.Qualifier.class) != null) {
        checkIfAlreadyHasName(element, name);
        name = annotationTypeElement.getQualifiedName().toString();
      }
    }
    return name;
  }
575665
@SuppressWarnings("unchecked")
	public static <T> T lookup(String name) {
		try {
			return (T) new InitialContext().lookup(name);
		} catch (NamingException e) {
			throw new IllegalStateException(e);
		}
	}
316886
public static <T extends AnnotationDescription> ElementMatcher.Junction<T> annotationType(ElementMatcher<? super TypeDescription> matcher) {
        return new AnnotationTypeMatcher<T>(matcher);
    }
999100
public Search name(@Nullable Predicate<String> nameMatches) {
        if (nameMatches != null)
            this.nameMatches = nameMatches;
        return this;
    }
1192742
def match_namespace(self, el, tag):
        """"""

        match = True
        namespace = self.get_tag_ns(el)
        default_namespace = self.namespaces.get('')
        tag_ns = '' if tag.prefix is None else self.namespaces.get(tag.prefix, None)
        # We must match the default namespace if one is not provided
        if tag.prefix is None and (default_namespace is not None and namespace != default_namespace):
            match = False
        # If we specified `|tag`, we must not have a namespace.
        elif (tag.prefix is not None and tag.prefix == '' and namespace):
            match = False
        # Verify prefix matches
        elif (
            tag.prefix and
            tag.prefix != '*' and (tag_ns is None or namespace != tag_ns)
        ):
            match = False
        return match
823841
public static Element dataElement(Element context, String name) {
        return context != null ? context.querySelector("[data-element=" + name + "]") : null;
    }
386938
static HtmlElement forName(final char[] elementNameBuffer, final int offset, final int len) {
        if (elementNameBuffer == null) {
            throw new IllegalArgumentException("Buffer cannot be null");
        }
        return ELEMENTS.getElement(elementNameBuffer, offset, len);
    }
798575
public static Element getChild( Element root, String name )
    {
        if( null == root )
        {
            return null;
        }
        NodeList list = root.getElementsByTagName( name );
        int n = list.getLength();
        if( n < 1 )
        {
            return null;
        }
        return (Element) list.item( 0 );
    }
255198
public static String getChildValue(Element element, String name) {
        return getValue(getChild(element, name));
    }
1231103
private BaseDescr namedConsequence( CEDescrBuilder< ? , ? > ce, NamedConsequenceDescrBuilder<?> namedConsequence ) throws RecognitionException {
        if ( namedConsequence == null ) {
            namedConsequence = helper.start( (DescrBuilder< ? , ? >) ce,
                                              NamedConsequenceDescrBuilder.class,
                                              null );
        }

        try {
            match( input,
                   DRL5Lexer.ID,
                   DroolsSoftKeywords.DO,
                   null,
                   DroolsEditorType.KEYWORD );
            if ( state.failed ) return null;

            match( input,
                   DRL5Lexer.LEFT_SQUARE,
                   null,
                   null,
                   DroolsEditorType.SYMBOL );
            if ( state.failed ) return null;

            Token label = match( input,
                                 DRL5Lexer.ID,
                                 null,
                                 null,
                                 DroolsEditorType.SYMBOL );
            if ( state.failed ) return null;

            namedConsequence.name( label.getText() );

            match( input,
                   DRL5Lexer.RIGHT_SQUARE,
                   null,
                   null,
                   DroolsEditorType.SYMBOL );
            if ( state.failed ) return null;
        } finally {
            helper.end( NamedConsequenceDescrBuilder.class,
                        namedConsequence );
        }
        return namedConsequence.getDescr();
    }
113678
public static <T extends NamedElement> ElementMatcher.Junction<T> nameEndsWithIgnoreCase(String suffix) {
        return new NameMatcher<T>(new StringMatcher(suffix, StringMatcher.Mode.ENDS_WITH_IGNORE_CASE));
    }
888232
public static XMLStreamException duplicateNamedElement(final XMLStreamReader reader, final String name) {
        return new XMLStreamException("An element of this type named '" + name + "' has already been declared",
                reader.getLocation());
    }
73575
private String getNamedTagText(final Element element, final String tagName) {
		Element foundElement = XmlElementUtil.getFirstElementByTagName(element, tagName);
		if (foundElement == null) {
			return "";
		} else {
			return foundElement.getTextContent();
		}
	}
929828
public XMLElementList getChildrenByName(String name) {
		XMLElementList selected = new XMLElementList();
		XMLElementList children = getChildren();
		
		for (int i=0;i<children.size();i++) {
			if (children.get(i).getName().equals(name)) {
				selected.add(children.get(i));
			}
		}
		
		return selected;
	}