congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Parent
Code IndexAdd Tabnine to your IDE (free)

How to use
Parent
in
org.jdom2

Best Java code snippets using org.jdom2.Parent (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: org.jdom/jdom

/**
 * Determines if this element is the ancestor of another element.
 *
 * @param element <code>Element</code> to check against
 * @return <code>true</code> if this element is the ancestor of the
 *         supplied element
 */
public boolean isAncestor(final Element element) {
  Parent p = element.getParent();
  while (p instanceof Element) {
    if (p == this) {
      return true;
    }
    p = p.getParent();
  }
  return false;
}

origin: org.jdom/jdom

/**
 * Detaches this child from its parent or does nothing if the child
 * has no parent.
 * <p>
 * This method can be overridden by particular Content subclasses to return
 * a specific type of Content (co-variant return type). All overriding
 * subclasses <b>must</b> call <code>super.detach()</code>;
 *
 * @return this child detached
 */
public Content detach() {
  if (parent != null) {
    parent.removeContent(this);
  }
  return this;
}
origin: org.jdom/jdom

@Override
public final Iterator<?> getChildAxisIterator(Object contextNode) throws UnsupportedAxisException {
  if (contextNode instanceof Parent) {
    return ((Parent)contextNode).getContent().iterator();
  }
  return JaxenConstants.EMPTY_ITERATOR;
}
origin: org.jdom/jdom

/**
 * Check and add the <code>Content</code> to this list at the given index.
 * Inserts the specified object at the specified position in this list.
 * Shifts the object currently at that position (if any) and any subsequent
 * objects to the right (adds one to their indices).
 * 
 * @param index
 *        index where to add <code>Element</code>
 * @param child
 *        <code>Content</code> to add
 */
@Override
public void add(final int index, final Content child) {
  // Confirm basic sanity of child.
  checkPreConditions(child, index, false);
  // Check to see whether this parent believes it can contain this content
  parent.canContainContent(child, index, false);
  child.setParent(parent);
  ensureCapacity(size + 1);
  if (index == size) {
    elementData[size++] = child;
  } else {
    System.arraycopy(elementData, index, elementData, index + 1, size - index);
    elementData[index] = child;
    size++;
  }
  // Successful add's increment the AbstractList's modCount
  incModCount();
}
origin: org.jdom/jdom

/**
 * Return this child's owning document or null if the branch containing
 * this child is currently not attached to a document.
 *
 * @return this child's owning document or null if none
 */
public Document getDocument() {
  if (parent == null) return null;
  return parent.getDocument();
}
origin: org.jdom/jdom

/**
 * Set the object at the specified location to the supplied object.
 * 
 * @param index
 *        The location to set the value to.
 * @param child
 *        The location to set the value to.
 * @return The object which was replaced. throws IndexOutOfBoundsException
 *         if index < 0 || index >= size()
 */
@Override
public Content set(final int index, final Content child) {
  // Confirm basic sanity of child.
  checkPreConditions(child, index, true);
  // Ensure the detail checks out OK too.
  parent.canContainContent(child, index, true);
  /*
   * Do a special case of set() where we don't do a remove() then add()
   * because that affects the modCount. We want to do a true set(). See
   * issue #15
   */
  final Content old = elementData[index];
  removeParent(old);
  child.setParent(parent);
  elementData[index] = child;
  // for set method we increment dataModCount, but not modCount
  // set does not change the structure of the List (size())
  incDataModOnly();
  return old;
}
origin: org.jdom/jdom

  return ret;
p = p.getParent();
origin: geotools/geotools

parent.removeContent(element);
origin: org.jdom/jdom

/**
 * Iterator for the descendants of the supplied object.
 *
 * @param parent document or element whose descendants will be iterated
 */
DescendantIterator(Parent parent) {
  this.parent = parent;
  // can trust that parent is not null, DescendantIterator is package-private.
  current = parent.getContent().iterator();
  hasnext = current.hasNext();
}

origin: net.sf.cuf/cuf-swing

while ((current= current.getParent()) instanceof Element);
origin: apache/marmotta

protected void generateForeignMarkup(Element e, List foreignMarkup) {
  if (foreignMarkup != null) {
    Iterator elems = (Iterator) foreignMarkup.iterator();
    while (elems.hasNext()) {
      Element elem = (Element) elems.next();
      Parent parent = elem.getParent();
      if (parent != null) {
        parent.removeContent(elem);
      }
      e.addContent(elem);
    }
  }
}
origin: rometools/rome

/**
 * Use xml:base attributes at feed and entry level to resolve relative links
 */
private static String resolveURI(final URL baseURI, final Parent parent, String url) {
  url = url.equals(".") || url.equals("./") ? "" : url;
  if (isRelativeURI(url) && parent != null && parent instanceof Element) {
    final Attribute baseAtt = ((Element) parent).getAttribute("base", Namespace.XML_NAMESPACE);
    String xmlBase = baseAtt == null ? "" : baseAtt.getValue();
    if (!isRelativeURI(xmlBase) && !xmlBase.endsWith("/")) {
      xmlBase = xmlBase.substring(0, xmlBase.lastIndexOf("/") + 1);
    }
    return resolveURI(baseURI, parent.getParent(), xmlBase + url);
  } else if (isRelativeURI(url) && parent == null) {
    return baseURI + url;
  } else if (baseURI != null && url.startsWith("/")) {
    String hostURI = baseURI.getProtocol() + "://" + baseURI.getHost();
    if (baseURI.getPort() != baseURI.getDefaultPort()) {
      hostURI = hostURI + ":" + baseURI.getPort();
    }
    return hostURI + url;
  }
  return url;
}
origin: org.apache.marmotta/sesame-tools-rio-rss

protected void generateForeignMarkup(Element e, List foreignMarkup) {
  if (foreignMarkup != null) {
    Iterator elems = (Iterator) foreignMarkup.iterator();
    while (elems.hasNext()) {
      Element elem = (Element) elems.next();
      Parent parent = elem.getParent();
      if (parent != null) {
        parent.removeContent(elem);
      }
      e.addContent(elem);
    }
  }
}
origin: org.apache.marmotta/sesame-tools-rio-rss

/** Use xml:base attributes at feed and entry level to resolve relative links */
private static String resolveURI(URL baseURI, Parent parent, String url) {
  url = (url.equals(".") || url.equals("./")) ? "" : url;
  if (isRelativeURI(url) && parent != null && parent instanceof Element) {
    Attribute baseAtt = ((Element)parent).getAttribute("base", Namespace.XML_NAMESPACE);
    String xmlBase = (baseAtt == null) ? "" : baseAtt.getValue();
    if (!isRelativeURI(xmlBase) && !xmlBase.endsWith("/")) {
      xmlBase = xmlBase.substring(0, xmlBase.lastIndexOf("/")+1);
    }
    return resolveURI(baseURI, parent.getParent(), xmlBase + url);
  } else if (isRelativeURI(url) && parent == null) {
    return baseURI + url;
  } else if (baseURI != null && url.startsWith("/")) {
    String hostURI = baseURI.getProtocol() + "://" + baseURI.getHost();
    if (baseURI.getPort() != baseURI.getDefaultPort()) {
      hostURI = hostURI + ":" + baseURI.getPort();
    }
    return hostURI + url;
  }
  return url;
}

origin: com.rometools/rome

protected void generateForeignMarkup(final Element element, final List<Element> foreignElements) {
  if (foreignElements != null) {
    for (final Element foreignElement : foreignElements) {
      final Parent parent = foreignElement.getParent();
      if (parent != null) {
        parent.removeContent(foreignElement);
      }
      element.addContent(foreignElement);
    }
  }
}
origin: apache/marmotta

/** Use xml:base attributes at feed and entry level to resolve relative links */
private static String resolveURI(URL baseURI, Parent parent, String url) {
  url = (url.equals(".") || url.equals("./")) ? "" : url;
  if (isRelativeURI(url) && parent != null && parent instanceof Element) {
    Attribute baseAtt = ((Element)parent).getAttribute("base", Namespace.XML_NAMESPACE);
    String xmlBase = (baseAtt == null) ? "" : baseAtt.getValue();
    if (!isRelativeURI(xmlBase) && !xmlBase.endsWith("/")) {
      xmlBase = xmlBase.substring(0, xmlBase.lastIndexOf("/")+1);
    }
    return resolveURI(baseURI, parent.getParent(), xmlBase + url);
  } else if (isRelativeURI(url) && parent == null) {
    return baseURI + url;
  } else if (baseURI != null && url.startsWith("/")) {
    String hostURI = baseURI.getProtocol() + "://" + baseURI.getHost();
    if (baseURI.getPort() != baseURI.getDefaultPort()) {
      hostURI = hostURI + ":" + baseURI.getPort();
    }
    return hostURI + url;
  }
  return url;
}

origin: rometools/rome

protected void generateForeignMarkup(final Element element, final List<Element> foreignElements) {
  if (foreignElements != null) {
    for (final Element foreignElement : foreignElements) {
      final Parent parent = foreignElement.getParent();
      if (parent != null) {
        parent.removeContent(foreignElement);
      }
      element.addContent(foreignElement);
    }
  }
}
origin: com.rometools/rome-modules

/**
 * Use xml:base attributes at feed and entry level to resolve relative links
 */
private static String resolveURI(final URL baseURI, final Parent parent, String url) {
  url = url.equals(".") || url.equals("./") ? "" : url;
  if (isRelativeURI(url) && parent != null && parent instanceof Element) {
    final Attribute baseAtt = ((Element) parent).getAttribute("base", Namespace.XML_NAMESPACE);
    String xmlBase = baseAtt == null ? "" : baseAtt.getValue();
    if (!isRelativeURI(xmlBase) && !xmlBase.endsWith("/")) {
      xmlBase = xmlBase.substring(0, xmlBase.lastIndexOf("/") + 1);
    }
    return resolveURI(baseURI, parent.getParent(), xmlBase + url);
  } else if (isRelativeURI(url) && parent == null) {
    return baseURI + url;
  } else if (baseURI != null && url.startsWith("/")) {
    String hostURI = baseURI.getProtocol() + "://" + baseURI.getHost();
    if (baseURI.getPort() != baseURI.getDefaultPort()) {
      hostURI = hostURI + ":" + baseURI.getPort();
    }
    return hostURI + url;
  }
  return url;
}
origin: org.apache.marmotta/sesame-tools-rio-rss

  } else {
    return resolveURI(baseURI, parent.getParent(), 
      stripTrailingSlash(xmlbase) + "/"+ stripStartingSlash(url));
return resolveURI(baseURI, parent.getParent(), url);
origin: rometools/rome

  } else {
    return resolveURI(baseURI, parent.getParent(), stripTrailingSlash(xmlbase) + "/" + stripStartingSlash(url));
return resolveURI(baseURI, parent.getParent(), url);
org.jdom2Parent

Javadoc

Interface for JDOM objects which are allowed to contain Content content - Element and Document.

Most used methods

  • getParent
    Return this parent's parent, or null if this parent is currently not attached to another parent. Thi
  • removeContent
    Removes from this parent all child content matching the given filter and returns a list of the detac
  • canContainContent
    Test whether this Parent instance can contain the specified content at the specified position.
  • getContent
    Returns as a java.util.List the content of this parent that matches the supplied filter. The returne
  • getDocument
    Return this parent's owning document or null if the branch containing this parent is currently not a
  • indexOf
    Returns the index of the supplied child in the content list, or -1 if not a child of this parent.

Popular in Java

  • Reactive rest calls using spring rest template
  • startActivity (Activity)
  • getContentResolver (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • JTextField (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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