KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > teamkonzept > publishing > markups > TKMarkupIntParamClass


1 /*
2  * $Header: /cvsroot/webman-cms/source/webman/com/teamkonzept/publishing/markups/TKMarkupIntParamClass.java,v 1.5 2000/05/22 15:01:28 careck Exp $
3  *
4  */

5 package com.teamkonzept.publishing.markups;
6
7 public class TKMarkupIntParamClass extends TKMarkupParamClass {
8
9     public String JavaDoc checkValue (String JavaDoc raw) {
10
11         if (raw == null) return raw;
12
13         String JavaDoc value = raw.trim();
14         
15         int pos = 0;
16         while (pos < value.length()) {
17         
18             char chr = value.charAt (pos++);
19             
20             if (digitCodes.indexOf(chr) == -1) return null;
21         }
22
23         return value;
24     }
25
26     public int parseUnquotedValue (String JavaDoc text, int pos, StringBuffer JavaDoc value)
27         throws TKMarkupParserException {
28     
29         if (value != null) value.setLength (0);
30
31         while (pos < text.length()) {
32         
33             char chr = text.charAt (pos);
34             if (digitCodes.indexOf(chr) == -1) break;
35             if (value != null) value.append (chr);
36
37             pos++;
38         }
39
40         return pos;
41     }
42
43     public String JavaDoc wrapValue (String JavaDoc value) {
44
45         return value;
46     }
47 }
48
49
Popular Tags