1. /*
  2. * Copyright 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. package com.sun.org.apache.xerces.internal.impl;
  17. import java.io.IOException;
  18. import com.sun.org.apache.xerces.internal.xni.XNIException;
  19. import com.sun.org.apache.xerces.internal.xni.grammars.XMLDTDDescription;
  20. import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
  21. import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
  22. /**
  23. * <p>This interface extends <code>XMLEntityResolver</code> providing
  24. * a method to resolve external subsets for documents which do not
  25. * explicitly provide one. The application can register an object that
  26. * implements this interface with the parser configuration. If registered,
  27. * it will be queried to locate an external subset when none is provided,
  28. * even for documents that do not contain DOCTYPE declarations. If the
  29. * registered external subset resolver does not provide an external subset
  30. * for a given document, it should return <code>null</code>.</p>
  31. *
  32. * @author Michael Glavassevich, IBM
  33. *
  34. * @version $Id: ExternalSubsetResolver.java,v 1.1.1.1 2004/05/04 10:21:42 vk112360 Exp $
  35. */
  36. public interface ExternalSubsetResolver
  37. extends XMLEntityResolver {
  38. //
  39. // ExternalSubsetResolver methods
  40. //
  41. /**
  42. * <p>Locates an external subset for documents which do not explicitly
  43. * provide one. If no external subset is provided, this method should
  44. * return <code>null</code>.</p>
  45. *
  46. * @param grammarDescription a description of the DTD
  47. *
  48. * @throws XNIException Thrown on general error.
  49. * @throws IOException Thrown if resolved entity stream cannot be
  50. * opened or some other i/o error occurs.
  51. */
  52. public XMLInputSource getExternalSubset(XMLDTDDescription grammarDescription)
  53. throws XNIException, IOException;
  54. } // interface ExternalSubsetResolver