1 /* 2 * Copyright 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.ws.jaxme.xs; 18 19 20 21 /** 22 * This reference represents a key used to look up other elements. It does 23 * not infer any extra constraints other than if the match criteria exists 24 * then the values matched must exist within the refered identity constraint. 25 * For more information please refer to the xs:keyref tag. 26 * 27 * @see XSElement 28 * @see XSIdentityConstraint 29 * 30 * @author <a HREF="mailto:mrck1996@yahoo.co.uk">Chris Kirk</a> 31 */ 32 public interface XSKeyRef extends XSOpenAttrs { 33 /** 34 * Returns the array of annotations. 35 */ 36 public XSAnnotation[] getAnnotations(); 37 38 /** 39 * Returns the name of this constraint. 40 */ 41 public String getName(); 42 43 /** 44 * Returns the name of the unique or key identity constraint that this 45 * keyref references. The constraint must either be declared on the same 46 * element as this keyref or a descendant. 47 */ 48 public XSIdentityConstraint getIdentityConstraint(); 49 50 /** 51 * Returns an array of references to element and attributes. All references 52 * are relative to the element that declares this keyref.<p> 53 * 54 * The result is a two dimensional array, the first dimension corresponds to 55 * each xs:field used to declare the constraint. The second dimension is 56 * for each 'or' used within the fields xpath query. <p> 57 * 58 * Only tags and attributes that were matched by the xpath will be in the 59 * result, any xpath that fails to match anything will not be stored 60 * in this array.<p> 61 */ 62 public XSElementOrAttrRef[][] getMatchCriteria(); 63 } 64