Tabnine Logo
NamespaceElement
Code IndexAdd Tabnine to your IDE (free)

How to use
NamespaceElement
in
org.jibx.binding.model

Best Java code snippets using org.jibx.binding.model.NamespaceElement (Showing top 9 results out of 315)

origin: apache/axis2-java

/**
 * Add mapping from namespace URI to prefix. In the case where multiple prefixes are used with a
 * single URI, this will preserve the last non-empty prefix for that URI.
 *
 * @param ns     namespace definition
 * @param dfltns flag for default namespace used in binding
 * @param nsmap  map from namespace URIs to prefixes
 * @return flag for default namespace used in binding
 */
private boolean mapNamespace(NamespaceElement ns, boolean dfltns, Map nsmap) {
  String prefix = ns.getPrefix();
  if (prefix == null) {
    prefix = "";
  }
  String prior = (String)nsmap.get(ns.getUri());
  if (prior != null) {
    if (prefix.length() == 0) {
      return dfltns;
    } else if (prior.length() == 0) {
      dfltns = false;
    }
  }
  nsmap.put(ns.getUri(), prefix);
  return dfltns || prefix.length() == 0;
}
origin: org.apache.axis2/axis2-jibx

/**
 * Find the default namespace within a list of JiBX binding model elements possibly including
 * namespace definitions. Once a non-namespace definition element is seen in the list, this just
 * returns (since the namespace definitions always come first in JiBX's binding format).
 *
 * @param iter iterator for elements in list
 * @param dns  default namespace if not overridden
 * @return default namespace
 */
private static String findDefaultNS(Iterator iter, String dns) {
  while (iter.hasNext()) {
    ElementBase child = (ElementBase)iter.next();
    if (child.type() == ElementBase.NAMESPACE_ELEMENT) {
      NamespaceElement namespace = (NamespaceElement)child;
      String defaultName = namespace.getDefaultName();
      if ("elements".equals(defaultName) || "all".equals(defaultName)) {
        return namespace.getUri();
      }
    } else {
      break;
    }
  }
  return dns;
}
origin: org.apache.cxf/cxf-rt-databinding-jibx

  public boolean visit(MappingElement mapping) {
    org.jibx.runtime.QName qname = mapping.getTypeQName();
    if (qname != null) {
      types.put(qname, mapping);
    }
    String name = mapping.getName();
    if (name != null) {
      NamespaceElement ns = mapping.getNamespace();
      if (ns == null) {
        qname = new org.jibx.runtime.QName(holder.getElementDefaultNamespace(), name);
      } else {
        qname = new org.jibx.runtime.QName(mapping.getNamespace().getUri(), name);
      }
      elems.put(qname, mapping);
    }
    return false;
  }
};
origin: org.jibx/jibx-tools

if (((NamespaceElement)child).getPrefix() == null) {
  return true;
origin: org.jibx/jibx-tools

QName qname = new QName(mapping.getNamespace().getUri(), mapping.getName());
elemmap.put(cname, qname);
if (s_logger.isDebugEnabled()) {
origin: org.apache.axis2/axis2-jibx

/**
 * Add mapping from namespace URI to prefix. In the case where multiple prefixes are used with a
 * single URI, this will preserve the last non-empty prefix for that URI.
 *
 * @param ns     namespace definition
 * @param dfltns flag for default namespace used in binding
 * @param nsmap  map from namespace URIs to prefixes
 * @return flag for default namespace used in binding
 */
private boolean mapNamespace(NamespaceElement ns, boolean dfltns, Map nsmap) {
  String prefix = ns.getPrefix();
  if (prefix == null) {
    prefix = "";
  }
  String prior = (String)nsmap.get(ns.getUri());
  if (prior != null) {
    if (prefix.length() == 0) {
      return dfltns;
    } else if (prior.length() == 0) {
      dfltns = false;
    }
  }
  nsmap.put(ns.getUri(), prefix);
  return dfltns || prefix.length() == 0;
}
origin: apache/axis2-java

/**
 * Find the default namespace within a list of JiBX binding model elements possibly including
 * namespace definitions. Once a non-namespace definition element is seen in the list, this just
 * returns (since the namespace definitions always come first in JiBX's binding format).
 *
 * @param iter iterator for elements in list
 * @param dns  default namespace if not overridden
 * @return default namespace
 */
private static String findDefaultNS(Iterator iter, String dns) {
  while (iter.hasNext()) {
    ElementBase child = (ElementBase)iter.next();
    if (child.type() == ElementBase.NAMESPACE_ELEMENT) {
      NamespaceElement namespace = (NamespaceElement)child;
      String defaultName = namespace.getDefaultName();
      if ("elements".equals(defaultName) || "all".equals(defaultName)) {
        return namespace.getUri();
      }
    } else {
      break;
    }
  }
  return dns;
}
origin: org.jibx/jibx-tools

QName qname = new QName(mapping.getNamespace().getUri(), mapping.getName());
elemmap.put(qname, data);
if (s_logger.isDebugEnabled()) {
origin: org.jibx/jibx-tools

  NamespaceElement dfltns = map.getDefinitions().getElementDefaultNamespace();
  if (dfltns != null) {
    tname = new QName(dfltns.getUri(), custom.getTypeQName().getName());
  } else {
    tname = custom.getTypeQName();
  oname = custom.getElementQName();
} else {
  oname = new QName(map.getNamespace().getUri(), name);
org.jibx.binding.modelNamespaceElement

Most used methods

  • getUri
  • getPrefix
  • getDefaultName

Popular in Java

  • Updating database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSupportFragmentManager (FragmentActivity)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Top PhpStorm 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