All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.thaiopensource.relaxng.input.parse.NamespaceContextImpl Maven / Gradle / Ivy

The newest version!
package com.thaiopensource.relaxng.input.parse;

import com.thaiopensource.relaxng.edit.NamespaceContext;
import com.thaiopensource.relaxng.parse.Context;

import java.util.Collections;
import java.util.Set;

class NamespaceContextImpl implements NamespaceContext {
  private final Context context;
  private Set cachedPrefixes = null;

  NamespaceContextImpl(Context context) {
    this.context = context.copy();
  }

  public String getNamespace(String prefix) {
    return context.resolveNamespacePrefix(prefix);
  }

  public Set getPrefixes() {
    if (cachedPrefixes == null)
      cachedPrefixes = Collections.unmodifiableSet(context.prefixes());
    return cachedPrefixes;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy