KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > schema > SchemaProcessor


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.SymbolExpander;
18 import org.apache.hivemind.internal.Module;
19
20 /**
21  * Object used when processing the elements contributed in an
22  * {@link org.apache.hivemind.definition.Contribution}.
23  *
24  * @author Howard Lewis Ship
25  */

26 public interface SchemaProcessor
27 {
28
29     /**
30      * Pushes an object onto the processor's stack.
31      */

32     public void push(Object JavaDoc object);
33
34     /**
35      * Pops the top object off the stack and returns it.
36      */

37
38     public Object JavaDoc pop();
39
40     /**
41      * Peeks at the top object on the stack.
42      */

43
44     public Object JavaDoc peek();
45
46     /**
47      * Peeks at an object within the stack at the indicated depth.
48      */

49
50     public Object JavaDoc peek(int depth);
51
52     /**
53      * Returns the module which contributed the current elements being processed.
54      */

55
56     public Module getContributingModule();
57
58     /**
59      * Return the module which defined the schema.
60      *
61      * @since 1.1
62      */

63
64     public String JavaDoc getDefiningModuleId();
65     
66     public Module getDefiningModule();
67
68     /**
69      * Returns the path to the current element in the form a sequence of element names separated
70      * with slashes. This is most often used in error messages, to help identify the position of an
71      * error.
72      */

73
74     public String JavaDoc getElementPath();
75
76     /**
77      * Returns a {@link org.apache.hivemind.schema.Translator} used to convert the content of the
78      * current element. Will not return null.
79      */

80
81     public Translator getContentTranslator();
82
83     /**
84      * Returns the {@link org.apache.hivemind.schema.Translator} for a particular attribute of the
85      * current element. Will not return null.
86      */

87
88     public Translator getAttributeTranslator(String JavaDoc attributeName);
89
90     /**
91      * @since 1.2
92      */

93     public String JavaDoc getAttributeDefault(String JavaDoc attributeName);
94
95     /**
96      * Returns the named {@link org.apache.hivemind.schema.Translator}.
97      */

98
99     public Translator getTranslator(String JavaDoc translator);
100     
101     /**
102      * @return true if the key-attribute attribute is used in all top level elements of the schema.
103      * The elements are placed in a map to maintain backward compatibility
104      */

105     public boolean isInBackwardCompatibilityModeForMaps();
106     
107     /**
108      * @return the {@link SymbolExpander} used by the processor
109      */

110     public SymbolExpander getSymbolExpander();
111
112 }
Popular Tags