org.apache.cocoon.components.validation.impl
Class ValidationResolver

java.lang.Object
  extended by org.apache.cocoon.components.validation.impl.ValidationResolver
All Implemented Interfaces:
EntityResolver
Direct Known Subclasses:
JaxpResolver, JingResolver

public class ValidationResolver
extends Object
implements EntityResolver

An internal InputSource resolver that can be used while parsing schemas.

This instance will track all resolved external sources and will store their validity information. An aggregated SourceValidity for all resolved sources can be retrieved when closing this instance.


Constructor Summary
ValidationResolver(SourceResolver sourceResolver, EntityResolver entityResolver)
          Create a new ValidationResolver instance.
 
Method Summary
 SourceValidity close()
          Close this ValidationResolver instance, releasing all created Sources back to the SourceResolver and returning an aggregated SourceValidity.
protected  void finalize()
          Ensure that when this object is garbage collected, the close() method is executed.
 InputSource resolveEntity(String systemId)
          Resolve an entity identified by a specific system identifier as an InputSource.
 InputSource resolveEntity(String publicId, String systemId)
          Resolve an entity identified by a specific system and public identifier as an InputSource.
 InputSource resolveEntity(String base, String publicId, String systemId)
          Resolve an entity identified by a specific system and public identifier and relative to a specified base location as an InputSource.
 InputSource resolveSource(Source source)
          Resolve a Source into an InputSource.
 InputSource resolveSource(Source source, String systemId)
          Resolve a Source into an InputSource, specifying a specific system identifier.
 InputSource resolveSource(Source source, String systemId, String publicId)
          Resolve a Source into an InputSource, specifying both a specific system identifier and a public identifier.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationResolver

public ValidationResolver(SourceResolver sourceResolver,
                          EntityResolver entityResolver)

Create a new ValidationResolver instance.

Throws:
NullPointerException - if one of the specified SourceResolver or EntityResolver was null.
Method Detail

resolveSource

public InputSource resolveSource(Source source)
                          throws IOException,
                                 SAXException

Resolve a Source into an InputSource.

Throws:
IOException
SAXException

resolveSource

public InputSource resolveSource(Source source,
                                 String systemId)
                          throws IOException,
                                 SAXException

Resolve a Source into an InputSource, specifying a specific system identifier.

Throws:
IOException
SAXException

resolveSource

public InputSource resolveSource(Source source,
                                 String systemId,
                                 String publicId)
                          throws IOException,
                                 SAXException

Resolve a Source into an InputSource, specifying both a specific system identifier and a public identifier.

If the specified system identifier was null the returned InputSource's system identifier will be obtained calling the Source.getURI() method.

Throws:
IOException
SAXException

resolveEntity

public InputSource resolveEntity(String systemId)
                          throws IOException,
                                 SAXException

Resolve an entity identified by a specific system identifier as an InputSource.

Throws:
IOException
SAXException

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws IOException,
                                 SAXException

Resolve an entity identified by a specific system and public identifier as an InputSource.

Specified by:
resolveEntity in interface EntityResolver
Throws:
IOException
SAXException

resolveEntity

public InputSource resolveEntity(String base,
                                 String publicId,
                                 String systemId)
                          throws IOException,
                                 SAXException

Resolve an entity identified by a specific system and public identifier and relative to a specified base location as an InputSource.

Throws:
IOException
SAXException

close

public SourceValidity close()

Close this ValidationResolver instance, releasing all created Sources back to the SourceResolver and returning an aggregated SourceValidity.


finalize

protected void finalize()
                 throws Throwable

Ensure that when this object is garbage collected, the close() method is executed.

Overrides:
finalize in class Object
Throws:
Throwable


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.