KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xerces > impl > xs > identity > KeyRef


1 /*
2  * Copyright 2001, 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.xerces.impl.xs.identity;
18
19 import org.apache.xerces.xs.XSIDCDefinition;
20
21 /**
22  * Schema key reference identity constraint.
23  *
24  * @xerces.internal
25  *
26  * @author Andy Clark, IBM
27  * @version $Id: KeyRef.java,v 1.7 2004/10/06 15:14:51 mrglavas Exp $
28  */

29 public class KeyRef
30     extends IdentityConstraint {
31
32     //
33
// Data
34
//
35

36     /** The key (or unique) being referred to. */
37     protected UniqueOrKey fKey;
38
39     //
40
// Constructors
41
//
42

43     /** Constructs a keyref with the specified name. */
44     public KeyRef(String JavaDoc namespace, String JavaDoc identityConstraintName,
45                   String JavaDoc 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
70
Popular Tags