KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xerces > xni > parser > XMLComponent


1 /*
2  * Copyright 2000-2002,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.xerces.xni.parser;
18
19 /**
20  * The component interface defines methods that must be implemented
21  * by components in a parser configuration. The component methods allow
22  * the component manager to initialize the component state and notify
23  * the component when feature and property values change.
24  *
25  * @see XMLComponentManager
26  *
27  * @author Andy Clark, IBM
28  *
29  * @version $Id: XMLComponent.java,v 1.6 2004/02/24 23:15:56 mrglavas Exp $
30  */

31 public interface XMLComponent {
32
33     //
34
// XMLComponent methods
35
//
36

37     /**
38      * Resets the component. The component can query the component manager
39      * about any features and properties that affect the operation of the
40      * component.
41      *
42      * @param componentManager The component manager.
43      *
44      * @throws XNIException Thrown by component on initialization error.
45      */

46     public void reset(XMLComponentManager componentManager)
47         throws XMLConfigurationException;
48
49     /**
50      * Returns a list of feature identifiers that are recognized by
51      * this component. This method may return null if no features
52      * are recognized by this component.
53      */

54     public String JavaDoc[] getRecognizedFeatures();
55
56     /**
57      * Sets the state of a feature. This method is called by the component
58      * manager any time after reset when a feature changes state.
59      * <p>
60      * <strong>Note:</strong> Components should silently ignore features
61      * that do not affect the operation of the component.
62      *
63      * @param featureId The feature identifier.
64      * @param state The state of the feature.
65      *
66      * @throws XMLConfigurationException Thrown for configuration error.
67      * In general, components should
68      * only throw this exception if
69      * it is <strong>really</strong>
70      * a critical error.
71      */

72     public void setFeature(String JavaDoc featureId, boolean state)
73         throws XMLConfigurationException;
74
75     /**
76      * Returns a list of property identifiers that are recognized by
77      * this component. This method may return null if no properties
78      * are recognized by this component.
79      */

80     public String JavaDoc[] getRecognizedProperties();
81
82     /**
83      * Sets the value of a property. This method is called by the component
84      * manager any time after reset when a property changes value.
85      * <p>
86      * <strong>Note:</strong> Components should silently ignore properties
87      * that do not affect the operation of the component.
88      *
89      * @param propertyId The property identifier.
90      * @param value The value of the property.
91      *
92      * @throws XMLConfigurationException Thrown for configuration error.
93      * In general, components should
94      * only throw this exception if
95      * it is <strong>really</strong>
96      * a critical error.
97      */

98     public void setProperty(String JavaDoc propertyId, Object JavaDoc value)
99        throws XMLConfigurationException;
100
101     /**
102      * Returns the default state for a feature, or null if this
103      * component does not want to report a default value for this
104      * feature.
105      *
106      * @param featureId The feature identifier.
107      *
108      * @since Xerces 2.2.0
109      */

110     public Boolean JavaDoc getFeatureDefault(String JavaDoc featureId);
111
112     /**
113      * Returns the default state for a property, or null if this
114      * component does not want to report a default value for this
115      * property.
116      *
117      * @param propertyId The property identifier.
118      *
119      * @since Xerces 2.2.0
120      */

121     public Object JavaDoc getPropertyDefault(String JavaDoc propertyId);
122
123 } // interface XMLComponent
124
Popular Tags