buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/ProjectMeta.java
author wbernard
Fri, 13 Aug 2010 14:59:05 +0300
changeset 628 7c4a911dc066
parent 588 c7c26511138f
child 645 b8d81fa19e7d
permissions -rw-r--r--
helium_11.0.0-e00f171ca185
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     1
/*
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     2
 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     3
 * All rights reserved.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     5
 * under the terms of the License "Eclipse Public License v1.0"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     8
 *
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     9
 * Initial Contributors:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    11
 *
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    12
 * Contributors:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    13
 *
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    14
 * Description: 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    15
 *
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    16
 */
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    17
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    18
package com.nokia.helium.ant.data;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    19
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    20
import java.io.File;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    21
import java.io.IOException;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    22
import java.text.BreakIterator;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    23
import java.util.ArrayList;
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    24
import java.util.Iterator;
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    25
import java.util.List;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    26
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    27
import org.dom4j.Comment;
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    28
import org.dom4j.Document;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    29
import org.dom4j.DocumentHelper;
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    30
import org.dom4j.Element;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    31
import org.dom4j.Node;
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    32
import org.dom4j.XPath;
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    33
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    34
/**
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    35
 * Meta object for an Ant project.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    36
 */
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    37
public class ProjectMeta extends RootAntObjectMeta {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    38
    private static final String DOC_COMMENT_MARKER = "*";
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    39
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    40
    private String description = "";
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    41
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    42
    public ProjectMeta(AntFile antFile, Element node) throws IOException {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    43
        super(antFile, node);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    44
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    45
        // Only parse a project comment if it is marked
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    46
        if (!getComment().isMarkedComment()) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    47
            setComment(getEmptyComment());
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    48
        }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    49
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    50
        Element descriptionNode = ((Element) getNode()).element("description");
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    51
        if (descriptionNode != null) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    52
            description = AntComment.getCleanedDocNodeText(descriptionNode);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    53
        }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    54
    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    55
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    56
    public File getFile() {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    57
        return this.getAntFile().getFile();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    58
    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    59
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    60
    public String getDefault() {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    61
        return getAttr("default");
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    62
    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    63
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    64
    public String getDescription() {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    65
        return description;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    66
    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    67
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    68
    public String getPackage() {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    69
        return getComment().getTagValue("package", DEFAULT_PACKAGE);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    70
    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    71
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    72
    public String getSummary() {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    73
        String text = getDescription();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    74
        if (text.length() == 0) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    75
            text = getDocumentation();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    76
        }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    77
        BreakIterator iterator = BreakIterator.getSentenceInstance();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    78
        iterator.setText(text);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    79
        String summary = "";
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    80
        if (iterator.next() > 0) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    81
            summary = text.substring(0, iterator.current()).trim();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    82
        }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    83
        return summary;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    84
    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    85
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    86
    @SuppressWarnings("unchecked")
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    87
    public List<TargetMeta> getTargets() {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    88
        ArrayList<TargetMeta> objects = new ArrayList<TargetMeta>();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    89
        List<Node> nodes = getNode().selectNodes("target");
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    90
        for (Node targetNode : nodes) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    91
            TargetMeta targetMeta = new TargetMeta(this, targetNode);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    92
            targetMeta.setRuntimeProject(getRuntimeProject());
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    93
            if (targetMeta.matchesScope(getScopeFilter())) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    94
                objects.add(targetMeta);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    95
            }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    96
        }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    97
        return objects;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    98
    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    99
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   100
    @SuppressWarnings("unchecked")
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   101
    public List<PropertyMeta> getProperties() {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   102
        List<PropertyMeta> properties = new ArrayList<PropertyMeta>();
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   103
        List<Node> propertyNodes = getNode().selectNodes("//property[string-length(@name)>0]");
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   104
        for (Node propNode : propertyNodes) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   105
            PropertyMeta propertyMeta = new PropertyMeta(this, propNode);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   106
            propertyMeta.setRuntimeProject(getRuntimeProject());
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   107
            if (propertyMeta.matchesScope(getScopeFilter())) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   108
                properties.add(propertyMeta);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   109
            }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   110
        }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   111
        return properties;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   112
    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   113
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   114
    @SuppressWarnings("unchecked")
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   115
    public List<MacroMeta> getMacros() {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   116
        ArrayList<MacroMeta> objects = new ArrayList<MacroMeta>();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   117
        List<Element> nodes = getNode().selectNodes("//macrodef | //scriptdef");
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   118
        for (Element node : nodes) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   119
            MacroMeta macroMeta = new MacroMeta(this, node);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   120
            macroMeta.setRuntimeProject(getRuntimeProject());
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   121
            if (macroMeta.matchesScope(getScopeFilter())) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   122
                objects.add(macroMeta);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   123
            }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   124
        }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   125
        return objects;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   126
    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   127
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   128
    @SuppressWarnings("unchecked")
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   129
    public List<String> getProjectDependencies() {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   130
        ArrayList<String> objects = new ArrayList<String>();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   131
        List<Element> importNodes = getNode().selectNodes("//import");
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   132
        for (Element node : importNodes) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   133
            objects.add(node.attributeValue("file"));
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   134
        }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   135
        return objects;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   136
    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   137
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   138
    @SuppressWarnings("unchecked")
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   139
    public List<String> getLibraryDependencies() {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   140
        ArrayList<String> objects = new ArrayList<String>();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   141
        List<Element> nodes = getNode().selectNodes("//typedef");
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   142
        for (Element node : nodes) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   143
            if (node.attributeValue("file") != null) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   144
                objects.add(node.attributeValue("file"));
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   145
            }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   146
            else if (node.attributeValue("resource") != null) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   147
                objects.add(node.attributeValue("resource"));
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   148
            }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   149
        }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   150
        return objects;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   151
    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   152
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   153
    @SuppressWarnings("unchecked")
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   154
    public List<PropertyCommentMeta> getPropertyCommentBlocks() {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   155
        ArrayList<PropertyCommentMeta> objects = new ArrayList<PropertyCommentMeta>();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   156
        List<Node> nodes = getNode().selectNodes("//comment()");
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   157
        for (Node node : nodes) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   158
            String text = node.getText().trim();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   159
            if (text.startsWith(DOC_COMMENT_MARKER + " @property")) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   160
                PropertyCommentMeta propertyCommentMeta = new PropertyCommentMeta(this, (Comment) node);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   161
                propertyCommentMeta.setRuntimeProject(getRuntimeProject());
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   162
                if (propertyCommentMeta.matchesScope(getScopeFilter())) {
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   163
                    objects.add(propertyCommentMeta);
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   164
                }
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   165
            }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   166
        }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   167
        return objects;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   168
    }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   169
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   170
    @SuppressWarnings("unchecked")
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   171
    public void getConfigSignals(String targetName, List<String> signals) {
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   172
        XPath xpath = DocumentHelper.createXPath("//hlm:signalListenerConfig[@target='"
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   173
            + targetName + "']");
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   174
        xpath.setNamespaceURIs(Database.NAMESPACE_MAP);
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   175
        List<Node> signalNodes = xpath.selectNodes(getNode());
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   176
        for (Iterator<Node> iterator = signalNodes.iterator(); iterator.hasNext();) {
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   177
            Element propertyNode = (Element) iterator.next();
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   178
            String signalid = propertyNode.attributeValue("id");
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   179
            String failbuild = findSignalFailMode(signalid, getNode().getDocument());
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   180
            signals.add(signalid + "(" + failbuild + ")");
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   181
        }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   182
    }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   183
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   184
    @SuppressWarnings("unchecked")
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   185
    private String findSignalFailMode(String signalid, Document antDoc) {
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   186
        XPath xpath2 = DocumentHelper.createXPath("//hlm:signalListenerConfig[@id='" + signalid
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   187
            + "']/signalNotifierInput/signalInput");
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   188
        xpath2.setNamespaceURIs(Database.NAMESPACE_MAP);
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   189
        List signalNodes3 = xpath2.selectNodes(antDoc);
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   190
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   191
        for (Iterator iterator3 = signalNodes3.iterator(); iterator3.hasNext();) {
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   192
            Element propertyNode3 = (Element) iterator3.next();
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   193
            String signalinputid = propertyNode3.attributeValue("refid");
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   194
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   195
            XPath xpath3 = DocumentHelper.createXPath("//hlm:signalInput[@id='" + signalinputid
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   196
                + "']");
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   197
            xpath3.setNamespaceURIs(Database.NAMESPACE_MAP);
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   198
            List signalNodes4 = xpath3.selectNodes(antDoc);
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   199
            for (Iterator iterator4 = signalNodes4.iterator(); iterator4.hasNext();) {
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   200
                Element propertyNode4 = (Element) iterator4.next();
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   201
                return propertyNode4.attributeValue("failbuild");
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   202
            }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   203
        }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   204
        return null;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   205
    }
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   206
}