1 /*
2
3 Licensed to the Apache Software Foundation (ASF) under one or more
4 contributor license agreements. See the NOTICE file distributed with
5 this work for additional information regarding copyright ownership.
6 The ASF licenses this file to You under the Apache License, Version 2.0
7 (the "License"); you may not use this file except in compliance with
8 the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17
18 */
19 package org.apache.batik.css.engine.value;
20
21 import org.w3c.dom.DOMException;
22
23 /**
24 * This interface represents a property value.
25 *
26 * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
27 * @version $Id: Value.java 1733416 2016-03-03 07:07:13Z gadams $
28 */
29 public interface Value {
30
31 /**
32 * A string representation of the current value.
33 */
34 String getCssText();
35
36 /**
37 * A code defining the type of the value.
38 */
39 short getCssValueType();
40
41 /**
42 * The type of the value.
43 */
44 short getPrimitiveType();
45
46 /**
47 * This method is used to get the float value.
48 * @exception DOMException
49 * INVALID_ACCESS_ERR: Raised if the value doesn't contain a float
50 * value.
51 */
52 float getFloatValue() throws DOMException;
53
54 /**
55 * This method is used to get the string value.
56 * @exception DOMException
57 * INVALID_ACCESS_ERR: Raised if the value doesn't contain a string
58 * value.
59 */
60 String getStringValue() throws DOMException;
61
62 /**
63 * The red value of the RGB color.
64 * @exception DOMException
65 * INVALID_ACCESS_ERR: Raised if the value doesn't contain a RGB
66 * color value.
67 */
68 Value getRed() throws DOMException;
69
70 /**
71 * The green value of the RGB color.
72 * @exception DOMException
73 * INVALID_ACCESS_ERR: Raised if the value doesn't contain a RGB
74 * color value.
75 */
76 Value getGreen() throws DOMException;
77
78 /**
79 * The blue value of the RGB color.
80 * @exception DOMException
81 * INVALID_ACCESS_ERR: Raised if the value doesn't contain a RGB
82 * color value.
83 */
84 Value getBlue() throws DOMException;
85
86 /**
87 * The number of <code>CSSValues</code> in the list. The range of valid
88 * values of the indices is <code>0</code> to <code>length-1</code>
89 * inclusive.
90 * @exception DOMException
91 * INVALID_ACCESS_ERR: Raised if the value doesn't contain a list
92 * value.
93 */
94 int getLength() throws DOMException;
95
96 /**
97 * Used to retrieve a rule by ordinal index.
98 * @return The style rule at the <code>index</code> position in the
99 * list, or <code>null</code> if that is not a valid index.
100 * @exception DOMException
101 * INVALID_ACCESS_ERR: Raised if the value doesn't contain a list
102 * value.
103 */
104 Value item(int index) throws DOMException;
105
106 /**
107 * The top value of the rect.
108 * @exception DOMException
109 * INVALID_ACCESS_ERR: Raised if the value doesn't contain a Rect
110 * value.
111 */
112 Value getTop() throws DOMException;
113
114 /**
115 * The right value of the rect.
116 * @exception DOMException
117 * INVALID_ACCESS_ERR: Raised if the value doesn't contain a Rect
118 * value.
119 */
120 Value getRight() throws DOMException;
121
122 /**
123 * The bottom value of the rect.
124 * @exception DOMException
125 * INVALID_ACCESS_ERR: Raised if the value doesn't contain a Rect
126 * value.
127 */
128 Value getBottom() throws DOMException;
129
130 /**
131 * The left value of the rect.
132 * @exception DOMException
133 * INVALID_ACCESS_ERR: Raised if the value doesn't contain a Rect
134 * value.
135 */
136 Value getLeft() throws DOMException;
137
138 /**
139 * The identifier value of the counter.
140 * @exception DOMException
141 * INVALID_ACCESS_ERR: Raised if the value doesn't contain a Counter
142 * value.
143 */
144 String getIdentifier() throws DOMException;
145
146 /**
147 * The listStyle value of the counter.
148 * @exception DOMException
149 * INVALID_ACCESS_ERR: Raised if the value doesn't contain a Counter
150 * value.
151 */
152 String getListStyle() throws DOMException;
153
154 /**
155 * The separator value of the counter.
156 * @exception DOMException
157 * INVALID_ACCESS_ERR: Raised if the value doesn't contain a Counter
158 * value.
159 */
160 String getSeparator() throws DOMException;
161 }
162