1
2
3
4
5
6
7
8
9
10
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 }