01: /**********************************************************************************
02:
03: Feedzeo!
04: A free and open source RSS/Atom/RDF feed aggregator
05:
06: Copyright (C) 2005-2006 Anand Rao (anandrao@users.sourceforge.net)
07:
08: This library is free software; you can redistribute it and/or
09: modify it under the terms of the GNU Lesser General Public
10: License as published by the Free Software Foundation; either
11: version 2.1 of the License, or (at your option) any later version.
12:
13: This library is distributed in the hope that it will be useful,
14: but WITHOUT ANY WARRANTY; without even the implied warranty of
15: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: Lesser General Public License for more details.
17:
18: You should have received a copy of the GNU Lesser General Public
19: License along with this library; if not, write to the Free Software
20: Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21:
22: ************************************************************************************/package css;
23:
24: import java.io.*;
25: import java.util.*;
26:
27: /**
28: *
29: * @author Anand Rao
30: */
31: public class CSSSelector {
32:
33: private String Selector;
34: private Vector PropertyList;
35:
36: /** Creates a new instance of CSSSelector */
37: public CSSSelector(String Tag) {
38: Selector = Tag;
39: PropertyList = new Vector();
40: }
41:
42: public void addProperty(CSSProperty p) {
43: PropertyList.addElement(p);
44: }
45:
46: public String toString() {
47: StringBuffer buf = new StringBuffer();
48: buf.append(Selector);
49: buf.append(CSSConst.PROPERTY_LST_START);
50: for (int i = 0; i < PropertyList.size(); i++) {
51: CSSProperty p = (CSSProperty) PropertyList.elementAt(i);
52: buf.append(p.getName());
53: buf.append(CSSConst.PROPERTY_ASSIGNMENT);
54: buf.append(p.getValueList());
55: buf.append(CSSConst.PROPERTY_LST_SEPARATOR);
56: }
57: buf.append(CSSConst.PROPERTY_LST_END);
58: return buf.toString();
59: }
60: }
|