Class TracerConfigNamespaceContextImpl

java.lang.Object
de.christofreichardt.diagnosis.TracerConfigNamespaceContextImpl
All Implemented Interfaces:
NamespaceContext

public class TracerConfigNamespaceContextImpl extends Object implements NamespaceContext
Since the TracerFactory uses XPath to access the XML configuration involving namespaces an implementation of the NamespaceContext interface is necessary. The implementation is simplified as only the namespace "http://www.christofreichardt.de/java/tracer" and the prefix "dns" will be considered.
Author:
Christof Reichardt
  • Constructor Details

    • TracerConfigNamespaceContextImpl

      public TracerConfigNamespaceContextImpl()
      default constructor.
  • Method Details

    • getNamespaceURI

      public String getNamespaceURI(String prefix)
      Returns the fixed namespace URI for the prefix "dns". Other prefixes will cause an IllegalArgumentException.
      Specified by:
      getNamespaceURI in interface NamespaceContext
      Parameters:
      prefix - the namespace prefix
      Returns:
      the URI "http://www.christofreichardt.de/java/tracer"
    • getPrefix

      public String getPrefix(String namespaceURI)
      Returns the prefix for the fixed namespace "http://www.christofreichardt.de/java/tracer". Other namespaces will cause an IllegalArgumentException.
      Specified by:
      getPrefix in interface NamespaceContext
      Parameters:
      namespaceURI - the namespace URI
      Returns:
      the prefix "dns"
    • getPrefixes

      public TracerConfigNamespaceContextImpl.Iterator getPrefixes(String namespaceURI)
      Returns a special iterator implementation.
      Specified by:
      getPrefixes in interface NamespaceContext
      Parameters:
      namespaceURI - the namespace URI
      Returns:
      an iterator