Codota Logo
Namespace
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
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

  • Start an intent from android
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • addToBackStack (FragmentTransaction)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • JFileChooser (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now