nu.xom.Element.getParent()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(310)

本文整理了Java中nu.xom.Element.getParent()方法的一些代码示例,展示了Element.getParent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getParent()方法的具体详情如下:
包路径:nu.xom.Element
类名称:Element
方法名:getParent

Element.getParent介绍

暂无

代码示例

代码示例来源:origin: com.thoughtworks.xstream/xstream

  1. protected Object getParent() {
  2. return currentElement.getParent();
  3. }

代码示例来源:origin: jaxen/jaxen

  1. public Iterator getNamespaceAxisIterator(Object o)
  2. {
  3. if (! isElement(o)) {
  4. return JaxenConstants.EMPTY_ITERATOR;
  5. }
  6. Map nsMap = new HashMap();
  7. Element elt = (Element)o;
  8. ParentNode parent = elt;
  9. while (parent instanceof Element) {
  10. elt = (Element)parent;
  11. String uri = elt.getNamespaceURI();
  12. String prefix = elt.getNamespacePrefix();
  13. addNamespaceForElement(elt, uri, prefix, nsMap);
  14. int count = elt.getNamespaceDeclarationCount();
  15. for (int i = 0; i < count; i++) {
  16. prefix = elt.getNamespacePrefix(i);
  17. uri = elt.getNamespaceURI(prefix);
  18. addNamespaceForElement(elt, uri, prefix, nsMap);
  19. }
  20. parent = elt.getParent();
  21. }
  22. addNamespaceForElement(elt, "http://www.w3.org/XML/1998/namespace", "xml", nsMap);
  23. return nsMap.values().iterator();
  24. }
  25. }

代码示例来源:origin: x-stream/xstream

  1. @Override
  2. protected Object getParent() {
  3. return currentElement.getParent();
  4. }

代码示例来源:origin: edu.internet2.middleware.grouper/grouperClient

  1. protected Object getParent() {
  2. return currentElement.getParent();
  3. }

代码示例来源:origin: com.haulmont.thirdparty/xstream

  1. protected Object getParent() {
  2. return currentElement.getParent();
  3. }

代码示例来源:origin: ovea-deprecated/jetty-session-redis

  1. protected Object getParent() {
  2. return currentElement.getParent();
  3. }

代码示例来源:origin: org.jvnet.hudson/xstream

  1. protected Object getParent() {
  2. return currentElement.getParent();
  3. }

代码示例来源:origin: org.sonatype.nexus.xstream/xstream

  1. protected Object getParent() {
  2. return currentElement.getParent();
  3. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream

  1. protected Object getParent() {
  2. return currentElement.getParent();
  3. }

代码示例来源:origin: org.concordion/concordion

  1. /**
  2. * Returns the element that contains this element, or null if this element is the root element or
  3. * is orphaned.
  4. *
  5. * @return Element
  6. */
  7. public Element getParentElement() {
  8. ParentNode parent = xomElement.getParent();
  9. if (parent == null || parent instanceof Document) {
  10. return null;
  11. }
  12. return new Element((nu.xom.Element) parent);
  13. }

代码示例来源:origin: concordion/concordion

  1. /**
  2. * Returns the element that contains this element, or null if this element is the root element or
  3. * is orphaned.
  4. *
  5. * @return Element
  6. */
  7. public Element getParentElement() {
  8. ParentNode parent = xomElement.getParent();
  9. if (parent == null || parent instanceof Document) {
  10. return null;
  11. }
  12. return new Element((nu.xom.Element) parent);
  13. }

代码示例来源:origin: concordion/concordion

  1. public void appendSister(Element element) {
  2. nu.xom.Element xomParentElement = (nu.xom.Element) xomElement.getParent();
  3. int elementIndex = xomParentElement.indexOf(xomElement);
  4. xomParentElement.insertChild(element.xomElement, elementIndex + 1);
  5. }

代码示例来源:origin: org.concordion/concordion

  1. public void appendSister(Element element) {
  2. nu.xom.Element xomParentElement = (nu.xom.Element) xomElement.getParent();
  3. int elementIndex = xomParentElement.indexOf(xomElement);
  4. xomParentElement.insertChild(element.xomElement, elementIndex + 1);
  5. }

代码示例来源:origin: org.teiid/saxon-xom

  1. public Nodes finishMakingElement(Element element) {
  2. flush();
  3. try {
  4. serializer.writeEndTag();
  5. } catch (IOException e) {
  6. throw new RuntimeException(e);
  7. }
  8. if (element.getParent() instanceof Document) {
  9. return new Nodes(element);
  10. }
  11. return NONE;
  12. }

代码示例来源:origin: teiid/teiid

  1. public Nodes finishMakingElement(Element element) {
  2. flush();
  3. try {
  4. serializer.writeEndTag();
  5. } catch (IOException e) {
  6. throw new RuntimeException(e);
  7. }
  8. if (element.getParent() instanceof Document) {
  9. return new Nodes(element);
  10. }
  11. return NONE;
  12. }

代码示例来源:origin: org.codehaus.mojo/emma-maven-plugin

  1. /**
  2. * Get full class name (package + class) for "class" XML element.
  3. *
  4. * @param elem The element.
  5. * @return the full class name (package + class) for "class" XML element.
  6. */
  7. private String fullClassName( Element elem )
  8. {
  9. final Element packageElem = (Element) elem.getParent().getParent();
  10. final String packageName = packageElem.getAttributeValue( "name" );
  11. final String className = elem.getAttributeValue( "name" );
  12. return packageName.length() != 0 ? packageName + "." + className : className;
  13. }

代码示例来源:origin: org.xml-cml/cmlxom

  1. public static void detach(nu.xom.Element element) {
  2. ParentNode parent = (element == null) ? null : element.getParent();
  3. if (parent != null) {
  4. if (parent instanceof Document) {
  5. parent.replaceChild(element, new Element(DUMMY));
  6. } else {
  7. element.detach();
  8. }
  9. }
  10. }

代码示例来源:origin: nu.validator/htmlparser

  1. @Override protected void insertFosterParentedChild(Element child,
  2. Element table, Element stackParent) throws SAXException {
  3. try {
  4. Node parent = table.getParent();
  5. if (parent != null) { // always an element if not null
  6. ((ParentNode)parent).insertChild(child, indexOfTable(table, stackParent));
  7. cachedTableIndex++;
  8. } else {
  9. stackParent.appendChild(child);
  10. }
  11. } catch (XMLException e) {
  12. fatal(e);
  13. }
  14. }

代码示例来源:origin: validator/htmlparser

  1. @Override protected void insertFosterParentedChild(Element child,
  2. Element table, Element stackParent) throws SAXException {
  3. try {
  4. Node parent = table.getParent();
  5. if (parent != null) { // always an element if not null
  6. ((ParentNode)parent).insertChild(child, indexOfTable(table, stackParent));
  7. cachedTableIndex++;
  8. } else {
  9. stackParent.appendChild(child);
  10. }
  11. } catch (XMLException e) {
  12. fatal(e);
  13. }
  14. }

代码示例来源:origin: nu.validator.htmlparser/htmlparser

  1. @Override protected void insertFosterParentedChild(Element child,
  2. Element table, Element stackParent) throws SAXException {
  3. try {
  4. Node parent = table.getParent();
  5. if (parent != null) { // always an element if not null
  6. ((ParentNode)parent).insertChild(child, indexOfTable(table, stackParent));
  7. cachedTableIndex++;
  8. } else {
  9. stackParent.appendChild(child);
  10. }
  11. } catch (XMLException e) {
  12. fatal(e);
  13. }
  14. }

相关文章