|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
SchemaProcessor.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 org.apache.hivemind.internal.Module; | |
18 | ||
19 | /** | |
20 | * Object used when processing the elements contributed in an | |
21 | * {@link org.apache.hivemind.internal.Contribution}. | |
22 | * | |
23 | * @author Howard Lewis Ship | |
24 | */ | |
25 | public interface SchemaProcessor | |
26 | { | |
27 | /** | |
28 | * The SchemaProcessor is always the bottom (deepest) object on the stack. Top level objects | |
29 | * (contained by a schema, not another element) can use an | |
30 | * {@link org.apache.hivemind.schema.rules.InvokeParentRule} to add themselves to the list | |
31 | * of elements for the {@link org.apache.hivemind.internal.ConfigurationPoint} being | |
32 | * constructed. | |
33 | */ | |
34 | public void addElement(Object element); | |
35 | ||
36 | /** | |
37 | * Pushes an object onto the processor's stack. | |
38 | */ | |
39 | public void push(Object object); | |
40 | ||
41 | /** | |
42 | * Pops the top object off the stack and returns it. | |
43 | */ | |
44 | ||
45 | public Object pop(); | |
46 | ||
47 | /** | |
48 | * Peeks at the top object on the stack. | |
49 | */ | |
50 | ||
51 | public Object peek(); | |
52 | ||
53 | /** | |
54 | * Peeks at an object within the stack at the indicated depth. | |
55 | */ | |
56 | ||
57 | public Object peek(int depth); | |
58 | ||
59 | /** | |
60 | * Returns the module which contributed the current elements being processed. | |
61 | */ | |
62 | ||
63 | public Module getContributingModule(); | |
64 | ||
65 | /** | |
66 | * Return the module which defined the schema. | |
67 | * | |
68 | * @since 1.1 | |
69 | */ | |
70 | ||
71 | public Module getDefiningModule(); | |
72 | ||
73 | /** | |
74 | * Returns the path to the current element in the form a sequence of element names separated | |
75 | * with slashes. This is most often used in error messages, to help identify the position of an | |
76 | * error. | |
77 | */ | |
78 | ||
79 | public String getElementPath(); | |
80 | ||
81 | /** | |
82 | * Returns a {@link org.apache.hivemind.schema.Translator} used to convert the content of the | |
83 | * current element. Will not return null. | |
84 | */ | |
85 | ||
86 | public Translator getContentTranslator(); | |
87 | ||
88 | /** | |
89 | * Returns the {@link org.apache.hivemind.schema.Translator} for a particular attribute of the | |
90 | * current element. Will not return null. | |
91 | */ | |
92 | ||
93 | public Translator getAttributeTranslator(String attributeName); | |
94 | ||
95 | /** | |
96 | * Returns the named {@link org.apache.hivemind.schema.Translator}. | |
97 | */ | |
98 | ||
99 | public Translator getTranslator(String translator); | |
100 | } |
|