1 /*
   2  * reserved comment block
   3  * DO NOT REMOVE OR ALTER!
   4  */
   5 /*
   6  * Copyright 2000-2002,2004 The Apache Software Foundation.
   7  *
   8  * Licensed under the Apache License, Version 2.0 (the "License");
   9  * you may not use this file except in compliance with the License.
  10  * You may obtain a copy of the License at
  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 
  21 package com.sun.org.apache.xerces.internal.xni.parser;
  22 
  23 import com.sun.org.apache.xerces.internal.util.FeatureState;
  24 import com.sun.org.apache.xerces.internal.util.PropertyState;
  25 
  26 /**
  27  * The component manager manages a parser configuration and the components
  28  * that make up that configuration. The manager notifies each component
  29  * before parsing to allow the components to initialize their state; and
  30  * also any time that a parser feature or property changes.
  31  * <p>
  32  * The methods of the component manager allow components to query features
  33  * and properties that affect the operation of the component.
  34  *
  35  * @see XMLComponent
  36  *
  37  * @author Andy Clark, IBM
  38  *
  39  */
  40 public interface XMLComponentManager {
  41 
  42     //
  43     // XMLComponentManager methods
  44     //
  45 
  46     /**
  47      * Returns the state of a feature.
  48      *
  49      * @param featureId The feature identifier.
  50      *
  51      * @throws XMLConfigurationException Thrown on configuration error.
  52      */
  53     public boolean getFeature(String featureId)
  54         throws XMLConfigurationException;
  55 
  56     /**
  57      * Returns the state of a feature.
  58      * Does not throw exceptions.
  59      *
  60      * @param featureId The feature identifier.
  61      * @param defaultValue Default value if future is not available.
  62      */
  63     public boolean getFeature(String featureId, boolean defaultValue);
  64 
  65     /**
  66      * Returns the value of a property.
  67      *
  68      * @param propertyId The property identifier.
  69      *
  70     * @throws XMLConfigurationException Thrown on configuration error.
  71      */
  72     public Object getProperty(String propertyId)
  73         throws XMLConfigurationException;
  74 
  75     /**
  76      * Returns the value of a property.
  77      * Does not throw exceptions.
  78      *
  79      * @param propertyId The property identifier.
  80      * @param defaultObject Return value if property is not available.
  81      *
  82      */
  83     public Object getProperty(String propertyId, Object defaultObject);
  84 
  85     public FeatureState getFeatureState(String featureId);
  86 
  87     public PropertyState getPropertyState(String propertyId);
  88 
  89 } // interface XMLComponentManager