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

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

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

origin: com.helger/ph-xml

/**
 * Add 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 addDefaultNamespaceURI (@Nonnull final String sNamespaceURI)
{
 return addMapping (XMLConstants.DEFAULT_NS_PREFIX, sNamespaceURI);
}
origin: com.helger/ph-xml

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

public void setPrefix (@Nonnull final String sPrefix, @Nonnull final String sUri) throws XMLStreamException
{
 debug ( () -> "setPrefix (" + sPrefix + ", " + sUri + ")");
 m_aNamespaceContext.m_aInternalContext.addMapping (sPrefix, sUri);
}
origin: com.helger/ph-bdve-peppol

@Nonnull
@ReturnsMutableObject
private static MapBasedNamespaceContext _createUBLNSContext (@Nonnull final String sNamespaceURI)
{
 final MapBasedNamespaceContext aNSContext = UBL21NamespaceContext.getInstance ().getClone ();
 // Add the default mapping for the root namespace
 aNSContext.addMapping (XMLConstants.DEFAULT_NS_PREFIX, sNamespaceURI);
 // For historical reasons, the "ubl" prefix is also mapped to this
 // namespace URI
 aNSContext.addMapping ("ubl", sNamespaceURI);
 return aNSContext;
}
origin: com.helger/peppol-commons

 public AbstractSMPMarshaller (@Nonnull final Class <JAXBTYPE> aType,
                @Nonnull final IFunction <JAXBTYPE, JAXBElement <JAXBTYPE>> aWrapper)
 {
  super (aType,
      isValidationEnabled () ? new CommonsArrayList <> (CXMLDSig.getXSDResource (), XSD1, XSD2, XSD3) : null,
      aWrapper);

  final MapBasedNamespaceContext aNSContext = new MapBasedNamespaceContext ();
  aNSContext.addMapping ("smp", ObjectFactory._ServiceGroup_QNAME.getNamespaceURI ());
  aNSContext.addMapping ("ds", "http://www.w3.org/2000/09/xmldsig#");
  setNamespaceContext (aNSContext);
 }
}
origin: com.helger/peppol-commons

 public AbstractBDXRMarshaller (@Nonnull final Class <JAXBTYPE> aType,
                 @Nonnull final IFunction <JAXBTYPE, JAXBElement <JAXBTYPE>> aWrapper)
 {
  super (aType, isValidationEnabled () ? new CommonsArrayList <> (CXMLDSig.getXSDResource (), XSD) : null, aWrapper);

  final MapBasedNamespaceContext aNSContext = new MapBasedNamespaceContext ();
  aNSContext.addMapping ("bdxr", ObjectFactory._ServiceGroup_QNAME.getNamespaceURI ());
  aNSContext.addMapping ("ds", "http://www.w3.org/2000/09/xmldsig#");
  setNamespaceContext (aNSContext);
 }
}
origin: com.helger/ph-schematron

/**
 * @return All contained namespaces as a single namespace context
 */
@Nonnull
@ReturnsMutableCopy
public MapBasedNamespaceContext getAsNamespaceContext ()
{
 final MapBasedNamespaceContext ret = new MapBasedNamespaceContext ();
 for (final PSNS aNS : m_aNSs)
  ret.addMapping (aNS.getPrefix (), aNS.getUri ());
 return ret;
}
origin: com.helger/ph-genericode

public GenericodeWriter (@Nonnull final EGenericodeDocumentType eDocType)
{
 super (eDocType);
 // Create a special namespace context for the passed document type
 final MapBasedNamespaceContext aNSContext = new MapBasedNamespaceContext ();
 aNSContext.addMapping ("gc", m_aDocType.getNamespaceURI ());
 aNSContext.addDefaultNamespaceURI ("");
 setNamespaceContext (aNSContext);
}
origin: phax/ph-schematron

/**
 * @return All contained namespaces as a single namespace context
 */
@Nonnull
@ReturnsMutableCopy
public MapBasedNamespaceContext getAsNamespaceContext ()
{
 final MapBasedNamespaceContext ret = new MapBasedNamespaceContext ();
 for (final PSNS aNS : m_aNSs)
  ret.addMapping (aNS.getPrefix (), aNS.getUri ());
 return ret;
}
origin: com.helger/ph-asic

 /**
  * Create a writer builder for Manifest.
  *
  * @return The builder and never <code>null</code>
  */
 @Nonnull
 public static AsicWriter <Manifest> oasisManifest ()
 {
  final AsicWriter <Manifest> ret = new AsicWriter <> (EAsicDocumentType.MANIFEST);
  final MapBasedNamespaceContext aCtx = new MapBasedNamespaceContext ();
  // Not default namespace because attribute form is qualified!
  aCtx.addMapping ("manifest", "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0");
  ret.setNamespaceContext (aCtx);
  ret.setFormattedOutput (true);
  return ret;
 }
}
origin: phax/ph-schematron

final MapBasedNamespaceContext aNSContext = new MapBasedNamespaceContext ().addMapping ("svrl",
                                            CSVRL.SVRL_NAMESPACE_URI);
              (sAttrName, sAttrValue) -> {
               if (sAttrName.startsWith (sNSPrefix))
                aNSContext.addMapping (sAttrName.substring (sNSPrefix.length ()),
                            sAttrValue);
              });
com.helger.xml.namespaceMapBasedNamespaceContextaddMapping

Javadoc

Add a new prefix to namespace mapping. If a prefix is already present, an IllegalArgumentException is thrown.

Popular methods of MapBasedNamespaceContext

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

Popular in Java

  • Creating JSON documents from java classes using gson
  • onCreateOptionsMenu (Activity)
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • JTextField (javax.swing)
  • Github Copilot alternatives
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