congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
NamespaceContext
Code IndexAdd Tabnine to your IDE (free)

How to use
NamespaceContext
in
org.custommonkey.xmlunit

Best Java code snippets using org.custommonkey.xmlunit.NamespaceContext (Showing top 9 results out of 387)

origin: org.custommonkey.xmlunit/com.springsource.org.custommonkey.xmlunit

  private static Map turnIntoMap(NamespaceContext ctx) {
    HashMap/*<String, String>*/ m = new HashMap();
    for (Iterator i = ctx.getPrefixes(); i.hasNext(); ) {
      String prefix = (String) i.next();
      String uri = ctx.getNamespaceURI(prefix);
      // according to the Javadocs only the constants defined in
      // XMLConstants are allowed as prefixes for the following
      // two URIs
      if (!XMLConstants.XML_NS_URI.equals(uri)
        && !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(uri)) {
        m.put(prefix, uri);
      }
    }
    m.put(XMLConstants.XML_NS_PREFIX, XMLConstants.XML_NS_URI);
    m.put(XMLConstants.XMLNS_ATTRIBUTE,
       XMLConstants.XMLNS_ATTRIBUTE_NS_URI);
    return m;
  }
}
origin: com.github.bordertech.wcomponents/wcomponents-test-lib

/**
 * Returns the namespace uri for the given prefix.
 *
 * @param prefix the namespace prefix
 * @return the namespace uri, or null if an unknown prefix was supplied.
 */
@Override
public String getNamespaceURI(final String prefix) {
  if ("ui".equals(prefix)) {
    return "https://github.com/bordertech/wcomponents/namespace/ui/v1.0";
  } else if ("html".equals(prefix)) {
    return "http://www.w3.org/1999/xhtml";
  } else if (backing != null) {
    return backing.getNamespaceURI(prefix);
  }
  return null;
}
origin: com.github.bordertech.wcomponents/wcomponents-test-lib

  /**
   * @return an iteration of the namespace prefixes in this contex.t
   */
  @Override
  public Iterator<String> getPrefixes() {
    Set<String> prefixes = new HashSet<>(2);
    prefixes.add("ui");
    prefixes.add("html");
    if (backing != null) {
      for (Iterator<?> i = backing.getPrefixes(); i.hasNext();) {
        prefixes.add((String) i.next());
      }
    }
    return prefixes.iterator();
  }
}
origin: org.xmlunit/xmlunit-legacy

  private static QualifiedName parsePrefixFormat(String value, int colon,
                          NamespaceContext ctx) {
    if (colon + 1 == value.length()) {
      throw new IllegalArgumentException("localName must not be empty in "
                        + value);
    }
    if (ctx == null) {
      throw new IllegalArgumentException("Cannot parse " + value
                        + " without a NamespaceContext");
    }
    String prefix = value.substring(0, colon);
    String nsUri = ctx.getNamespaceURI(prefix);
    if (nsUri == null) {
      throw new IllegalArgumentException(prefix + " is unknown to "
                        + "NamespaceContext");
    }
    return new QualifiedName(nsUri, value.substring(colon + 1));
  }
}
origin: com.github.bordertech.wcomponents/wcomponents-core

  /**
   * {@inheritDoc}
   */
  @Override
  public Iterator<String> getPrefixes() {
    Set<String> prefixes = new HashSet<>(2);
    prefixes.add("ui");
    prefixes.add("html");
    if (backing != null) {
      for (Iterator i = backing.getPrefixes(); i.hasNext();) {
        prefixes.add((String) i.next());
      }
    }
    return prefixes.iterator();
  }
}
origin: org.xmlunit/xmlunit-legacy

  static Map<String, String> turnIntoMap(NamespaceContext ctx) {
    Map<String, String> m = new HashMap<String, String>();
    for (Iterator i = ctx.getPrefixes(); i.hasNext(); ) {
      String prefix = (String) i.next();
      String uri = ctx.getNamespaceURI(prefix);
      // according to the Javadocs only the constants defined in
      // XMLConstants are allowed as prefixes for the following
      // two URIs
      if (!XMLConstants.XML_NS_URI.equals(uri)
        && !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(uri)) {
        m.put(prefix, uri);
      }
    }
    m.put(XMLConstants.XML_NS_PREFIX, XMLConstants.XML_NS_URI);
    m.put(XMLConstants.XMLNS_ATTRIBUTE,
       XMLConstants.XMLNS_ATTRIBUTE_NS_URI);
    return m;
  }
}
origin: com.github.bordertech.wcomponents/wcomponents-core

/**
 * {@inheritDoc}
 */
@Override
public String getNamespaceURI(final String prefix) {
  if ("ui".equals(prefix)) {
    return getThemeURI();
  } else if ("html".equals(prefix)) {
    return XMLUtil.XHTML_URI;
  } else if (backing != null) {
    return backing.getNamespaceURI(prefix);
  }
  return null;
}
origin: org.xmlunit/xmlunit-legacy

StringBuilder nsDecls = new StringBuilder();
String quoteStyle = "'";
for (Iterator keys = ctx.getPrefixes(); keys.hasNext(); ) {
  String prefix = (String) keys.next();
  String uri = ctx.getNamespaceURI(prefix);
  if (uri == null) {
    continue;
origin: org.custommonkey.xmlunit/com.springsource.org.custommonkey.xmlunit

StringBuffer nsDecls = new StringBuffer();
String quoteStyle = "'";
for (Iterator keys = ctx.getPrefixes(); keys.hasNext(); ) {
  String prefix = (String) keys.next();
  String uri = ctx.getNamespaceURI(prefix);
  if (uri == null) {
    continue;
org.custommonkey.xmlunitNamespaceContext

Javadoc

Interface used by XpathEngine in order to map prefixes to namespace URIs.

This is modelled after javax.xml.namespace.NamespaceContext but reduced to our needs.

Most used methods

  • getNamespaceURI
    Obtain the URI for a given prefix.Unlike the method in javax.xml.namespace.NamespaceContext doesn't
  • getPrefixes
    Get all prefixes of this context.

Popular in Java

  • Running tasks concurrently on multiple threads
  • putExtra (Intent)
  • getSharedPreferences (Context)
  • addToBackStack (FragmentTransaction)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now