Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Changeset 5287

Show
Ignore:
Timestamp:
08/14/08 23:53:02 (3 months ago)
Author:
kevjay
Message:

logicws: added Javadocs

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs-modules/logicws/web/src/org/openmrs/module/logicws/web/URLdataQuery.java

    r5220 r5287  
    2424import org.apache.commons.logging.LogFactory; 
    2525 
     26// TODO: Auto-generated Javadoc 
    2627/** 
    2728 * Helper class that extracts the important information for the URL query so 
     
    4142 
    4243    private Map<String, String[]> tokenSplitters; 
    43      
     44 
    4445    private Map<String, String> tokenAggregateNames; 
    45      
     46 
    4647    private Map<String, String> tokenAggregateValues; 
    47      
    48     //private Map<> 
     48 
     49    // private Map<> 
    4950 
    5051    /** 
     
    6768 
    6869            tokenSplitters = new HashMap<String, String[]>(); 
    69              
     70 
    7071            tokenAggregateNames = new HashMap<String, String>(); 
    71              
     72 
    7273            tokenAggregateValues = new HashMap<String, String>(); 
    7374 
     
    8384                    tokensWithModifiers = select.split("\\|"); 
    8485 
    85                     // remove the split indicators, aggregates, and aggregate values 
     86                    // remove the split indicators, aggregates, and aggregate 
     87                    // values 
    8688                    for (int i = 0; i < tokensWithModifiers.length; i++) { 
    87                          
    88                         //get the aggregate name 
    89                         tokenAggregateNames.put(tokensWithModifiers[i].substring(tokensWithModifiers[i].indexOf("{") + 1, tokensWithModifiers[i].indexOf("}")), tokensWithModifiers[i].split(" ")[0]); 
    90                                                  
    91                         //get the aggregate value 
    92                         tokenAggregateValues.put(tokensWithModifiers[i].substring(tokensWithModifiers[i].indexOf("{") + 1, tokensWithModifiers[i].indexOf("}")), tokensWithModifiers[i].split(" ")[1]); 
    93                          
     89 
     90                        // get the aggregate name 
     91                        tokenAggregateNames.put( 
     92                                tokensWithModifiers[i] 
     93                                        .substring(tokensWithModifiers[i] 
     94                                                .indexOf("{") + 1, 
     95                                                tokensWithModifiers[i] 
     96                                                        .indexOf("}")), 
     97                                tokensWithModifiers[i].split(" ")[0]); 
     98 
     99                        // get the aggregate value 
     100                        tokenAggregateValues.put( 
     101                                tokensWithModifiers[i] 
     102                                        .substring(tokensWithModifiers[i] 
     103                                                .indexOf("{") + 1, 
     104                                                tokensWithModifiers[i] 
     105                                                        .indexOf("}")), 
     106                                tokensWithModifiers[i].split(" ")[1]); 
     107 
    94108                        if (tokensWithModifiers[i].contains(":")) { 
    95109                            // populate token splitters 
     
    106120 
    107121                            tokensWithModifiers[i] = tokensWithModifiers[i] 
    108                                     .substring(tokensWithModifiers[i].indexOf("{"), tokensWithModifiers[i] 
    109                                             .indexOf(":")); 
     122                                    .substring(tokensWithModifiers[i] 
     123                                            .indexOf("{"), 
     124                                            tokensWithModifiers[i].indexOf(":")); 
    110125 
    111126                        } 
     
    140155        return tokenSplitters.get(token); 
    141156    } 
    142      
     157 
     158    /** 
     159     * Gets the token aggregate name. 
     160     *  
     161     * @param token the token 
     162     *  
     163     * @return the token aggregate name 
     164     */ 
    143165    public String getTokenAggregateName(String token) { 
    144166        return tokenAggregateNames.get(token); 
    145167    } 
    146      
     168 
     169    /** 
     170     * Gets the token aggregate value. 
     171     *  
     172     * @param token the token 
     173     *  
     174     * @return the token aggregate value 
     175     */ 
    147176    public String getTokenAggregateValue(String token) { 
    148177        return tokenAggregateValues.get(token); 
    149178    } 
    150      
    151179 
    152180    /**