View Javadoc

1   /*
2    * Copyright 1999-2006 Faculty of Mathematics, Physics and Informatics, Comenius
3    * University, Bratislava. This file is protected by the Mozilla Public License
4    * version 1.1 (the License); you may not use this file except in compliance
5    * with the License. You may obtain a copy of the License at
6    * http://euromath2.sourceforge.net/license.html Unless required by applicable
7    * law or agreed to in writing, software distributed under the License is
8    * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
9    * KIND, either express or implied. See the License for the specific language
10   * governing permissions and limitations under the License.
11   */
12  /*
13   * This file is protected by the Mozilla Public License located in
14   * euromath2-bin.zip file, downloadable from
15   * http://sourceforge.net/projects/euromath2/.
16   */
17  package sk.uniba.euromath.document.schema;
18  import java.util.EnumSet;
19  /***
20   * Acceptor of the qname.
21   * @author Martin Vysny
22   */
23  public interface IQNameAcceptor {
24  	/***
25  	 * <p>
26  	 * Check whether the acceptor accepts given pair.
27  	 * @param namespaceUri the namespace part of the qname. Acceptor must take
28  	 * both empty-string and <code>null</code> values as a null namespace.
29  	 * </p>
30  	 * <p>
31  	 * If the acceptor accepts the attribute qnames also, then local attributes
32  	 * should have <code>null</code> as their namespace, regardless of the
33  	 * value of <code>getNamespaceUri()</code> function.
34  	 * </p>
35  	 * @param local the local name part.
36  	 * @return true if it accepts given qname, false otherwise.
37  	 */
38  	public boolean accepts(String namespaceUri, String local);
39  	/***
40  	 * Returns type of qnames, that this rule accepts. If the information is not
41  	 * known then the function should return <code>EnumSet</code> with both
42  	 * flags.
43  	 * @return one of <code>ACCEPTS_*</code> constants.
44  	 */
45  	public EnumSet<AcceptsEnum> getAccepts();
46  	/***
47  	 * Returns base namespace (the namespace of local elements).
48  	 * @return base namespace of schema, that created this object.
49  	 */
50  	public String getNamespaceUri();
51  }