1 // 2 // SwitchRMI Framework 3 // Copyright (c) 2000-2002 by Michael J. Henderson & Associates. 4 // 5 // Michael Henderson 6 // http://switchrmi.sf.net 7 // mailto:mikehenderson@dunelm.org.uk 8 // 9 // This library is free software. 10 // 11 // You may redistribute it and/or modify it under the terms of the GNU 12 // Lesser General Public License as published by the Free Software Foundation. 13 // 14 // Version 2.1 of the license should be included with this distribution in 15 // the file LICENSE, as well as License.html. If the license is not 16 // included with this distribution, you may find a copy at the FSF web 17 // site at 'www.gnu.org' or 'www.fsf.org', or you may write to the 18 // Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139 USA. 19 // 20 // This library is distributed in the hope that it will be useful, 21 // but WITHOUT ANY WARRANTY; without even the implied waranty of 22 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 23 // Lesser General Public License for more details. 24 // 25 // $Id: IValidator.java,v 1.1 2002/11/11 22:19:48 mikehenderson Exp $ 26 package com.mjh.switchrmi.protocol.xmlrpc.validator; 27 28 import java.util.Date; 29 import java.util.List; 30 import java.util.Map; 31 32 /* 33 validator1.arrayOfStructsTest (array) returns number 34 This handler takes a single parameter, an array of structs, each of which contains at least three elements named moe, larry and curly, all <i4>s. 35 Your handler must add all the struct elements named curly and return the result. 36 37 validator1.countTheEntities (string) returns struct 38 This handler takes a single parameter, a string, that contains any number of predefined entities, namely <, >, &, ' and ". 39 Your handler must return a struct that contains five fields, all numbers: ctLeftAngleBrackets, ctRightAngleBrackets, ctAmpersands, ctApostrophes, ctQuotes. 40 To validate, the numbers must be correct. 41 42 validator1.easyStructTest (struct) returns number 43 This handler takes a single parameter, a struct, containing at least three elements named moe, larry and curly, all <i4>s. 44 Your handler must add the three numbers and return the result. 45 46 validator1.echoStructTest (struct) returns struct 47 This handler takes a single parameter, a struct. Your handler must return the struct. 48 49 validator1.manyTypesTest (number, boolean, string, double, dateTime, base64) returns array 50 This handler takes six parameters, and returns an array containing all the parameters. 51 52 validator1.moderateSizeArrayCheck (array) returns string 53 This handler takes a single parameter, which is an array containing between 100 and 200 elements. 54 Each of the items is a string, your handler must return a string containing the concatenated text of the first and last elements. 55 56 validator1.nestedStructTest (struct) returns number 57 This handler takes a single parameter, a struct, that models a daily calendar. 58 At the top level, there is one struct for each year. Each year is broken down into months, and months into days. 59 Most of the days are empty in the struct you receive, but the entry for April 1, 2000 contains a least three elements named moe, larry and curly, all <i4>s. 60 Your handler must add the three numbers and return the result. 61 62 Ken MacLeod: "This description isn't clear, I expected '2000.April.1' when in fact it's '2000.04.01'. 63 Adding a note saying that month and day are two-digits with leading 0s, and January is 01 would help." Done. 64 65 validator1.simpleStructReturnTest (number) returns struct 66 This handler takes one parameter, and returns a struct containing three elements, times10, times100 and times1000, the result of multiplying the number by 10, 100 and 1000. 67 68 69 */ 70 public interface IValidator 71 { 72 public int arrayOfStructsTest(List list); 73 74 public Map countTheEntities(String string); 75 76 public int easyStructTest(Map map); 77 78 public Map echoStructTest(Map map); 79 80 public List manyTypesTest(int number, boolean bool, String string, 81 double dbl, Date date, byte[] base64); 82 83 public String moderateSizeArrayCheck(List list); 84 85 public int nestedStructTest(Map map); 86 87 public Map simpleStructReturnTest(int number); 88 }