KickJava   Java API By Example, From Geeks To Geeks.

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


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
20 /**
21  * Interface for a field activator. The field activator is responsible
22  * for activating fields within a specific scope; the caller merely
23  * requests the fields to be activated.
24  *
25  * @xerces.internal
26  *
27  * @author Andy Clark, IBM
28  *
29  * @version $Id: FieldActivator.java,v 1.7 2004/10/06 15:14:51 mrglavas Exp $
30  */

31 public interface FieldActivator {
32     
33     //
34
// FieldActivator methods
35
//
36

37     /**
38      * Start the value scope for the specified identity constraint. This
39      * method is called when the selector matches in order to initialize
40      * the value store.
41      *
42      * @param identityConstraint The identity constraint.
43      * @param initialDepth the depth at which the selector began matching
44      */

45     public void startValueScopeFor(IdentityConstraint identityConstraint,
46             int initialDepth);
47
48     /**
49      * Request to activate the specified field. This method returns the
50      * matcher for the field.
51      * It's also important for the implementor to ensure that it marks whether a Field
52      * is permitted to match a value--that is, to call the setMayMatch(Field, Boolean) method.
53      *
54      * @param field The field to activate.
55      * @param initialDepth the 0-indexed depth in the instance document at which the Selector began to match.
56      */

57     public XPathMatcher activateField(Field field, int initialDepth);
58     
59     /**
60      * Sets whether the given field is permitted to match a value.
61      * This should be used to catch instance documents that try
62      * and match a field several times in the same scope.
63      *
64      * @param field The field that may be permitted to be matched.
65      * @param state Boolean indiciating whether the field may be matched.
66      */

67     public void setMayMatch(Field field, Boolean JavaDoc state);
68     
69     /**
70      * Returns whether the given field is permitted to match a value.
71      *
72      * @param field The field that may be permitted to be matched.
73      * @return Boolean indicating whether the field may be matched.
74      */

75     public Boolean JavaDoc mayMatch(Field field);
76
77     /**
78      * Ends the value scope for the specified identity constraint.
79      *
80      * @param identityConstraint The identity constraint.
81      * @param initialDepth the 0-indexed depth where the Selector began to match.
82      */

83     public void endValueScopeFor(IdentityConstraint identityConstraint, int initialDepth);
84
85 } // interface FieldActivator
86
Popular Tags