1 | /*
|
---|
2 | * Copyright 2000-2002,2004 The Apache Software Foundation
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | *
|
---|
16 | */
|
---|
17 | package org.apache.tools.ant.taskdefs.optional.depend.constantpool;
|
---|
18 |
|
---|
19 | /**
|
---|
20 | * A Constant Pool entry which represents a constant value.
|
---|
21 | *
|
---|
22 | */
|
---|
23 | public abstract class ConstantCPInfo extends ConstantPoolEntry {
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The entry's untyped value. Each subclass interprets the constant
|
---|
27 | * value based on the subclass's type. The value here must be
|
---|
28 | * compatible.
|
---|
29 | */
|
---|
30 | private Object value;
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * Initialise the constant entry.
|
---|
34 | *
|
---|
35 | * @param tagValue the constant pool entry type to be used.
|
---|
36 | * @param entries the number of constant pool entry slots occupied by
|
---|
37 | * this entry.
|
---|
38 | */
|
---|
39 | protected ConstantCPInfo(int tagValue, int entries) {
|
---|
40 | super(tagValue, entries);
|
---|
41 | }
|
---|
42 |
|
---|
43 | /**
|
---|
44 | * Get the value of the constant.
|
---|
45 | *
|
---|
46 | * @return the value of the constant (untyped).
|
---|
47 | */
|
---|
48 | public Object getValue() {
|
---|
49 | return value;
|
---|
50 | }
|
---|
51 |
|
---|
52 | /**
|
---|
53 | * Set the constant value.
|
---|
54 | *
|
---|
55 | * @param newValue the new untyped value of this constant.
|
---|
56 | */
|
---|
57 | public void setValue(Object newValue) {
|
---|
58 | value = newValue;
|
---|
59 | }
|
---|
60 |
|
---|
61 | }
|
---|
62 |
|
---|