KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2
3    Copyright 2002-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 package org.apache.batik.css.engine.value;
19
20 import org.w3c.dom.DOMException JavaDoc;
21 import org.w3c.dom.css.CSSValue;
22
23 /**
24  * This class provides an abstract implementation of the Value interface.
25  *
26  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
27  * @version $Id: AbstractValue.java,v 1.4 2004/08/18 07:12:53 vhardy Exp $
28  */

29 public abstract class AbstractValue implements Value {
30     
31     /**
32      * Implements {@link Value#getCssValueType()}.
33      */

34     public short getCssValueType() {
35         return CSSValue.CSS_PRIMITIVE_VALUE;
36     }
37
38     /**
39      * Implements {@link Value#getPrimitiveType()}.
40      */

41     public short getPrimitiveType() {
42         throw createDOMException();
43     }
44
45     /**
46      * Implements {@link Value#getFloatValue()}.
47      */

48     public float getFloatValue() throws DOMException JavaDoc {
49         throw createDOMException();
50     }
51
52     /**
53      * Implements {@link Value#getStringValue()}.
54      */

55     public String JavaDoc getStringValue() throws DOMException JavaDoc {
56         throw createDOMException();
57     }
58
59     /**
60      * Implements {@link Value#getRed()}.
61      */

62     public Value getRed() throws DOMException JavaDoc {
63         throw createDOMException();
64     }
65
66     /**
67      * Implements {@link Value#getGreen()}.
68      */

69     public Value getGreen() throws DOMException JavaDoc {
70         throw createDOMException();
71     }
72
73     /**
74      * Implements {@link Value#getBlue()}.
75      */

76     public Value getBlue() throws DOMException JavaDoc {
77         throw createDOMException();
78     }
79
80     /**
81      * Implements {@link Value#getLength()}.
82      */

83     public int getLength() throws DOMException JavaDoc {
84         throw createDOMException();
85     }
86
87     /**
88      * Implements {@link Value#item(int)}.
89      */

90     public Value item(int index) throws DOMException JavaDoc {
91         throw createDOMException();
92     }
93
94     /**
95      * Implements {@link Value#getTop()}.
96      */

97     public Value getTop() throws DOMException JavaDoc {
98         throw createDOMException();
99     }
100
101     /**
102      * Implements {@link Value#getRight()}.
103      */

104     public Value getRight() throws DOMException JavaDoc {
105         throw createDOMException();
106     }
107
108     /**
109      * Implements {@link Value#getBottom()}.
110      */

111     public Value getBottom() throws DOMException JavaDoc {
112         throw createDOMException();
113     }
114
115     /**
116      * Implements {@link Value#getLeft()}.
117      */

118     public Value getLeft() throws DOMException JavaDoc {
119         throw createDOMException();
120     }
121
122     /**
123      * Implements {@link Value#getIdentifier()}.
124      */

125     public String JavaDoc getIdentifier() throws DOMException JavaDoc {
126         throw createDOMException();
127     }
128
129     /**
130      * Implements {@link Value#getListStyle()}.
131      */

132     public String JavaDoc getListStyle() throws DOMException JavaDoc {
133         throw createDOMException();
134     }
135
136     /**
137      * Implements {@link Value#getSeparator()}.
138      */

139     public String JavaDoc getSeparator() throws DOMException JavaDoc {
140         throw createDOMException();
141     }
142
143     /**
144      * Creates an INVALID_ACCESS_ERR exception.
145      */

146     protected DOMException JavaDoc createDOMException() {
147         Object JavaDoc[] p = new Object JavaDoc[] { new Integer JavaDoc(getCssValueType()) };
148         String JavaDoc s = Messages.formatMessage("invalid.value.access", p);
149         return new DOMException JavaDoc(DOMException.INVALID_ACCESS_ERR, s);
150     }
151 }
152
Popular Tags