// Path: leotask/src/core/org/leores/ecpt/TRuntimeException.java
// public class TRuntimeException extends RuntimeException {
// 	private static final long serialVersionUID = -1540271937983801068L;
// 
// 	public TRuntimeException() {
// 		super();
// 		return;
// 	}
// 
// 	public TRuntimeException(Object obj) {
// 		super(U.toStr(obj));
// 		return;
// 	}
// 
// 	public TRuntimeException(Object... objs) {
// 		this("", objs);
// 		return;
// 	}
// 
// 	public TRuntimeException(String str, Object... objs) {
// 		super(str + U.toStr(objs));
// 		return;
// 	}
// }
// 
// Path: leotask/src/core/org/leores/ecpt/UnsupportedTypeException.java
// public class UnsupportedTypeException extends TException {
// 	public UnsupportedTypeException(Object obj) {
// 		super(obj);
// 		return;
// 	}
// 
// 	public UnsupportedTypeException(Object... objs) {
// 		super(objs);
// 		return;
// 	}
// 
// 	public UnsupportedTypeException(String str, Object... objs) {
// 		super(str, objs);
// 		return;
// 	}
// }
// 
// Path: leotask/src/core/org/leores/ecpt/WrongFormatException.java
// public class WrongFormatException extends TException {
// 	public WrongFormatException(Object obj) {
// 		super(obj);
// 		return;
// 	}
// 
// 	public WrongFormatException(Object... objs) {
// 		super(objs);
// 		return;
// 	}
// 
// 	public WrongFormatException(String str, Object... objs) {
// 		super(str, objs);
// 		return;
// 	}
// }
// 
// Path: leotask/src/core/org/leores/ecpt/WrongParameterException.java
// public class WrongParameterException extends TException {	
// 	public WrongParameterException(Object obj){
// 		super(obj);
// 		return;
// 	}
// 
// 	public WrongParameterException(Object... objs) {
// 		super(objs);
// 		return;
// 	}
// 
// 	public WrongParameterException(String str, Object... objs) {
// 		super(str, objs);
// 		return;
// 	}
// }


import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.leores.ecpt.TRuntimeException;
import org.leores.ecpt.UnsupportedTypeException;
import org.leores.ecpt.WrongFormatException;
import org.leores.ecpt.WrongParameterException;

package org.leores.util;



public class StrUtil extends LogUtil {
	public static String sBlock = "}"; //Priority high
	public static String sEnumerate = ";";
	public static String sRepeat = "@";
	public static String sStep = ":";//Priority low

	public static String sNoEval = "~";
	public static String de = ",";

	public static String sSet = "=";

	//\\S+? Several non-whitespace characters ? makes quantifier "+" reluctant. It tries to find the smallest match.  
	public static String sPatVar = "\\$(\\S+?)\\$";
	public static String sPatExp = "#(\\S+?)#";
	public static String sSelf = "%";

	public static final int EVAL_InvalidIgnore = 0x00000001;
	public static final int EVAL_InvalidException = 0x00000002;
	public static final int EVAL_NullIgnore = 0x00000004;
	public static final int EVAL_NullException = 0x00000008;

	public static String sPatEvalNumOut = null;//set this to null to use the default number out pattern in the system.

	public static boolean bAssignable(Class cTo, Class cFrom) {
		boolean rtn = false;

		if (cFrom == null) {
			rtn = true;
		} else if (cTo != null) {
			rtn = cTo.isAssignableFrom(cFrom);
		}

		return rtn;
	}

	public static List parseList(Class type, String[] tokens, boolean bStepped) {
		List rtnList = null;

		if (bStepped && tokens.length < 3) {

// Path: leotask/src/core/org/leores/ecpt/TRuntimeException.java
// public class TRuntimeException extends RuntimeException {
// 	private static final long serialVersionUID = -1540271937983801068L;
// 
// 	public TRuntimeException() {
// 		super();
// 		return;
// 	}
// 
// 	public TRuntimeException(Object obj) {
// 		super(U.toStr(obj));
// 		return;
// 	}
// 
// 	public TRuntimeException(Object... objs) {
// 		this("", objs);
// 		return;
// 	}
// 
// 	public TRuntimeException(String str, Object... objs) {
// 		super(str + U.toStr(objs));
// 		return;
// 	}
// }
// 
// Path: leotask/src/core/org/leores/ecpt/UnsupportedTypeException.java
// public class UnsupportedTypeException extends TException {
// 	public UnsupportedTypeException(Object obj) {
// 		super(obj);
// 		return;
// 	}
// 
// 	public UnsupportedTypeException(Object... objs) {
// 		super(objs);
// 		return;
// 	}
// 
// 	public UnsupportedTypeException(String str, Object... objs) {
// 		super(str, objs);
// 		return;
// 	}
// }
// 
// Path: leotask/src/core/org/leores/ecpt/WrongFormatException.java
// public class WrongFormatException extends TException {
// 	public WrongFormatException(Object obj) {
// 		super(obj);
// 		return;
// 	}
// 
// 	public WrongFormatException(Object... objs) {
// 		super(objs);
// 		return;
// 	}
// 
// 	public WrongFormatException(String str, Object... objs) {
// 		super(str, objs);
// 		return;
// 	}
// }
// 
// Path: leotask/src/core/org/leores/ecpt/WrongParameterException.java
// public class WrongParameterException extends TException {	
// 	public WrongParameterException(Object obj){
// 		super(obj);
// 		return;
// 	}
// 
// 	public WrongParameterException(Object... objs) {
// 		super(objs);
// 		return;
// 	}
// 
// 	public WrongParameterException(String str, Object... objs) {
// 		super(str, objs);
// 		return;
// 	}
// }


// Path: leotask/src/core/org/leores/util/StrUtil.java
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.leores.ecpt.TRuntimeException;
import org.leores.ecpt.UnsupportedTypeException;
import org.leores.ecpt.WrongFormatException;
import org.leores.ecpt.WrongParameterException;

package org.leores.util;



public class StrUtil extends LogUtil {
	public static String sBlock = "}"; //Priority high
	public static String sEnumerate = ";";
	public static String sRepeat = "@";
	public static String sStep = ":";//Priority low

	public static String sNoEval = "~";
	public static String de = ",";

	public static String sSet = "=";

	//\\S+? Several non-whitespace characters ? makes quantifier "+" reluctant. It tries to find the smallest match.  
	public static String sPatVar = "\\$(\\S+?)\\$";
	public static String sPatExp = "#(\\S+?)#";
	public static String sSelf = "%";

	public static final int EVAL_InvalidIgnore = 0x00000001;
	public static final int EVAL_InvalidException = 0x00000002;
	public static final int EVAL_NullIgnore = 0x00000004;
	public static final int EVAL_NullException = 0x00000008;

	public static String sPatEvalNumOut = null;//set this to null to use the default number out pattern in the system.

	public static boolean bAssignable(Class cTo, Class cFrom) {
		boolean rtn = false;

		if (cFrom == null) {
			rtn = true;
		} else if (cTo != null) {
			rtn = cTo.isAssignableFrom(cFrom);
		}

		return rtn;
	}

	public static List parseList(Class type, String[] tokens, boolean bStepped) {
		List rtnList = null;

		if (bStepped && tokens.length < 3) {

			throw new TRuntimeException("Stepped type has less than 3 tokens: " + U.toStr(tokens));
