Finds a type whose top-level namespace is a specified prefix, or null if there are none.
426964
public String findTypeWithMatchingNamespace(String prefix) {
    prefix = prefix + ".";
    // This must be sorted so that errors are deterministic, or we'll break integration tests.
    for (String name : getAllSortedTypeNames()) {
      if (name.startsWith(prefix)) {
        return name;
      }
    }
    return null;
  }
181851
def namespace_for_prefix(self, prefix):
        
        try:
            ni = self.__lookup_prefix(prefix)
        except PrefixNotFoundError:
            return None
        else:
            return ni.uri
795079
private static Node getNextSiblingOfType(Node first, Token ... types) {
    for (Node c = first; c != null; c = c.getNext()) {
      for (Token type : types) {
        if (c.getToken() == type) {
          return c;
        }
      }
    }
    return null;
  }
127050
public static String getPrefix(String namespaceString)
    {
        Namespace namespace = toNamespace(namespaceString);

        return namespace != null ? namespace.getType() : null;
    }
335747
public String getNamespaceURIFromPrefix(String prefix)
    {
        String uri = null;
        if (m_prefixMap != null)
            uri = m_prefixMap.lookupNamespace(prefix);
        return uri;
    }
466050
public ClassNode lookupClassNodeFor(String type) {
        for (ClassNode cn : typeCheckingVisitor.getSourceUnit().getAST().getClasses()) {
            if (cn.getName().equals(type))
                return cn;
        }

        return null;
    }
66317
def FindTypecheckParent(cls, parents):
    """"""
    for parent in parents:
      if hasattr(parent, "__metaclass__") and parent.__metaclass__ == cls:
        return parent
    return None
865720
public String findUriByPrefix(String prefix)
    {
        /* This is quite simple: just need to locate the last mapping
         * for the prefix, if any:
         */
        String[] strs = mNsStrings;
        int phash = prefix.hashCode();

        for (int ix = mScopeEnd - 2; ix >= 0; ix -= 2) {
            String thisP = strs[ix];
            if (thisP == prefix ||
                (thisP.hashCode() == phash && thisP.equals(prefix))) {
                return strs[ix+1];
            }
        }
        return null;
    }
190083
@Override
  public String getNamespaceURI(String prefix)
  {
    if (prefix == null || !prefix.equals("dns"))
      throw new IllegalArgumentException("Accept only default namespace.");
    
    return "http://www.christofreichardt.de/java/tracer";
  }
1235060
public function getNamespaceForPrefix( $prefix )
	{
		if ( ! isset( $this->instance_namespaces[ $prefix ] ) ) return null;
		return $this->instance_namespaces[ $prefix ];
	}
237991
public Class<?> lookupType(String name) throws ClassNotFoundException {
        if (name == null) {
            throw new IllegalArgumentException("name must not be null");
        }
        Class<?> type = typeRenames.get(name);
        if (type == null) {
            type = StringConvert.loadType(name);
        }
        return type;
    }
132518
public String lookupNamespace(final String prefix) {
        return this.namespaceTagHints.isEmpty() ? prefix : this.namespaceTagHints.get(prefix);
    }
120225
def getNamespace(self, prefix):
        
        namespace = None
        if prefix == 'xmlns':
            namespace = DOM.findDefaultNS(prefix, self.__node)
        else:
            try:
                namespace = DOM.findNamespaceURI(prefix, self.__node)
            except DOMException, ex:
                if prefix != 'xml':
                    raise SchemaError, '%s namespace not declared for %s'\
                        %(prefix, self.__node._get_tagName())
                namespace = XMLNS.XML
        return namespace
942796
def namespace(self):
        
        if self.prefix is None:
            return Namespace.default
        else:
            return self.resolvePrefix(self.prefix)
138780
private @Nullable TypeElement findParentType(TypeElement typeElement, Set<TypeElement> parents) {
    TypeMirror type;
    while (true) {
      type = typeElement.getSuperclass();
      if (type.getKind() == TypeKind.NONE) {
        return null;
      }
      typeElement = (TypeElement) ((DeclaredType) type).asElement();
      if (parents.contains(typeElement)) {
        return typeElement;
      }
    }
  }
1171414
def remove_namespace(self, ns_uri):
        """"""
        if not self.contains_namespace(ns_uri):
            return

        ni = self.__ns_uri_map.pop(ns_uri)
        for prefix in ni.prefixes:
            del self.__prefix_map[prefix]
1155684
private Type findType(String typeString) throws UnknownDashletTypeException {
		if ("viewReport".equalsIgnoreCase(typeString)) {
			return Type.VIEW;
		} else if ("textContent".equalsIgnoreCase(typeString)) {
			return Type.TEXT;
		}
		throw new UnknownDashletTypeException(typeString);
	}