Creates a copy of the parameters, prepending a namespace prefix
to each parameter name.
@param prefix	the prefix to prepend
@return	the copy of the parameters
321371
public RequestParameters copy(String prefix) {
    String keyPrefix = prefix+":";

    RequestParameters copy = new RequestParameters();
    for (Map.Entry<String, List<String>> entry: entrySet()) {
      copy.put(keyPrefix+entry.getKey(), entry.getValue());
    }

    return copy;
  }
254186
public static NamespaceContext
        toNamespaceContext(Map<String, String> prefix2URI) {
        final Map<String, String> copy =
            new LinkedHashMap<String, String>(prefix2URI);
        return new NamespaceContext() {
            public String getNamespaceURI(String prefix) {
                if (prefix == null) {
                    throw new IllegalArgumentException("prefix must not be null");
                }
                if (XMLConstants.XML_NS_PREFIX.equals(prefix)) {
                    return XMLConstants.XML_NS_URI;
                }
                if (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix)) {
                    return XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
                }
                String uri = copy.get(prefix);
                return uri != null ? uri : XMLConstants.NULL_NS_URI;
            }

            public String getPrefix(String uri) {
                Iterator i = getPrefixes(uri);
                return i.hasNext() ? (String) i.next() : null;
            }

            public Iterator getPrefixes(String uri) {
                if (uri == null) {
                    throw new IllegalArgumentException("uri must not be null");
                }
                Collection<String> c = new LinkedHashSet<String>();
                boolean done = false;
                if (XMLConstants.XML_NS_URI.equals(uri)) {
                    c.add(XMLConstants.XML_NS_PREFIX);
                    done = true;
                }
                if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(uri)) {
                    c.add(XMLConstants.XMLNS_ATTRIBUTE);
                    done = true;
                }
                if (!done) {
                    for (Map.Entry<String, String> entry : copy.entrySet()) {
                        if (uri.equals(entry.getValue())) {
                            c.add(entry.getKey());
                        }
                    }
                }
                return c.iterator();
            }
        };
    }
517516
public String lookupNamespace(final String prefix) {
        Object namespace = namespaceMap.get(prefix);
        if (namespace != null) {
            return namespace.toString();
        }
        return this.namespaceTagHints.isEmpty() ? prefix : this.namespaceTagHints.get(prefix);
    }
597671
private NameGenerator getNameGenerator(String namePrefix)
    {
        synchronized(this)
        {
            if (_nameGenerators == null)
                _nameGenerators = new HashMap<String,NameGenerator>();

            NameGenerator nameGenerator = _nameGenerators.get(namePrefix);
            if (nameGenerator == null)
            {
                nameGenerator = new NameGenerator(namePrefix);
                _nameGenerators.put(namePrefix, nameGenerator);
            }
            return nameGenerator;
        }
    }
117120
public void registerMapping(String prefix, String namespaceURI)
   {
      prefix2Ns.put(prefix, namespaceURI);
      ns2Prefix.put(namespaceURI, prefix);
   }
614378
public static Proxy forPropertiesOpt(String prefix) {
        String host;
        String port;
        Proxy result;

        host = System.getProperty(prefix + ".proxyHost");
        if (host == null) {
            return null;
        }
        port = System.getProperty(prefix + ".proxyPort");
        if (port == null) {
            throw new IllegalStateException("missing proxy port for host " + host);
        }
        result = new Proxy(host, Integer.parseInt(port));
        result.excludes.addAll(NON_PROXY_SEP.split(System.getProperty(prefix + ".nonProxyHosts", "")));
        return result;
    }
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;
  }
377683
public static String add(String prefix, String name) {
    return (prefix == null) ? name : prefix+"."+name;
  }
419753
public void loadProperties(String prefix) {
        List<Property> props = null;
        
        try {
            props = getListByPrefix(prefix);
        } catch (Exception e) {
            log.error("Error retrieving properties with prefix: " + prefix, e);
            return;
        }
        
        for (Property prop : props) {
            if (prop.getName() != null) {
                this.properties.put(prop.getName(), prop);
            }
        }
    }
434366
public Page<Bucket> listBucketsWithSizeAndPrefix(String prefix) {
    // [START listBucketsWithSizeAndPrefix]
    // Include a prefix of bucket-name to reduce search space.
    // For more information read https://cloud.google.com/storage/docs/json_api/v1/buckets/list
    Page<Bucket> buckets =
        storage.list(BucketListOption.pageSize(100), BucketListOption.prefix(prefix));
    for (Bucket bucket : buckets.iterateAll()) {
      // do something with the bucket
    }
    // [END listBucketsWithSizeAndPrefix]
    return buckets;
  }
634144
@SuppressWarnings("unused")
	public void setPrefix(String prefix, String namespace) throws IOException {
		if (startTagIncomplete)
			closeStartTag();
		// assert prefix != null;
		// assert namespace != null;
		if (prefix == null) {
			prefix = "";
		}
		if (!namesInterned) {
			prefix = prefix.intern(); // will throw NPE if prefix==null
		} else if (checkNamesInterned) {
			checkInterning(prefix);
		} else if (prefix == null) {
			throw new IllegalArgumentException("prefix must be not null" + getLocation());
		}

		// check that prefix is not duplicated ...
		for (int i = elNamespaceCount[depth]; i < namespaceEnd; i++) {
			if (prefix == namespacePrefix[i]) {
				throw new IllegalStateException("duplicated prefix " + printable(prefix) + getLocation());
			}
		}

		if (!namesInterned) {
			namespace = namespace.intern();
		} else if (checkNamesInterned) {
			checkInterning(namespace);
		} else if (namespace == null) {
			throw new IllegalArgumentException("namespace must be not null" + getLocation());
		}

		if (namespaceEnd >= namespacePrefix.length) {
			ensureNamespacesCapacity();
		}
		namespacePrefix[namespaceEnd] = prefix;
		namespaceUri[namespaceEnd] = namespace;
		++namespaceEnd;
		setPrefixCalled = true;
	}
36321
public String getNamespaceURI(String prefix) {
        if (prefix == null || prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
            return prefix2Uri.get(DEFAULT_NS);
        } else {
            return prefix2Uri.get(prefix);
        }
    }
542586
public boolean startsWith(Name prefix) {
        byte[] thisBytes = this.getByteArray();
        int thisOffset   = this.getByteOffset();
        int thisLength   = this.getByteLength();
        byte[] prefixBytes = prefix.getByteArray();
        int prefixOffset   = prefix.getByteOffset();
        int prefixLength   = prefix.getByteLength();

        int i = 0;
        while (i < prefixLength &&
               i < thisLength &&
               thisBytes[thisOffset + i] == prefixBytes[prefixOffset + i])
            i++;
        return i == prefixLength;
    }
850928
def _prepend_name_prefix(self, name):
        """"""
        if not self.name_prefix:
            return name
        base = self.name_prefix
        if base[0] != '/':
            base = '/' + base
        if name[0] != '/':
            name = '/' + name
        return base + name
642101
public String getNamespaceURI(String prefix) {
		List<NamespaceDeclaration> nsDecls = getNamespaceDeclarations();
		for (int i = 0; i < nsDecls.size(); i++) {
			NamespaceDeclaration nsDecl = nsDecls.get(i);
			if (nsDecl.prefix.equals(prefix)) {
				return nsDecl.namespaceURI;
			}
		}
		return null;
	}
1052286
private Map<String, String> getConfigMapFromProperties(String prefix) {
        Map<String, String> rval = new HashMap<>();
        getKeys(prefix).forEach(pair -> {
            if (!pair.getKey().equals(prefix)) {
                String shortKey = pair.getKey().substring(prefix.length() + 1);
                rval.put(shortKey, pair.getValue());
            }
        });
        return rval;
    }
974176
public void setNamespace(String prefix, String uri) {

    this.prefix2namespace.put(prefix, uri);
    this.namespace2prefix.put(uri, prefix);
  }