org.apache.xerces.util

Class EntityResolver2Wrapper

public class EntityResolver2Wrapper extends Object implements ExternalSubsetResolver

This class wraps a SAX entity resolver (EntityResolver2) in an XNI entity resolver.

Version: $Id: EntityResolver2Wrapper.java,v 1.5 2005/05/02 21:44:37 mrglavas Exp $

Author: Michael Glavassevich, IBM

Field Summary
protected EntityResolver2fEntityResolver
An instance of SAX2 Extensions 1.1's EntityResolver2.
Constructor Summary
EntityResolver2Wrapper()
Default constructor.
EntityResolver2Wrapper(EntityResolver2 entityResolver)

Creates a new instance wrapping the given SAX entity resolver.

Method Summary
EntityResolver2getEntityResolver()

Returns the SAX entity resolver wrapped by this object.

XMLInputSourcegetExternalSubset(XMLDTDDescription grammarDescription)

Locates an external subset for documents which do not explicitly provide one.

XMLInputSourceresolveEntity(XMLResourceIdentifier resourceIdentifier)
Resolves an external parsed entity.
voidsetEntityResolver(EntityResolver2 entityResolver)

Sets the SAX entity resolver wrapped by this object.

Field Detail

fEntityResolver

protected EntityResolver2 fEntityResolver
An instance of SAX2 Extensions 1.1's EntityResolver2.

Constructor Detail

EntityResolver2Wrapper

public EntityResolver2Wrapper()
Default constructor.

EntityResolver2Wrapper

public EntityResolver2Wrapper(EntityResolver2 entityResolver)

Creates a new instance wrapping the given SAX entity resolver.

Parameters: entityResolver the SAX entity resolver to wrap

Method Detail

getEntityResolver

public EntityResolver2 getEntityResolver()

Returns the SAX entity resolver wrapped by this object.

Returns: the SAX entity resolver wrapped by this object

getExternalSubset

public XMLInputSource getExternalSubset(XMLDTDDescription grammarDescription)

Locates an external subset for documents which do not explicitly provide one. If no external subset is provided, this method should return null.

Parameters: grammarDescription a description of the DTD

Throws: XNIException Thrown on general error. IOException Thrown if resolved entity stream cannot be opened or some other i/o error occurs.

resolveEntity

public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
Resolves an external parsed entity. If the entity cannot be resolved, this method should return null.

Parameters: resourceIdentifier contains the physical co-ordinates of the resource to be resolved

Throws: XNIException Thrown on general error. IOException Thrown if resolved entity stream cannot be opened or some other i/o error occurs.

setEntityResolver

public void setEntityResolver(EntityResolver2 entityResolver)

Sets the SAX entity resolver wrapped by this object.

Parameters: entityResolver the SAX entity resolver to wrap

Copyright © 1999-2005 Apache XML Project. All Rights Reserved.