01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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.xerces.impl.xs.identity;
19:
20: import org.apache.xerces.xs.XSIDCDefinition;
21:
22: /**
23: * Schema key reference identity constraint.
24: *
25: * @xerces.internal
26: *
27: * @author Andy Clark, IBM
28: * @version $Id: KeyRef.java 572110 2007-09-02 19:04:44Z mrglavas $
29: */
30: public class KeyRef extends IdentityConstraint {
31:
32: //
33: // Data
34: //
35:
36: /** The key (or unique) being referred to. */
37: protected final UniqueOrKey fKey;
38:
39: //
40: // Constructors
41: //
42:
43: /** Constructs a keyref with the specified name. */
44: public KeyRef(String namespace, String identityConstraintName,
45: String elemName, UniqueOrKey key) {
46: super (namespace, identityConstraintName, elemName);
47: fKey = key;
48: type = IC_KEYREF;
49: } // <init>(String,String,String)
50:
51: //
52: // Public methods
53: //
54:
55: /** Returns the key being referred to. */
56: public UniqueOrKey getKey() {
57: return fKey;
58: } // getKey(): int
59:
60: /**
61: * {referenced key} Required if {identity-constraint category} is keyref,
62: * forbidden otherwise. An identity-constraint definition with
63: * {identity-constraint category} equal to key or unique.
64: */
65: public XSIDCDefinition getRefKey() {
66: return fKey;
67: }
68:
69: } // class KeyRef
|