Tabnine Logo
MapBasedNamespaceContext.setMapping
Code IndexAdd Tabnine to your IDE (free)

How to use
setMapping
method
in
com.helger.xml.namespace.MapBasedNamespaceContext

Best Java code snippets using com.helger.xml.namespace.MapBasedNamespaceContext.setMapping (Showing top 5 results out of 315)

origin: com.helger/ph-xml

/**
 * Set the default namespace URL
 *
 * @param sNamespaceURI
 *        The namespace URI to be used as the default. May not be
 *        <code>null</code> but maybe empty.
 * @return this
 */
@Nonnull
public final MapBasedNamespaceContext setDefaultNamespaceURI (@Nonnull final String sNamespaceURI)
{
 return setMapping (XMLConstants.DEFAULT_NS_PREFIX, sNamespaceURI);
}
origin: com.helger/ph-xml

@Nonnull
public final MapBasedNamespaceContext setMappings (@Nullable final Map <String, String> aOther)
{
 if (aOther != null)
  for (final Map.Entry <String, String> aEntry : aOther.entrySet ())
   setMapping (aEntry.getKey (), aEntry.getValue ());
 return this;
}
origin: com.helger/ph-bdve

public static void addMapping (@Nonnull final String sPrefix, @Nonnull final String sNamespaceURI)
{
 // Allow overwrite!
 s_aRWLock.writeLocked ( () -> s_aCtx.setMapping (sPrefix, sNamespaceURI));
}
origin: com.helger/ph-ebinterface

public EbInterfaceWriter (@Nonnull final EEbInterfaceDocumentType eDocType)
{
 super (eDocType);
 // Create a default namespace context for the passed document type
 final MapBasedNamespaceContext aNSContext = new MapBasedNamespaceContext ();
 aNSContext.setMapping ("eb", m_aDocType.getNamespaceURI ());
 setNamespaceContext (aNSContext);
}
origin: com.helger/ph-xml

public void writeNamespace (@Nullable final String sPrefix,
              @Nonnull final String sNamespaceURI) throws XMLStreamException
{
 debug ( () -> "writeNamespace (" + sPrefix + ", " + sNamespaceURI + ")");
 if (!m_bInElementStart)
  throw new IllegalStateException ("No element open");
 // Avoid double mapping
 final boolean bIsDefault = sPrefix == null ||
               sPrefix.equals (XMLConstants.DEFAULT_NS_PREFIX) ||
               sPrefix.equals (XMLConstants.XMLNS_ATTRIBUTE);
 if (bIsDefault)
  m_aNamespaceContext.m_aInternalContext.setDefaultNamespaceURI (sNamespaceURI);
 else
  m_aNamespaceContext.m_aInternalContext.setMapping (sPrefix, sNamespaceURI);
 if (bIsDefault)
  writeAttribute (null, null, XMLConstants.XMLNS_ATTRIBUTE, sNamespaceURI);
 else
  writeAttribute (XMLConstants.XMLNS_ATTRIBUTE, null, sPrefix, sNamespaceURI);
}
com.helger.xml.namespaceMapBasedNamespaceContextsetMapping

Javadoc

Add a new prefix to namespace mapping. If a prefix is already present it is overwritten.

Popular methods of MapBasedNamespaceContext

  • <init>
    Constructor with prefix to namespace URL map
  • addDefaultNamespaceURI
    Add the default namespace URL
  • addMapping
    Add a new prefix to namespace mapping. If a prefix is already present, an IllegalArgumentException i
  • addMappings
  • getPrefix
  • getClone
  • getNamespaceURI
  • getPrefixes
  • setMappings
  • _addMapping
  • getCustomNamespaceURI
  • getDefaultNamespaceURI
  • getCustomNamespaceURI,
  • getDefaultNamespaceURI,
  • getPrefixToNamespaceURIMap,
  • setDefaultNamespaceURI

Popular in Java

  • Making http post requests using okhttp
  • requestLocationUpdates (LocationManager)
  • getExternalFilesDir (Context)
  • findViewById (Activity)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • JButton (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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