/[svn]/jlscp/trunk/src/org/linuxsampler/lscp/Parser.java
ViewVC logotype

Diff of /jlscp/trunk/src/org/linuxsampler/lscp/Parser.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1490 by iliev, Sun Oct 7 20:29:41 2007 UTC revision 1491 by iliev, Mon Nov 19 19:57:51 2007 UTC
# Line 67  public final class Parser { Line 67  public final class Parser {
67           * @param list The comma separated list.           * @param list The comma separated list.
68           * @return A <code>String</code> array containing all items in the list.           * @return A <code>String</code> array containing all items in the list.
69           */           */
70          protected static String[]          public static String[]
71          parseList(String list) { return parseList(list, ','); }          parseList(String list) { return parseList(list, ','); }
72                    
73          /**          /**
# Line 76  public final class Parser { Line 76  public final class Parser {
76           * @param separator Provides the character used as separator.           * @param separator Provides the character used as separator.
77           * @return A <code>String</code> array containing all items in the list.           * @return A <code>String</code> array containing all items in the list.
78           */           */
79          protected static String[]          public static String[]
80          parseList(String list, char separator) {          parseList(String list, char separator) {
81                  if(list == null || list.length() == 0) return new String[0];                  if(list == null || list.length() == 0) return new String[0];
82                  int pos = 0;                  int pos = 0;
# Line 97  public final class Parser { Line 97  public final class Parser {
97           * @param list The comma separated list with boolean values.           * @param list The comma separated list with boolean values.
98           * @return A <code>Boolean</code> array containing all items in the list.           * @return A <code>Boolean</code> array containing all items in the list.
99           */           */
100          protected static Boolean[]          public static Boolean[]
101          parseBoolList(String list) {          parseBoolList(String list) {
102                  String[] ar = parseList(list);                  String[] ar = parseList(list);
103                                    
# Line 117  public final class Parser { Line 117  public final class Parser {
117           *           *
118           * @throws LscpException if the list contains value(s) from different type.           * @throws LscpException if the list contains value(s) from different type.
119           */           */
120          protected static Integer[]          public static Integer[]
121          parseIntList(String list) throws LscpException { return parseIntList(list, ','); }          parseIntList(String list) throws LscpException { return parseIntList(list, ','); }
122                    
123          /**          /**
# Line 129  public final class Parser { Line 129  public final class Parser {
129           *           *
130           * @throws LscpException if the list contains value(s) from different type.           * @throws LscpException if the list contains value(s) from different type.
131           */           */
132          protected static Integer[]          public static Integer[]
133          parseIntList(String list, char separator) throws LscpException {          parseIntList(String list, char separator) throws LscpException {
134          String[] ar = parseList(list, separator);          String[] ar = parseList(list, separator);
135                                    
# Line 147  public final class Parser { Line 147  public final class Parser {
147           *           *
148           * @throws LscpException if the list contains value(s) from different type.           * @throws LscpException if the list contains value(s) from different type.
149           */           */
150          protected static Float[]          public static Float[]
151          parseFloatList(String list) throws LscpException {          parseFloatList(String list) throws LscpException {
152                  String[] ar = parseList(list);                  String[] ar = parseList(list);
153                                    
# Line 162  public final class Parser { Line 162  public final class Parser {
162           * @param list The list to parse.           * @param list The list to parse.
163           * @return A <code>String</code> array containing all items in the list.           * @return A <code>String</code> array containing all items in the list.
164           */           */
165          protected static String[]          public static String[]
166          parseEscapedStringList(String list) throws LscpException {          parseEscapedStringList(String list) throws LscpException {
167                  return parseEscapedStringList(list, ',');                  return parseEscapedStringList(list, ',');
168          }          }
# Line 173  public final class Parser { Line 173  public final class Parser {
173           * @param separator Provides the character used as separator.           * @param separator Provides the character used as separator.
174           * @return A <code>String</code> array containing all items in the list.           * @return A <code>String</code> array containing all items in the list.
175           */           */
176          protected static String[]          public static String[]
177          parseEscapedStringList(String list, char separator) throws LscpException {          parseEscapedStringList(String list, char separator) throws LscpException {
178                  if(list == null || list.length() == 0) return new String[0];                  if(list == null || list.length() == 0) return new String[0];
179                  int q1 = 0, q2 = 0;                  int q1 = 0, q2 = 0;
# Line 213  public final class Parser { Line 213  public final class Parser {
213           * @return A <code>String</code> array containing all items in the list.           * @return A <code>String</code> array containing all items in the list.
214           * @throws LscpException if the list is broken.           * @throws LscpException if the list is broken.
215           */           */
216          protected static String[]          public static String[]
217          parseStringList(String list) throws LscpException {          parseStringList(String list) throws LscpException {
218                  return parseStringList(list, ',');                  return parseStringList(list, ',');
219          }          }
# Line 225  public final class Parser { Line 225  public final class Parser {
225           * @return A <code>String</code> array containing all items in the list.           * @return A <code>String</code> array containing all items in the list.
226           * @throws LscpException if the list is broken.           * @throws LscpException if the list is broken.
227           */           */
228          protected static String[]          public static String[]
229          parseStringList(String list, char separator) throws LscpException {          parseStringList(String list, char separator) throws LscpException {
230                  if(list == null || list.length() == 0) return new String[0];                  if(list == null || list.length() == 0) return new String[0];
231                  int q1 = 0, q2 = 0;                  int q1 = 0, q2 = 0;
# Line 287  public final class Parser { Line 287  public final class Parser {
287           *           *
288           * @throws LscpException if the list is broken.           * @throws LscpException if the list is broken.
289           */           */
290          protected static String[]          public static String[]
291          parseArray(String list) throws LscpException {          parseArray(String list) throws LscpException {
292                  if(list == null || list.length() == 0) return new String[0];                  if(list == null || list.length() == 0) return new String[0];
293                  int q1 = 0, q2 = 0;                  int q1 = 0, q2 = 0;
# Line 504  public final class Parser { Line 504  public final class Parser {
504           * @return New string without quotation marks if the string is quoted; else           * @return New string without quotation marks if the string is quoted; else
505           * the same string is returned.           * the same string is returned.
506           */           */
507          protected static String          public static String
508          removeQuotation(String s) {          removeQuotation(String s) {
509                  if(s == null || s.length() < 2) return s;                  if(s == null || s.length() < 2) return s;
510                  char q = s.charAt(0);                  char q = s.charAt(0);
# Line 709  public final class Parser { Line 709  public final class Parser {
709          /**          /**
710           * Determines whether the specified escaped path ends with a file separator.           * Determines whether the specified escaped path ends with a file separator.
711           */           */
712          protected static boolean          public static boolean
713          hasEndingFileSeparator(String path) {          hasEndingFileSeparator(String path) {
714                  if(path == null || path.length() < 2) return false;                  if(path == null || path.length() < 2) return false;
715                                    
# Line 723  public final class Parser { Line 723  public final class Parser {
723           * If the specified escaped path ends with a file separator,           * If the specified escaped path ends with a file separator,
724           * a new string is returned with the ending file separator removed.           * a new string is returned with the ending file separator removed.
725           */           */
726          protected static String          public static String
727          removeEndingFileSeparator(String path) {          removeEndingFileSeparator(String path) {
728                  if(path == null || path.length() < 2) return path;                  if(path == null || path.length() < 2) return path;
729                                    

Legend:
Removed from v.1490  
changed lines
  Added in v.1491

  ViewVC Help
Powered by ViewVC