Package org.dom4j

Examples of org.dom4j.Document.selectSingleNode()


        // Check if child already exists
        String newChildXPath = xPath + "/" + childTypeStr;
        getLogger().debug("CHECK: " + newChildXPath);

        if (doc.selectSingleNode(newChildXPath + "[@relURI='" +
                    creator.generateTreeId(childId, childType) + "']") != null) {
            getLogger().error("Exception: XPath exists: " + newChildXPath + "[@relURI='" +
                creator.generateTreeId(childId, childType) + "']");
            getLogger().error("No child added");
View Full Code Here


        // Get creator
        ParentChildCreatorInterface creator = null;
        String absoluteDoctypesPath = publication.getDirectory() + File.separator + doctypesPath;
        Document doctypesDoc = new SAXReader().read("file:" + absoluteDoctypesPath +
                "doctypes.xconf");
        Attribute creator_src = (Attribute) doctypesDoc.selectSingleNode("/doctypes/doc[@type='" +
                doctype + "']/creator/@src");

        if (creator_src != null) {
            log.info("Creator found for \"" + doctype + "\": " + creator_src.getName() + " " + creator_src.getPath() + " " + creator_src.getValue());
View Full Code Here

                int r;
                AccountInfo logOn = getLogOn();
                if (logOn == null) {
                    r = svc.Create(
                        id,
                        dom.selectSingleNode("/service/name").getText()+" at "+path,
                        path+"\\jenkins-slave.exe",
                        Win32OwnProcess, 0, "Manual", true);
                } else {
                    r = svc.Create(
                        id,
View Full Code Here

                        path+"\\jenkins-slave.exe",
                        Win32OwnProcess, 0, "Manual", true);
                } else {
                    r = svc.Create(
                        id,
                        dom.selectSingleNode("/service/name").getText()+" at "+path,
                        path+"\\jenkins-slave.exe",
                        Win32OwnProcess,
                        0,
                        "Manual",
                        false, // When using a different user, it isn't possible to interact
View Full Code Here

        } catch (ClassNotFoundException e) {
            throw new PluginException("Could not instantiate detector class: " + e, e);
        }

        // Create ordering constraints
        Node orderingConstraintsNode = pluginDescriptor.selectSingleNode("/FindbugsPlugin/OrderingConstraints");
        if (orderingConstraintsNode != null) {
            // Get inter-pass and intra-pass constraints
            List<Element> elements =  XMLUtil.selectNodes(orderingConstraintsNode, "./SplitPass|./WithinPass");
            for (Element constraintElement : elements) {
                // Create the selectors which determine which detectors are
View Full Code Here

                    continue;
                }
                String description = bugCodeNode.getText();

                String query = "/FindbugsPlugin/BugCode[@abbrev='" + abbrev + "']";
                Node fbNode = pluginDescriptor.selectSingleNode(query);
                int cweid = 0;
                if (fbNode != null) {
                    try {
                        cweid = Integer.parseInt(fbNode.valueOf("@cweid"));
                    } catch (RuntimeException e) {
View Full Code Here

            }

        }

        // If an engine registrar is specified, make a note of its classname
        Node node = pluginDescriptor.selectSingleNode("/FindbugsPlugin/EngineRegistrar");
        if (node != null) {
            String engineClassName = node.valueOf("@class");
            if (engineClassName == null) {
                throw new PluginException("EngineRegistrar element with missing class attribute");
            }
View Full Code Here

        try {
            if (fName.endsWith(".gz")) {
                in = new GZIPInputStream(in);
            }
            doc = reader.read(in);
            Node summary = doc.selectSingleNode("/BugCollection/FindBugsSummary");
            double cpu_seconds = Double.parseDouble(summary.valueOf("@cpu_seconds"));
            putStats("cpu_seconds", i, (int) (cpu_seconds * 1000));
            double gc_seconds = Double.parseDouble(summary.valueOf("@gc_seconds"));
            putStats("gc_seconds", i, (int) (gc_seconds * 1000));

 
View Full Code Here

   */
  private static transient Logger log;
 
  private ExceptionMessageProvider() throws Exception {
    Document document = getConfiguration();   
    Node classNode = document.selectSingleNode("/exception-message-provider/source/@class");
    if(classNode != null){
      Class fileSourceClass = Class.forName(classNode.getText());
      Node sourceNode = document.selectSingleNode("/exception-message-provider/source");
      Constructor constructor = fileSourceClass.getConstructor(new Class[]{Node.class});
      source = (InquirableMessagesSource) constructor.newInstance(new Object[]{sourceNode});
View Full Code Here

  private ExceptionMessageProvider() throws Exception {
    Document document = getConfiguration();   
    Node classNode = document.selectSingleNode("/exception-message-provider/source/@class");
    if(classNode != null){
      Class fileSourceClass = Class.forName(classNode.getText());
      Node sourceNode = document.selectSingleNode("/exception-message-provider/source");
      Constructor constructor = fileSourceClass.getConstructor(new Class[]{Node.class});
      source = (InquirableMessagesSource) constructor.newInstance(new Object[]{sourceNode});
    }
    else{
      throw new Exception("Unable to find MessagesSource class name");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.