Ignore:
Timestamp:
03/03/09 18:36:52 (3 years ago)
Author:
sys
Message:

xpath fct : lookForAncestorAgentByTypes : match les types suffixes des codes de modèles si le code recherché commence par "*".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Jav_GE/com/scenari/m/ge/xpath/dom/ZXPathLookForAncestorAgentByTypes.java

    r12007 r12949  
    5858 * Fonction XPath qui renvoit un NodeSet d'agents appartenant au contexte du 
    5959 * dialogue et à la stack d'execution dont le code du composant type correspond 
    60  * au préfixe du 2eme parametre ou nème paramètre. 
     60 * au préfixe du 2eme parametre ou nème paramètre. Si le 2ème (ou nème) paramètre  
     61 * commence par "*", c'est le suffixe qui est comparé. 
    6162 *  
    6263 * La liste retourne les agents du dialogue courant jusqu'au dialogue racine. 
     
    107108                                String vCode = vAgent.hGetComposant().hGetComposantType().hGetCode(); 
    108109                                String vCodeSearch = pCodes[i]; 
    109                                 if (vCode.startsWith(vCodeSearch)) { 
     110 
     111                                if (vCodeSearch.charAt(0) == '*') { 
     112                                        int vLen = vCodeSearch.length() - 1; 
     113                                        if (vCode.regionMatches(vCode.length() - vLen, vCodeSearch, 1, vLen)) { 
     114                                                if (!pList.contains((Node) vAgent)) { 
     115                                                        pList.addElement((Node) vAgent); 
     116                                                } 
     117                                        } 
     118                                } else if (vCode.startsWith(vCodeSearch)) { 
    110119                                        if (vCode.length() == vCodeSearch.length() || vCode.charAt(vCodeSearch.length()) == '_') { 
    111120                                                if (!pList.contains((Node) vAgent)) { 
Note: See TracChangeset for help on using the changeset viewer.