1/*
2 * reserved comment block
3 * DO NOT REMOVE OR ALTER!
4 */
5/*
6 * Licensed to the Apache Software Foundation (ASF) under one or more
7 * contributor license agreements.  See the NOTICE file distributed with
8 * this work for additional information regarding copyright ownership.
9 * The ASF licenses this file to You under the Apache License, Version 2.0
10 * (the "License"); you may not use this file except in compliance with
11 * the License.  You may obtain a copy of the License at
12 *
13 *      http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21
22package com.sun.org.apache.xerces.internal.impl.xs.identity;
23
24import com.sun.org.apache.xerces.internal.xs.ShortList;
25
26
27/**
28 * Interface for storing values associated to an identity constraint.
29 * Each value stored corresponds to a field declared for the identity
30 * constraint. One instance of an object implementing this interface
31 * is created for each identity constraint per element declaration in
32 * the instance document to store the information for this identity
33 * constraint.
34 * <p>
35 * <strong>Note:</strong> The component performing identity constraint
36 * collection and validation is responsible for providing an
37 * implementation of this interface. The component is also responsible
38 * for performing the necessary checks required by each type of identity
39 * constraint.
40 *
41 * @xerces.internal
42 *
43 * @author Andy Clark, IBM
44 *
45 */
46public interface ValueStore {
47
48    //
49    // ValueStore methods
50    //
51
52    /**
53     * Adds the specified value to the value store.
54     *
55     * @param field The field associated to the value. This reference
56     *              is used to ensure that each field only adds a value
57     *              once within a selection scope.
58     * @param mayMatch a flag indiciating whether the field may be matched.
59     * @param actualValue The value to add.
60     * @param valueType Type of the value to add.
61     * @param itemValueType If the value is a list, a list of types for each of the values in the list.
62     */
63    public void addValue(Field field, boolean mayMatch, Object actualValue, short valueType, ShortList itemValueType);
64
65    /**
66     * Since the valueStore will have access to an error reporter, this
67     * allows it to be called appropriately.
68     * @param key  the key of the localized error message
69     * @param args  the list of arguments for substitution.
70     */
71    public void reportError(String key, Object[] args);
72
73
74} // interface ValueStore
75