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

How to use
Namespace
in
de.pdark.decentxml

Best Java code snippets using de.pdark.decentxml.Namespace (Showing top 15 results out of 315)

origin: de.pdark/decentxml

@Override
public boolean equals (Object obj)
{
  if (obj == null)
    return false;
  
  if (!(obj instanceof Namespace) )
    return false;
  
  Namespace ns = (Namespace)obj;
  return prefix.equals (ns.getPrefix ())
    && uri.equals (ns.getURI ())
  ;
}

origin: io.fabric8.forge/camel-tooling-util

protected Node replaceNamespace(Node node, String oldNS, String newNS) {
  if (node instanceof Element) {
    String ns = getNamespaceURI(node);
    if (ns != null && ns.equals(oldNS)) {
      Namespace namespace = ((Element) node).getNamespace();
      if (namespace != null) {
        if (namespace.getURI() != null && namespace.getURI().equals(oldNS)) {
          ((Element) node).setNamespace(new Namespace(namespace.getPrefix(), newNS));
        }
      }
      for (Attribute attr : ((Element) node).getAttributes()) {
        if (attr.getName().startsWith("xmlns")) {
          String value = attr.getValue();
          if (value != null && value.equals(oldNS)) {
            attr.setValue(newNS);
          }
        }
      }
    }
  }
  if (node instanceof NodeWithChildren) {
    for (Node n : ((NodeWithChildren) node).getNodes()) {
      replaceNamespace(n, oldNS, newNS);
    }
  }
  return node;
}
origin: de.pdark/decentxml

public void addNamespace (Namespace ns)
{
  map.put (ns.getPrefix (), ns);
}

origin: io.fabric8.forge/camel-tooling-util

List<Node> sessions = nodesByNamespace(doc, droolsNamespace.getURI(), "ksession");
if (sessions != null) {
  for (Node session : sessions) {
origin: de.pdark/decentxml

namespaces.addNamespace (new Namespace (name.substring (Namespace.NS_PREFIX.length ()), a.getValue ()));
origin: de.pdark/decentxml

  @Override
  public boolean matches (Node n)
  {
    if (!isElement (n))
      return false;
    
    Element e = (Element)n;
    
    boolean match = true;
    if (match && name != null && !e.getName ().equals (name))
      match = false;
    if (match && ns != null && !ns.equals (getNamespace ()))
      match = false;
    
    return match;
  }
};
origin: jboss-fuse/fabric8

protected Node replaceNamespace(Node node, String oldNS, String newNS) {
  if (node instanceof Element) {
    String ns = getNamespaceURI(node);
    if (ns != null && ns.equals(oldNS)) {
      Namespace namespace = ((Element) node).getNamespace();
      if (namespace != null) {
        if (namespace.getURI() != null && namespace.getURI().equals(oldNS)) {
          ((Element) node).setNamespace(new Namespace(namespace.getPrefix(), newNS));
        }
      }
      for (Attribute attr : ((Element) node).getAttributes()) {
        if (attr.getName().startsWith("xmlns")) {
          String value = attr.getValue();
          if (value != null && value.equals(oldNS)) {
            attr.setValue(newNS);
          }
        }
      }
    }
  }
  if (node instanceof NodeWithChildren) {
    for (Node n : ((NodeWithChildren) node).getNodes()) {
      replaceNamespace(n, oldNS, newNS);
    }
  }
  return node;
}
origin: de.pdark/decentxml

public Attribute getAttribute (String name, Namespace ns)
{
  if (ns == null || ns.getPrefix ().length () == 0)
    return getAttribute (name);
  
  return getAttribute (ns.getPrefix ()+":"+name);
}

origin: jboss-fuse/fabric8

List<Node> sessions = nodesByNamespace(doc, droolsNamespace.getURI(), "ksession");
if (sessions != null) {
  for (Node session: sessions) {
origin: de.pdark/decentxml

  && (ns == null || ns.equals (getNamespace ()))
        && (ns2 == null || ns2.equals (e.getNamespace ())))
if (ns != null && !ns.equals (current.getNamespace ()))
  return null;
origin: jboss-fuse/fabric8

public static String getNamespaceURI(Node node) {
  if (node instanceof Element) {
    Namespace ns = ((Element) node).getNamespace();
    if (ns != null) {
      String uri = ns.getURI();
      if (uri == null || uri.length() == 0) {
        String uriAttr = ns.getPrefix().equals("") ? ((Element) node).getAttributeValue("xmlns") : null;
        if (uriAttr != null) {
          return uriAttr;
        } else {
          return getNamespaceURI(((Element) node).getParent());
        }
      } else {
        return uri;
      }
    }
  }
  return null;
}
origin: de.pdark/decentxml

if (parent.getNamespace ().getPrefix ().length () != 0)
  elementName = parent.getNamespace ().getPrefix () + ":" + elementName;
origin: de.pdark/decentxml

  && (ns == null || ns.equals (getRootElement ().getNamespace ()))
|| (ns2 != null && !ns2.equals (getRootElement ().getNamespace ()))
origin: io.fabric8.forge/camel-tooling-util

public static String getNamespaceURI(Node node) {
  if (node instanceof Element) {
    Namespace ns = ((Element) node).getNamespace();
    if (ns != null) {
      String uri = ns.getURI();
      if (uri == null || uri.length() == 0) {
        String uriAttr = ns.getPrefix().equals("") ? ((Element) node).getAttributeValue("xmlns") : null;
        if (uriAttr != null) {
          return uriAttr;
        } else {
          return getNamespaceURI(((Element) node).getParent());
        }
      } else {
        return uri;
      }
    }
  }
  return null;
}
origin: de.pdark/decentxml

@Override
public BasicNode toXML (XMLWriter writer) throws IOException
{
  writer.write (this, getPreSpace ());
  String prefix = getNamespace ().getPrefix ();
  if (prefix.length () != 0)
  {
    writer.write (this, prefix);
    writer.write (this, ":");
  }
  writer.write (this, getName ());
  writer.write (this, getEqualsSpace ());
  
  char[] buffer = new char[1];
  buffer[0] = (char)quoteChar;
  String s = new String (buffer);
  writer.write (this, s);
  if (rawValue != null)
    writer.write (this, rawValue);
  else
    writer.writeAttributeValue (this, getValue (), quoteChar);
  writer.write (this, s);
  
  return this;
}

de.pdark.decentxmlNamespace

Most used methods

  • <init>
  • getPrefix
  • getURI
  • equals

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setScale (BigDecimal)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Notification (javax.management)
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Top Vim 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