Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/steadystate/css/dom/Property.java


1   /*
2    * Property.java
3    *
4    * Steady State CSS2 Parser
5    *
6    * Copyright (C) 1999, 2002 Steady State Software Ltd.  All rights reserved.
7    *
8    * This library is free software; you can redistribute it and/or
9    * modify it under the terms of the GNU Lesser General Public
10   * License as published by the Free Software Foundation; either
11   * version 2 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21   *
22   * To contact the authors of the library, write to Steady State Software Ltd.,
23   * 49 Littleworth, Wing, Buckinghamshire, LU7 0JX, England
24   *
25   * http://www.steadystate.com/css/
26   * mailto:css@steadystate.co.uk
27   *
28   * $Id: Property.java,v 1.1.1.1 2003/12/28 21:22:55 davidsch Exp $
29   */
30   
31  package com.steadystate.css.dom;
32  
33  import java.io.Serializable;
34  import org.w3c.dom.css.CSSValue;
35  
36  /** 
37   *
38   * @author  David Schweinsberg
39   * @version $Release$
40   */
41  public class Property implements Serializable {
42  
43      private String _name;
44      private CSSValue _value;
45      private boolean _important;
46  
47      /** Creates new Property */
48      public Property(String name, CSSValue value, boolean important) {
49          _name = name;
50          _value = value;
51          _important = important;
52      }
53  
54      public String getName() {
55          return _name;
56      }
57  
58      public CSSValue getValue() {
59          return _value;
60      }
61  
62      public boolean isImportant() {
63          return _important;
64      }
65  
66      public void setValue(CSSValue value) {
67          _value = value;
68      }
69      
70      public void setImportant(boolean important) {
71          _important = important;
72      }
73      
74      public String toString() {
75          return _name + ": "
76              + _value.toString()
77              + (_important ? " !important" : "");
78      }
79  }