KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xerces > impl > xs > models > XSCMValidator


1 /*
2  * Copyright 2001-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.models;
18
19 import org.apache.xerces.xni.QName;
20 import org.apache.xerces.impl.xs.SubstitutionGroupHandler;
21 import org.apache.xerces.impl.xs.XMLSchemaException;
22
23 import java.util.Vector JavaDoc;
24
25 /**
26  * Note: State of the content model is stored in the validator
27  *
28  * @xerces.internal
29  *
30  * @author Sandy Gao, IBM
31  * @author Elena Litani, IBM
32  * @version $Id: XSCMValidator.java,v 1.8 2004/10/06 15:14:53 mrglavas Exp $
33  */

34 public interface XSCMValidator {
35
36
37     public static final short FIRST_ERROR = -1;
38
39     // on subsequent errors the validator should not report
40
// an error
41
//
42
public static final short SUBSEQUENT_ERROR = -2;
43
44     /**
45      * This methods to be called on entering a first element whose type
46      * has this content model. It will return the initial state of the content model
47      *
48      * @return Start state of the content model
49      */

50     public int[] startContentModel();
51
52
53     /**
54      * The method corresponds to one transaction in the content model.
55      *
56      * @param elementName
57      * @param state Current state
58      * @return element decl or wildcard decl that
59      * corresponds to the element from the Schema grammar
60      */

61     public Object JavaDoc oneTransition (QName elementName, int[] state, SubstitutionGroupHandler subGroupHandler);
62
63
64     /**
65      * The method indicates the end of list of children
66      *
67      * @param state Current state of the content model
68      * @return true if the last state was a valid final state
69      */

70     public boolean endContentModel (int[] state);
71
72     /**
73      * check whether this content violates UPA constraint.
74      *
75      * @param subGroupHandler the substitution group handler
76      * @return true if this content model contains other or list wildcard
77      */

78     public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler) throws XMLSchemaException;
79
80     /**
81      * Check which elements are valid to appear at this point. This method also
82      * works if the state is in error, in which case it returns what should
83      * have been seen.
84      *
85      * @param state the current state
86      * @return a Vector whose entries are instances of
87      * either XSWildcardDecl or XSElementDecl.
88      */

89     public Vector JavaDoc whatCanGoHere(int[] state);
90     
91 } // XSCMValidator
92
Popular Tags