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  package sk.uniba.euromath.document.schema.plug;
13  import java.util.Map;
14  import sk.uniba.euromath.document.schema.IQNameAcceptor;
15  /***
16   * <p>
17   * Holds list of possible element/attibute QNames, with their corresponding
18   * rules. It should throw <code>SchemaException</code> in constructor, when
19   * one element rule can accept infinite local names.
20   * </p>
21   * <p>
22   * Each rule, contained in list of accepted QNames, must be alternative to each
23   * other: we can pick one rule and create content accordingly.
24   * </p>
25   * <p>
26   * There must not be element rules and attribute rules mixed together in one
27   * instance of <code>NameListP</code>.
28   * </p>
29   * <p>
30   * Schema must not define rules for non-local elements/attributes. All local
31   * element/attribute rules can be returned using <code>getLocalNames()</code>
32   * function.
33   * </p>
34   * @param <R> rule type. instance of <code>INewElementRuleP</code> or
35   * <code>IAttributeRuleP</code> only.
36   * @author Martin Vysny
37   */
38  public interface INameListP<R extends IBaseRuleP> extends IQNameAcceptor,
39  		IForeignNodeP {
40  	/***
41  	 * <p>
42  	 * Returns map, that maps <code>String</code> to
43  	 * <code>AttributeRuleP</code> or <code>NewElementRuleP</code>. Each
44  	 * string represents one local name, and corresponding object holds rules,
45  	 * that can be used to create this element/attribute's content.
46  	 * </p>
47  	 * <p>
48  	 * General rule for schema says that each rule must generate finite set of
49  	 * local elements (elements from schema's namespace). Thus, this list will
50  	 * not be infinite.
51  	 * </p>
52  	 * @return map of allowed localnames.
53  	 */
54  	public Map<String, R> getLocalNames();
55  }