1 package org.jbpm.identity.assignment; 2 3 6 public class TermTokenizer { 7 8 private String expression = null; 9 private int index = 0; 10 11 public TermTokenizer(String expression) { 12 this.expression = expression; 13 } 14 15 public boolean hasMoreTerms() { 16 return (index!=-1); 17 } 18 19 public String nextTerm() { 20 String term = null; 21 int startIndex = index; 22 index = expression.indexOf("-->", index); 23 if (index!=-1) { 24 term = expression.substring(startIndex, index).trim(); 25 index+=3; 26 } else { 27 term = expression.substring(startIndex).trim(); 28 } 29 return term; 30 } 31 } 32 | Popular Tags |