Package org.dom4j

Examples of org.dom4j.Element


    return answer;
  }

  protected Element createElement(QName qName) {
    Element answer = getDocumentFactory().createElement(qName);
    answer.setData(getCopyOfUserData());

    return answer;
  }
View Full Code Here


    CharacterData {
  public AbstractCharacterData() {
  }

  public String getPath(Element context) {
    Element parent = getParent();

    return ((parent != null) && (parent != context)) ? (parent
        .getPath(context) + "/text()") : "text()";
  }
View Full Code Here

    return ((parent != null) && (parent != context)) ? (parent
        .getPath(context) + "/text()") : "text()";
  }

  public String getUniquePath(Element context) {
    Element parent = getParent();

    return ((parent != null) && (parent != context)) ? (parent
        .getUniquePath(context) + "/text()") : "text()";
  }
View Full Code Here

    return NodeType.COMMENT_NODE;
  }

  @Override
  public String getPath(Element context) {
    Element parent = getParent();

    return ((parent != null) && (parent != context)) ? (parent
        .getPath(context) + "/comment()") : "comment()";
  }
View Full Code Here

        .getPath(context) + "/comment()") : "comment()";
  }

  @Override
  public String getUniquePath(Element context) {
    Element parent = getParent();

    return ((parent != null) && (parent != context)) ? (parent
        .getUniquePath(context) + "/comment()") : "comment()";
  }
View Full Code Here

  public NodeType getNodeTypeEnum() {
    return NodeType.PROCESSING_INSTRUCTION_NODE;
  }

  public String getPath(Element context) {
    Element parent = getParent();

    return ((parent != null) && (parent != context)) ? (parent.getPath(context) + "/processing-instruction()")
        : "processing-instruction()";
  }
View Full Code Here

    return ((parent != null) && (parent != context)) ? (parent.getPath(context) + "/processing-instruction()")
        : "processing-instruction()";
  }

  public String getUniquePath(Element context) {
    Element parent = getParent();

    return ((parent != null) && (parent != context)) ? (parent.getUniquePath(context) + "/processing-instruction()")
        : "processing-instruction()";
  }
View Full Code Here

      } else {
        String start = text.substring(0, offset);
        String rest = text.substring(offset);
        setText(start);

        Element parent = getParent();
        CDATA newText = createCDATA(rest);

        if (parent != null) {
          parent.add(newText);
        }

        return DOMNodeHelper.asDOMText(newText);
      }
    }
View Full Code Here

    public Node getJobNode(Node arg0, boolean savePasswords) throws SaveJobException {
        try {
            if (arg0 != null) {
                PdfSelectionTableItem[] items = selectionPanel.getTableRows();
                if (items != null && items.length > 0) {
                    Element firstNode = ((Element) arg0).addElement("first");
                    firstNode.addAttribute("value", items[0].getInputFile().getAbsolutePath());
                    if (savePasswords) {
                        firstNode.addAttribute("password", items[0].getPassword());
                    }

                    Element secondNode = ((Element) arg0).addElement("second");
                    if (items.length > 1) {
                        secondNode.addAttribute("value", items[1].getInputFile().getAbsolutePath());
                        if (savePasswords) {
                            secondNode.addAttribute("password", items[1].getPassword());
                        }
                    }
                }

                Element fileDestination = ((Element) arg0).addElement("destination");
                fileDestination.addAttribute("value", destinationTextField.getText());

                Element stepDestination = ((Element) arg0).addElement("step");
                stepDestination.addAttribute("value", stepTextField.getText());

                Element secondStepDestination = ((Element) arg0).addElement("secondstep");
                secondStepDestination.addAttribute("value", secondStepTextField.getText());

                Element reverseFirst = ((Element) arg0).addElement("reverse_first");
                reverseFirst.addAttribute("value", reverseFirstCheckbox.isSelected() ? TRUE : FALSE);

                Element reverseSecond = ((Element) arg0).addElement("reverse_second");
                reverseSecond.addAttribute("value", reverseSecondCheckbox.isSelected() ? TRUE : FALSE);

                Element fileOverwrite = ((Element) arg0).addElement("overwrite");
                fileOverwrite.addAttribute("value", overwriteCheckbox.isSelected() ? TRUE : FALSE);

                Element fileCompress = ((Element) arg0).addElement("compressed");
                fileCompress.addAttribute("value", outputCompressedCheck.isSelected() ? TRUE : FALSE);

                Element pdfVersion = ((Element) arg0).addElement("pdfversion");
                pdfVersion.addAttribute("value", ((StringItem) versionCombo.getSelectedItem()).getId());
            }
            return arg0;
        } catch (Exception ex) {
            throw new SaveJobException(ex);
        }
View Full Code Here

       
        // List elements = document.selectNodes("//*[contains(text(),'%module%')]");
        List elements = document.selectNodes("//*");
        for (final Iterator it = elements.iterator(); it.hasNext(); )
        {
            Element element = (Element)it.next();
            if (StringUtils.contains(element.getText(), "%module%"))
            {
                element.setText(
                        StringUtils.replace(
                                element.getText(),
                                "%module%",
                                this.getProjectName()));
            }
        }
        elements.clear();
       
        elements = document.selectNodes("//*[contains(@*,'%module%')]");
        for (final Iterator it = elements.iterator(); it.hasNext(); )
        {
            Element element = (Element)it.next();
            element.addAttribute(
                    "name",
                    StringUtils.replace(
                            element.attributeValue("name"),
                            "%module%",
                            this.getProjectName()));
        }
        return document;
    }
View Full Code Here

TOP

Related Classes of org.dom4j.Element

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.