KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > css > engine > value > ValueManager


1 /*
2
3    Copyright 1999-2003 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17 */

18
19 package org.apache.batik.css.engine.value;
20
21 import org.apache.batik.css.engine.CSSEngine;
22 import org.apache.batik.css.engine.CSSStylableElement;
23 import org.apache.batik.css.engine.StyleMap;
24 import org.w3c.css.sac.LexicalUnit;
25 import org.w3c.dom.DOMException JavaDoc;
26
27 /**
28  * This interface is implemented by objects which manage the values associated
29  * with a property.
30  *
31  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
32  * @version $Id: ValueManager.java,v 1.5 2005/03/27 08:58:31 cam Exp $
33  */

34 public interface ValueManager {
35
36     /**
37      * Returns the name of the property handled.
38      */

39     String JavaDoc getPropertyName();
40     
41     /**
42      * Whether the handled property is inherited or not.
43      */

44     boolean isInheritedProperty();
45
46     /**
47      * Returns the default value for the handled property.
48      */

49     Value getDefaultValue();
50
51     /**
52      * Creates a value from a lexical unit.
53      * @param lu The SAC lexical unit used to create the value.
54      * @param engine The calling CSSEngine.
55      */

56     Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException JavaDoc;
57
58     /**
59      * Creates and returns a new float value.
60      * @param unitType A unit code as defined above. The unit code can only
61      * be a float unit type
62      * @param floatValue The new float value.
63      */

64     Value createFloatValue(short unitType, float floatValue)
65     throws DOMException JavaDoc;
66
67     /**
68      * Creates and returns a new string value.
69      * @param type A string code as defined in CSSPrimitiveValue. The string
70      * code can only be a string unit type.
71      * @param value The new string value.
72      * @param engine The CSS engine.
73      */

74     Value createStringValue(short type, String JavaDoc value, CSSEngine engine)
75         throws DOMException JavaDoc;
76
77     /**
78      * Computes the given value.
79      * @param elt The owner of the value.
80      * @param pseudo The pseudo element.
81      * @param engine The CSSEngine.
82      * @param idx The property index in the engine.
83      * @param sm The computed style map.
84      * @param value The value to compute.
85      */

86     Value computeValue(CSSStylableElement elt,
87                        String JavaDoc pseudo,
88                        CSSEngine engine,
89                        int idx,
90                        StyleMap sm,
91                        Value value);
92                        
93 }
94
Popular Tags