1 23 24 29 30 package com.sun.appserv.management.util.misc; 31 32 33 36 public class TokenizerParams 37 { 38 41 public String mDelimiters; 42 43 48 public boolean mMultipleDelimsCountAsOne; 49 50 54 public char mEscapeChar; 55 56 59 public String mEscapableChars; 60 61 65 public boolean mEmitInvalidEscapeSequencesLiterally; 66 67 public final static char BACKSLASH = '\\'; 68 public final static char COMMA = ','; 69 public final static char DEFAULT_ESCAPE_CHAR = BACKSLASH; 70 public final static String DEFAULT_DELIMITERS = "" + COMMA; 71 72 public 73 TokenizerParams() 74 { 75 mDelimiters = DEFAULT_DELIMITERS; 76 mMultipleDelimsCountAsOne = true; 77 mEscapeChar = DEFAULT_ESCAPE_CHAR; 78 mEscapableChars = "" + DEFAULT_ESCAPE_CHAR; 79 mEmitInvalidEscapeSequencesLiterally = false; 80 } 81 82 public void 83 ensureDelimitersEscapable() 84 { 85 for( int i = 0; i < mDelimiters.length(); ++i ) 86 { 87 final char delim = mDelimiters.charAt( i ); 88 89 if ( mEscapableChars.indexOf( delim ) < 0 ) 90 { 91 mEscapableChars = mEscapableChars + delim; 92 } 93 } 94 } 95 } 96 97 | Popular Tags |