|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
ElementModel.java | - | - | - | - |
|
1 | // Copyright 2004, 2005 The Apache Software Foundation | |
2 | // | |
3 | // Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | // you may not use this file except in compliance with the License. | |
5 | // You may obtain a copy of the License at | |
6 | // | |
7 | // http://www.apache.org/licenses/LICENSE-2.0 | |
8 | // | |
9 | // Unless required by applicable law or agreed to in writing, software | |
10 | // distributed under the License is distributed on an "AS IS" BASIS, | |
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | // See the License for the specific language governing permissions and | |
13 | // limitations under the License. | |
14 | ||
15 | package org.apache.hivemind.schema; | |
16 | ||
17 | import java.util.List; | |
18 | ||
19 | import org.apache.hivemind.Locatable; | |
20 | import org.apache.hivemind.parse.AnnotationHolder; | |
21 | ||
22 | /** | |
23 | * Identifies an element that may occur within some schema. Because elements may be nested, an | |
24 | * ElementModel is also a {@link org.apache.hivemind.schema.Schema}. | |
25 | * | |
26 | * @author Howard Lewis Ship | |
27 | */ | |
28 | public interface ElementModel extends AnnotationHolder, Locatable | |
29 | { | |
30 | /** | |
31 | * Returns the name of the element. | |
32 | */ | |
33 | public String getElementName(); | |
34 | ||
35 | /** | |
36 | * Returns a List of {@link ElementModel}, identifing the elements which may be enclosed by the | |
37 | * modeled element. | |
38 | * <p> | |
39 | * The returned list is unmodifiabled and may be empty, but won't be null. | |
40 | */ | |
41 | public List getElementModel(); | |
42 | ||
43 | /** | |
44 | * Returns a List of {@link AttributeModel}s. The List is unmodifiable and won't be null, but | |
45 | * may be empty. | |
46 | */ | |
47 | public List getAttributeModels(); | |
48 | ||
49 | public AttributeModel getAttributeModel(String name); | |
50 | ||
51 | /** | |
52 | * Returns the name of the attribute whose value can be used as a key for an instance of an | |
53 | * Element with this ElementModel. This key is usually used to index a configuration | |
54 | * contribution inside a Map. | |
55 | * | |
56 | * @since 1.1 | |
57 | */ | |
58 | public String getKeyAttribute(); | |
59 | ||
60 | /** | |
61 | * Returns a List of {@link org.apache.hivemind.schema.Rule}. The List is unmodifiable and | |
62 | * won't but null, but could be empty. | |
63 | */ | |
64 | public List getRules(); | |
65 | ||
66 | /** | |
67 | * Returns the translator used for character content within the body of the element; may return | |
68 | * null. | |
69 | */ | |
70 | public String getContentTranslator(); | |
71 | ||
72 | } |
|