1 23 24 package com.sun.enterprise.tools.guiframework.util; 25 26 import com.sun.enterprise.tools.guiframework.exception.FrameworkException; 27 import com.sun.enterprise.tools.guiframework.view.descriptors.ViewDescriptor; 28 29 import java.util.ArrayList ; 30 import java.util.EmptyStackException ; 31 import java.util.HashMap ; 32 import java.util.Iterator ; 33 import java.util.List ; 34 import java.util.Map ; 35 import java.util.Stack ; 36 import java.util.StringTokenizer ; 37 38 39 68 public class PermissionChecker implements java.io.Serializable { 69 70 73 public PermissionChecker(String infixStr, ViewDescriptor vd) { 74 setViewDescriptor(vd); 75 setInfix(stripWhiteSpace(infixStr)); 76 } 77 78 79 89 protected void setViewDescriptor(ViewDescriptor vd) { 90 _vd = vd; 91 } 92 93 94 103 public ViewDescriptor getViewDescriptor() { 104 return _vd; 105 } 106 107 108 125 private static int getPrecedence(char op) { 126 switch (op) { 127 case LEFT_PAREN: 128 return 2; 129 case RIGHT_PAREN: 130 return 999; 131 case EQUALS_OPERATOR: 132 return 3; 133 case OR_OPERATOR: 134 return 4; 135 case AND_OPERATOR: 136 return 5; 137 case NOT_OPERATOR: 138 return 6; 139 } 140 return 1; 141 } 142 143 144 151 protected char[] preProcessString(String source) { 152 source = substituteVariables(source, getViewDescriptor()); 154 155 char arr[] = source.toCharArray(); 156 int sourceLen = arr.length; 157 int destLen = 0; 158 String str = null; 159 160 for (int idx=0; idx<sourceLen ; idx++) { 162 switch (arr[idx]) { 163 case POST_TRUE: 164 case POST_TRUE_CAP: 165 if (((idx + TRUE.length()) <= sourceLen) && 166 TRUE.equalsIgnoreCase(new String (arr, idx, TRUE.length()))) { 167 arr[destLen++] = POST_TRUE; 168 idx += TRUE.length()-1; 169 } else { 170 idx = storeFunction(arr, idx); 171 arr[destLen++] = FUNCTION_MARKER; 172 } 173 break; 174 case POST_FALSE: 175 case POST_FALSE_CAP: 176 if (((idx + FALSE.length()) <= sourceLen) && 177 FALSE.equalsIgnoreCase(new String (arr, idx, FALSE.length()))) { 178 arr[destLen++] = POST_FALSE; 179 idx += FALSE.length()-1; 180 } else { 181 idx = storeFunction(arr, idx); 182 arr[destLen++] = FUNCTION_MARKER; 183 } 184 break; 185 case OR_OPERATOR: 186 case EQUALS_OPERATOR: 187 case AND_OPERATOR: 188 case NOT_OPERATOR: 189 case LEFT_PAREN: 190 case RIGHT_PAREN: 191 arr[destLen++] = arr[idx]; 192 break; 193 default: 194 idx = storeFunction(arr, idx); 195 arr[destLen++] = FUNCTION_MARKER; 196 } 197 } 198 char dest[] = new char[destLen]; 199 for (int idx=0; idx<destLen; idx++) { 200 dest[idx] = arr[idx]; 201 } 202 return dest; 203 } 204 205 206 215 protected String substituteVariables(String string, ViewDescriptor vd) { 216 int stringLen = string.length(); 220 int startTokenLen = Util.SUB_START.length(); 221 int delimLen = Util.SUB_TYPE_DELIM.length(); 222 int endTokenLen = Util.SUB_END.length(); 223 int endIndex, delimIndex; 224 int parenSemi; 225 char firstEndChar = Util.SUB_END.charAt(0); 226 char firstDelimChar = Util.SUB_TYPE_DELIM.charAt(0); 227 char currChar; 228 Object obj = null; 229 230 _tmpFunctionStack = new Stack (); 233 _currTmpFunction = 0; 234 235 for (int startIndex = string.lastIndexOf(Util.SUB_START); 237 startIndex != -1; 238 startIndex = string.lastIndexOf(Util.SUB_START, startIndex-1)) { 239 240 delimIndex = string.indexOf(Util.SUB_TYPE_DELIM, startIndex+startTokenLen); 242 if (delimIndex == -1) { 243 continue; 244 } 245 246 parenSemi = 0; 248 endIndex = -1; 249 for (int curr = delimIndex+delimLen; curr<stringLen; ) { 250 currChar = string.charAt(curr); 251 if ((currChar == firstDelimChar) && Util.SUB_TYPE_DELIM.equals(string.substring(curr, curr+delimLen))) { 252 parenSemi++; 253 curr += delimLen; 254 continue; 255 } 256 if ((currChar == firstEndChar) && Util.SUB_END.equals(string.substring(curr, curr+endTokenLen))) { 257 parenSemi--; 258 if (parenSemi < 0) { 259 endIndex = curr; 260 break; 261 } 262 curr += endTokenLen; 263 continue; 264 } 265 curr++; 266 } 267 if (endIndex == -1) { 268 continue; 269 } 270 271 endIndex += endTokenLen; 273 274 obj = Util.replaceVariablesWithAttributes(string.substring(startIndex, endIndex), vd); 276 if (obj == null) { 277 obj = FALSE_BOOLEAN_FUNCTION; 279 } else { 280 String str = obj.toString(); 281 if (str.equals("") || str.equalsIgnoreCase("false")) { 282 obj = FALSE_BOOLEAN_FUNCTION; 284 } else { 285 obj = new StringFunction(str); 287 } 288 } 289 290 _tmpFunctionStack.push(obj); 292 293 string = string.substring(0, startIndex) + FUNCTION_MARKER + string.substring(endIndex); } 298 299 return string; 301 } 302 303 304 311 protected int storeFunction(char arr[], int idx) { 312 int start = idx; 314 int len = arr.length; 315 while ((idx < len) && !isOperator(arr[idx])) { 316 idx++; 317 } 318 319 String str = new String (arr, start, idx-start); 321 322 Function function = getFunction(str); 324 if (function != null) { 325 int left = idx; 327 if ((left >= len) || (arr[left] != LEFT_PAREN)) { 328 throw new FrameworkException("Function '"+str+ 329 "' is expected to have a '"+LEFT_PAREN+ 330 "' immediately following it. Equation: '"+ 331 new String (arr)+"'."); 332 } 333 334 ArrayList arguments = new ArrayList (); 335 336 while ((++idx < len) && (arr[idx] != RIGHT_PAREN)) { 338 if (arr[idx] == ARGUMENT_SEPARATOR) { 339 left++; 340 arguments.add(new String (arr, left, idx-left)); 341 left = idx; 342 } 343 } 344 345 left++; 347 if (idx > left) { 348 arguments.add(new String (arr, left, idx-left)); 349 } 350 351 function.setArguments(arguments); 353 } else { 354 idx--; if ((str.charAt(0) == FUNCTION_MARKER) && (str.length() == 1) && 357 !_tmpFunctionStack.empty()) { 358 function = (Function)_tmpFunctionStack.pop(); 360 } else { 361 function = new StringFunction(str); 363 } 364 } 365 366 _functionList.add(function); 368 369 return idx; 371 } 372 373 374 379 protected static Function getFunction(String functionName) { 380 Class functionClass = (Class )_functions.get(functionName); 382 if (functionClass == null) { 383 return null; 384 } 385 386 Function function = null; 388 try { 389 function = (Function)functionClass.newInstance(); 390 } catch (Exception ex) { 391 throw new FrameworkException("Unable to instantiate '"+ 392 functionClass.getName()+"' for '"+functionName+"'", ex); 393 } 394 395 return function; 397 } 398 399 400 415 public static void registerFunction(String functionName, Class function) { 416 if (function == null) { 417 _functions.remove(functionName); 418 } 419 if (!Function.class.isAssignableFrom(function)) { 420 throw new FrameworkException("'"+function.getName()+ 421 "' must implement '"+Function.class.getName()+"'"); 422 } 423 _functions.put(functionName, function); 424 } 425 426 427 430 public boolean isOperator(char ch) { 431 switch (ch) { 432 case LEFT_PAREN: 433 case RIGHT_PAREN: 434 case EQUALS_OPERATOR: 435 case OR_OPERATOR: 436 case AND_OPERATOR: 437 case NOT_OPERATOR: 438 return true; 451 } 452 return false; 453 } 454 455 456 465 protected char [] generatePostfix(String infixStr) { 466 _functionList = new ArrayList (); 468 469 char result[] = preProcessString(infixStr); 471 int resultLen = result.length; 474 int postIdx = 0; 475 int precedence = 0; 476 Stack opStack = new Stack (); 477 478 for (int idx=0; idx<resultLen; idx++) { 480 switch(result[idx]) { 481 case FUNCTION_MARKER: 482 case POST_TRUE: 483 case POST_FALSE: 484 result[postIdx++] = result[idx]; 485 break; 486 case LEFT_PAREN: 487 opStack.push(new Character (LEFT_PAREN)); 488 break; 489 case RIGHT_PAREN: 490 while (!opStack.empty() && (((Character )opStack.peek()).charValue() != LEFT_PAREN)) { 491 result[postIdx++] = ((Character )opStack.pop()).charValue(); 492 } 493 if (!opStack.empty()) { 494 opStack.pop(); 496 } 497 break; 498 default: 499 precedence = getPrecedence(result[idx]); 501 while (!opStack.empty() && (getPrecedence(((Character )opStack.peek()).charValue()) >= precedence)) { 502 result[postIdx++] = ((Character )opStack.pop()).charValue(); 503 } 504 505 506 opStack.push(new Character (result[idx])); 507 break; 508 } 509 } 510 511 while (!opStack.empty()) { 513 result[postIdx++] = ((Character )opStack.pop()).charValue(); 514 } 515 char postfixStr[] = new char[postIdx]; 517 for (int idx=0; idx<postIdx; idx++) { 518 postfixStr[idx] = result[idx]; 519 } 520 return postfixStr; 522 } 523 524 528 public boolean hasPermission() { 529 char postfixArr[] = getPostfixArr(); 530 int len = postfixArr.length; 531 Stack result = new Stack (); 532 result.push(FALSE_BOOLEAN_FUNCTION); boolean val1, val2; 534 Iterator it = _functionList.iterator(); 535 Function func = null; 536 537 for (int idx=0; idx<len; idx++) { 539 switch (postfixArr[idx]) { 540 case POST_TRUE: 541 result.push(TRUE_BOOLEAN_FUNCTION); 542 break; 543 case POST_FALSE: 544 result.push(FALSE_BOOLEAN_FUNCTION); 545 break; 546 case FUNCTION_MARKER: 547 if (!it.hasNext()) { 548 throw new FrameworkException("Unable to evaluate: '"+ 549 toString()+"' -- found function marker w/o "+ 550 "cooresponding function!"); 551 } 552 result.push(it.next()); 553 break; 554 case EQUALS_OPERATOR: 555 try { 556 val1 = result.pop().toString().equals(result.pop().toString()); 557 } catch (EmptyStackException ex) { 558 throw new FrameworkException("Unable to evaluate: '"+toString()+"'.", ex); 559 } 560 result.push(val1 ? TRUE_BOOLEAN_FUNCTION : 561 FALSE_BOOLEAN_FUNCTION); 562 break; 563 case OR_OPERATOR: 564 try { 565 val1 = ((Function)result.pop()).evaluate(); 566 val2 = ((Function)result.pop()).evaluate(); 567 } catch (EmptyStackException ex) { 568 throw new FrameworkException("Unable to evaluate: '"+toString()+"'.", ex); 569 } 570 result.push( (val1 || val2) ? TRUE_BOOLEAN_FUNCTION : 571 FALSE_BOOLEAN_FUNCTION); 572 break; 573 case AND_OPERATOR: 574 try { 575 val1 = ((Function)result.pop()).evaluate(); 576 val2 = ((Function)result.pop()).evaluate(); 577 } catch (EmptyStackException ex) { 578 throw new FrameworkException("Unable to evaluate: '"+toString()+"'.", ex); 579 } 580 result.push( (val1 && val2) ? TRUE_BOOLEAN_FUNCTION : 581 FALSE_BOOLEAN_FUNCTION); 582 break; 583 case NOT_OPERATOR: 584 try { 585 val1 = ((Function)result.pop()).evaluate(); 586 } catch (EmptyStackException ex) { 587 throw new FrameworkException("Unable to evaluate: '"+toString()+"'.", ex); 588 } 589 result.push( (!val1) ? TRUE_BOOLEAN_FUNCTION : 590 FALSE_BOOLEAN_FUNCTION); 591 break; 592 } 593 } 594 595 try { 597 val1 = ((Function)result.pop()).evaluate(); 598 } catch (EmptyStackException ex) { 599 throw new FrameworkException("Unable to evaluate: '"+ 600 toString()+"'.", ex); 601 } 602 if (!result.empty()) { 603 result.pop(); if (!result.empty()) { 605 throw new FrameworkException("Unable to evaluate: '"+ 606 toString()+"' -- values left on the stack."); 607 } 608 } 609 return val1; 610 } 611 612 613 617 public String getInfix() { 618 return _infixStr; 619 } 620 621 622 628 public void setInfix(String equation) { 629 _infixStr = equation; 630 setPostfixArr(generatePostfix(equation)); 631 } 632 633 634 637 public char [] getPostfixArr() { 638 if (_postfixArr == null) { 639 _postfixArr = new char[] {' '}; 640 } 641 return _postfixArr; 642 } 643 644 645 648 protected void setPostfixArr(char postfix[]) { 649 _postfixArr = postfix; 650 } 651 652 653 656 public String getPostfix() { 657 if (getPostfixArr() == null) { 658 return ""; 659 } 660 return new String (getPostfixArr()); 661 } 662 663 664 667 public String toString() { 668 return _infixStr + " = " + toString(getPostfixArr()); 669 } 670 671 672 681 private String toString(char post[]) { 682 int len = post.length; 683 String result = ""; 684 Iterator it = _functionList.iterator(); 685 686 for (int idx=0; idx<len; idx++) { 687 switch (post[idx]) { 688 case POST_TRUE: 689 result += TRUE; 690 break; 691 case POST_FALSE: 692 result += FALSE; 693 break; 694 case FUNCTION_MARKER: 695 result += ((Function)it.next()).toString(); 696 break; 697 default: 698 result += post[idx]; 699 } 700 } 701 702 return result; 703 } 704 705 706 709 public static String stripWhiteSpace(String input) { 710 char arr[] = input.toCharArray(); 711 int len = arr.length; 712 int destLen = 0; 713 714 for (int idx=0; idx<len; idx++) { 716 if (Character.isWhitespace(arr[idx])) { 717 continue; 718 } 719 arr[destLen++] = arr[idx]; 720 } 721 722 return new String (arr, 0, destLen); 724 } 725 726 727 728 729 736 public static interface Function { 737 738 741 public List getArguments(); 742 743 747 public void setArguments(List args); 748 749 753 public boolean evaluate(); 754 } 755 756 757 764 protected static class StringFunction implements PermissionChecker.Function { 765 public StringFunction(String value) { 766 _value = value; 767 } 768 769 public List getArguments() { 770 return null; 771 } 772 773 public void setArguments(List args) { 774 } 775 776 public boolean evaluate() { 777 return true; 778 } 779 780 public String toString() { 781 return _value; 782 } 783 784 private String _value; 785 } 786 787 788 793 protected static class BooleanFunction implements PermissionChecker.Function { 794 public BooleanFunction() { 795 } 796 797 public BooleanFunction(boolean value) { 798 _value = value; 799 } 800 801 public List getArguments() { 802 return null; 803 } 804 805 public void setArguments(List args) { 806 } 807 808 public boolean evaluate() { 809 return _value; 810 } 811 812 public String toString() { 813 return _value ? "true" : "false"; 814 } 815 816 private boolean _value; 817 } 818 819 820 821 825 public static void main(String args[]) { 826 PermissionChecker checker; 827 if (args.length > 0) { 828 for (int count=0; count<args.length; count++) { 829 checker = new PermissionChecker(args[count], null); 830 System.out.println("Output:\n" + checker.toString()+" ("+checker.hasPermission()+")"); 831 } 832 } else { 833 boolean success = true; 834 checker = new PermissionChecker("true |false", null); 835 System.out.println("Output:\n" + checker.toString()+" ("+checker.hasPermission()+")"); 836 if (!checker.toString().equals("true|false = truefalse|")) { 837 System.out.println("\tFAILED!"); 838 System.out.println("Should have been:\n"+"true|false = truefalse|"); 839 success = false; 840 } 841 if (!checker.hasPermission()) { 842 System.out.println("\tFAILED!"); 843 System.out.println("hasPermission("+checker.toString(checker.getPostfixArr())+") returned the wrong result!"); 844 success = false; 845 } 846 847 checker = new PermissionChecker("true&(false|true)", null); 848 System.out.println("Output:\n" + checker.toString()+" ("+checker.hasPermission()+")"); 849 if (!checker.toString().equals("true&(false|true) = truefalsetrue|&")) { 850 System.out.println("\tFAILED!"); 851 System.out.println("Should have been:\n"+"true&(false|true) = truefalsetrue|&"); 852 success = false; 853 } 854 if (!checker.hasPermission()) { 855 System.out.println("\tFAILED!"); 856 System.out.println("hasPermission("+checker.toString(checker.getPostfixArr())+") returned the wrong result!"); 857 success = false; 858 } 859 860 checker = new PermissionChecker("true&false|true", null); 861 System.out.println("Output:\n" + checker.toString()+" ("+checker.hasPermission()+")"); 862 if (!checker.toString().equals("true&false|true = truefalse&true|")) { 863 System.out.println("\tFAILED!"); 864 System.out.println("Should have been:\n"+"true&false|true = truefalse&true|"); 865 success = false; 866 } 867 if (!checker.hasPermission()) { 868 System.out.println("\tFAILED!"); 869 System.out.println("hasPermission("+checker.toString(checker.getPostfixArr())+") returned the wrong result!"); 870 success = false; 871 } 872 873 checker = new PermissionChecker("true&true|false&true", null); 874 System.out.println("Output:\n" + checker.toString()+" ("+checker.hasPermission()+")"); 875 if (!checker.toString().equals("true&true|false&true = truetrue&falsetrue&|")) { 876 System.out.println("\tFAILED!"); 877 System.out.println("Should have been:\n"+"true&true|false&true = truetrue&falsetrue&|"); 878 success = false; 879 } 880 if (!checker.hasPermission()) { 881 System.out.println("\tFAILED!"); 882 System.out.println("hasPermission("+checker.toString(checker.getPostfixArr())+") returned the wrong result!"); 883 success = false; 884 } 885 886 checker = new PermissionChecker("!true|false&!(false|true)", null); 887 System.out.println("Output:\n" + checker.toString()+" ("+checker.hasPermission()+")"); 888 if (!checker.toString().equals("!true|false&!(false|true) = true!falsefalsetrue|!&|")) { 889 System.out.println("\tFAILED!"); 890 System.out.println("Should have been:\n"+"!true|false&!(false|true) = true!falsefalsetrue|!&|"); 891 success = false; 892 } 893 if (checker.hasPermission()) { 894 System.out.println("\tFAILED!"); 895 System.out.println("hasPermission("+checker.toString(checker.getPostfixArr())+") returned the wrong result!"); 896 success = false; 897 } 898 899 checker = new PermissionChecker("!(!(true&!true)|!(false|false))|(true|false)&true", null); 900 System.out.println("Output:\n" + checker.toString()+" ("+checker.hasPermission()+")"); 901 if (!checker.toString().equals("!(!(true&!true)|!(false|false))|(true|false)&true = truetrue!&!falsefalse|!|!truefalse|true&|")) { 902 903 System.out.println("\tFAILED!"); 904 System.out.println("Should have been:\n"+"!(!(true&!true)|!(false|false))|(true|false)&true = truetrue!&!falsefalse|!|!truefalse|true&|"); 905 success = false; 906 } 907 if (!checker.hasPermission()) { 908 System.out.println("\tFAILED!"); 909 System.out.println("hasPermission("+checker.toString(checker.getPostfixArr())+") returned the wrong result!"); 910 success = false; 911 } 912 913 checker = new PermissionChecker("false =false", null); 915 System.out.println("Output:\n" + checker.toString()+" ("+checker.hasPermission()+")"); 916 if (!checker.toString().equals("false=false = falsefalse=")) { 917 System.out.println("\tFAILED!"); 918 System.out.println("Should have been:\n"+"false=false = falsefalse="); 919 success = false; 920 } 921 if (!checker.hasPermission()) { 922 System.out.println("\tFAILED!"); 923 System.out.println("hasPermission("+checker.toString(checker.getPostfixArr())+") returned the wrong result!"); 924 success = false; 925 } 926 927 checker = new PermissionChecker(" test= me ", null); 928 System.out.println("Output:\n" + checker.toString()+" ("+checker.hasPermission()+")"); 929 if (!checker.toString().equals("test=me = testme=")) { 930 System.out.println("\tFAILED!"); 931 System.out.println("Should have been:\n"+"test=me = testme="); 932 success = false; 933 } 934 if (checker.hasPermission()) { 935 System.out.println("\tFAILED!"); 936 System.out.println("hasPermission("+checker.toString(checker.getPostfixArr())+") returned the wrong result!"); 937 success = false; 938 } 939 940 checker = new PermissionChecker(" this should work=thisshouldwork", null); 941 System.out.println("Output:\n" + checker.toString()+" ("+checker.hasPermission()+")"); 942 if (!checker.toString().equals("thisshouldwork=thisshouldwork = thisshouldworkthisshouldwork=")) { 943 System.out.println("\tFAILED!"); 944 System.out.println("Should have been:\n"+"thisshouldwork=thisshouldwork = thisshouldworkthisshouldwork="); 945 success = false; 946 } 947 if (!checker.hasPermission()) { 948 System.out.println("\tFAILED!"); 949 System.out.println("hasPermission("+checker.toString(checker.getPostfixArr())+") returned the wrong result!"); 950 success = false; 951 } 952 953 checker = new PermissionChecker("false|ab=true", null); 954 System.out.println("Output:\n" + checker.toString()+" ("+checker.hasPermission()+")"); 955 if (!checker.toString().equals("false|ab=true = falseab|true=")) { 956 System.out.println("\tFAILED!"); 957 System.out.println("Should have been:\n"+"false|ab=true = falseab|true="); 958 success = false; 959 } 960 if (!checker.hasPermission()) { 961 System.out.println("\tFAILED!"); 962 System.out.println("hasPermission("+checker.toString(checker.getPostfixArr())+") returned the wrong result!"); 963 success = false; 964 } 965 966 checker = new PermissionChecker("false|(ab=true)", null); 967 System.out.println("Output:\n" + checker.toString()+" ("+checker.hasPermission()+")"); 968 if (!checker.toString().equals("false|(ab=true) = falseabtrue=|")) { 969 System.out.println("\tFAILED!"); 970 System.out.println("Should have been:\n"+"false|ab=true = falseab|true="); 971 success = false; 972 } 973 if (checker.hasPermission()) { 974 System.out.println("\tFAILED!"); 975 System.out.println("hasPermission("+checker.toString(checker.getPostfixArr())+") returned the wrong result!"); 976 success = false; 977 } 978 979 checker = new PermissionChecker("false|(ab=ab)", null); 980 System.out.println("Output:\n" + checker.toString()+" ("+checker.hasPermission()+")"); 981 if (!checker.toString().equals("false|(ab=ab) = falseabab=|")) { 982 System.out.println("\tFAILED!"); 983 System.out.println("Should have been:\n"+"false|ab=true = falseab|true="); 984 success = false; 985 } 986 if (!checker.hasPermission()) { 987 System.out.println("\tFAILED!"); 988 System.out.println("hasPermission("+checker.toString(checker.getPostfixArr())+") returned the wrong result!"); 989 success = false; 990 } 991 992 993 if (success) { 994 System.out.println("\n\tALL TESTS PASSED!"); 995 } else { 996 System.out.println("\n\tNOT ALL TESTS PASSED!"); 997 } 998 } 999 } 1000 1001 1002 protected static final char POST_TRUE = 't'; 1003 protected static final char POST_FALSE = 'f'; 1004 protected static final char POST_TRUE_CAP = 'T'; 1005 protected static final char POST_FALSE_CAP = 'F'; 1006 1007 public static final String TRUE = "true"; 1008 public static final String FALSE = "false"; 1009 1010 public static final char FUNCTION_MARKER = 'F'; 1012 1013 public static final char LEFT_PAREN = '('; 1015 public static final char RIGHT_PAREN = ')'; 1016 public static final char EQUALS_OPERATOR = '='; 1017 public static final char OR_OPERATOR = '|'; 1018 public static final char AND_OPERATOR = '&'; 1019 public static final char NOT_OPERATOR = '!'; 1020 1021 public static final char ARGUMENT_SEPARATOR = ','; 1023 1024 1038 1039 1042 public static final BooleanFunction FALSE_BOOLEAN_FUNCTION = 1043 new BooleanFunction(false); 1044 1045 1048 public static final BooleanFunction TRUE_BOOLEAN_FUNCTION = 1049 new BooleanFunction(true); 1050 1051 1054 private String _infixStr = null; 1055 1056 1059 private char _postfixArr[] = null; 1060 1061 1064 private static Map _functions = new HashMap (); 1065 1066 1070 private List _functionList = null; 1071 1072 1078 private Stack _tmpFunctionStack = null; 1079 private int _currTmpFunction = 0; 1080 private ViewDescriptor _vd = null; 1081} 1082 | Popular Tags |