1 30 31 package com.steadystate.css.dom; 32 33 import java.io.Serializable ; 34 import org.w3c.dom.css.*; 35 import org.w3c.css.sac.*; 36 37 42 public class CounterImpl implements Counter, Serializable { 43 44 private String _identifier; 45 private String _listStyle; 46 private String _separator; 47 48 49 public CounterImpl(boolean separatorSpecified, LexicalUnit lu) { 50 LexicalUnit next = lu; 51 _identifier = next.getStringValue(); 52 next = next.getNextLexicalUnit(); 53 if (separatorSpecified && (next != null)) { 54 next = next.getNextLexicalUnit(); 55 _separator = next.getStringValue(); 56 next = next.getNextLexicalUnit(); 57 } 58 if (next != null) { 59 _listStyle = next.getStringValue(); 60 next = next.getNextLexicalUnit(); 61 } 62 } 63 64 public String getIdentifier() { 65 return _identifier; 66 } 67 68 public String getListStyle() { 69 return _listStyle; 70 } 71 72 public String getSeparator() { 73 return _separator; 74 } 75 76 public String toString() { 77 StringBuffer sb = new StringBuffer (); 78 if (_separator == null) { 79 sb.append("counter("); 81 } else { 82 sb.append("counters("); 84 } 85 sb.append(_identifier); 86 if (_separator != null) { 87 sb.append(", \"").append(_separator).append("\""); 88 } 89 if (_listStyle != null) { 90 sb.append(", ").append(_listStyle); 91 } 92 sb.append(")"); 93 return sb.toString(); 94 } 95 } | Popular Tags |