Top Description Fields Constructors Methods
com.sun.msv.reader

public Class Controller

extends Object
implements GrammarReaderController2, ErrorHandler
Class Inheritance
All Implemented Interfaces
org.xml.sax.ErrorHandler, com.sun.msv.reader.GrammarReaderController2, com.sun.msv.reader.GrammarReaderController, org.xml.sax.EntityResolver
Imports
java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.w3c.dom.ls.LSResourceResolver, org.xml.sax.ErrorHandler, .InputSource, .Locator, .SAXException, .SAXParseException, org.xml.sax.helpers.LocatorImpl

Internal view of GrammarReaderController. This class wraps a GrammarReaderController and adds several convenient methods for the caller.

Field Summary

Modifier and TypeField and Description
private boolean
_hadError

This flag will be set to true in case of any error.

private final GrammarReaderController
core

Controller works as a wrapper to this object.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
error(Locator[] locs, String errorMessage, Exception nestedException)

Implements com.sun.msv.reader.GrammarReaderController.error.

public void
error(String errorMessage, Exception nestedException)

public void
error(SAXParseException
The error information encapsulated in a SAX parse exception.
spe
)

Implements org.xml.sax.ErrorHandler.error.

Receive notification of a recoverable error.
public void
public void
public void
public void
fatalError(SAXParseException
The error information encapsulated in a SAXParseException.
spe
)

Implements org.xml.sax.ErrorHandler.fatalError.

Receive notification of a non-recoverable, fatal error.
public GrammarReaderController
protected Locator[]
public LSResourceResolver
public boolean
hadError()

Returns true if an error had been reported.

public InputSource
resolveEntity(String
The public identifier of the external entity being referenced, or null if none was supplied.
publicId
,
String
The system identifier of the external entity being referenced.
systemId
)

Implements org.xml.sax.EntityResolver.resolveEntity.

Deprecated
Allow the application to resolve external entities.
public final void
setErrorFlag()

Force set the error flag to true.

public void
public void
warning(SAXParseException
The warning information encapsulated in a SAX parse exception.
spe
)

Implements org.xml.sax.ErrorHandler.warning.

Receive notification of a warning.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_hadErrorback to summary
private boolean _hadError

This flag will be set to true in case of any error.

coreback to summary
private final GrammarReaderController core

Controller works as a wrapper to this object.

Constructor Detail

Controllerback to summary
public Controller(GrammarReaderController _core)

Method Detail

errorback to summary
public void error(Locator[] locs, String errorMessage, Exception nestedException)

Implements com.sun.msv.reader.GrammarReaderController.error.

errorback to summary
public void error(String errorMessage, Exception nestedException)
errorback to summary
public void error(SAXParseException spe)

Implements org.xml.sax.ErrorHandler.error.

Doc from org.xml.sax.ErrorHandler.error.

Receive notification of a recoverable error.

This corresponds to the definition of "error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a validating parser would use this callback to report the violation of a validity constraint. The default behaviour is to take no action.

The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end. If the application cannot do so, then the parser should report a fatal error even if the XML recommendation does not require it to do so.

Filters may use this method to report other, non-XML errors as well.

Parameters
spe:SAXParseException

The error information encapsulated in a SAX parse exception.

errorback to summary
public void error(IOException e, Locator source)
errorback to summary
public void error(SAXException e, Locator source)
errorback to summary
public void error(ParserConfigurationException e, Locator source)
fatalErrorback to summary
public void fatalError(SAXParseException spe)

Implements org.xml.sax.ErrorHandler.fatalError.

Doc from org.xml.sax.ErrorHandler.fatalError.

Receive notification of a non-recoverable, fatal error.

As defined in section 1.2 of the W3C XML 1.0 Recommendation, fatal errors are those that would make it impossible for a parser to continue normal processing. These include violation of a well-formedness constraint, invalid encoding, and forbidden structural errors as described in the W3C XML 1.0 Recommendation.

Parameters
spe:SAXParseException

The error information encapsulated in a SAXParseException.

getCoreback to summary
public GrammarReaderController getCore()
getLocatorback to summary
protected Locator[] getLocator(SAXParseException spe)
getLSResourceResolverback to summary
public LSResourceResolver getLSResourceResolver()

Implements com.sun.msv.reader.GrammarReaderController2.getLSResourceResolver.

Return the full resolver.

hadErrorback to summary
public boolean hadError()

Returns true if an error had been reported.

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

Implements org.xml.sax.EntityResolver.resolveEntity.

Doc from org.xml.sax.EntityResolver.resolveEntity.

Deprecated

Allow the application to resolve external entities.

The parser will call this method before opening any external entity except the top-level document entity. Such entities include the external DTD subset and external parameter entities referenced within the DTD (in either case, only if the parser reads external parameter entities), and external general entities referenced within the document element (if the parser reads external general entities). The application may request that the parser locate the entity itself, that it use an alternative URI, or that it use data provided by the application (as a character or byte input stream).

Application writers can use this method to redirect external system identifiers to secure and/or local URIs, to look up public identifiers in a catalogue, or to read an entity from a database or other input source (including, for example, a dialog box). Neither XML nor SAX specifies a preferred policy for using public or system IDs to resolve resources. However, SAX specifies how to interpret any InputSource returned by this method, and that if none is returned, then the system ID will be dereferenced as a URL.

If the system identifier is a URL, the SAX parser must resolve it fully before reporting it to the application.

Parameters
publicId:String

The public identifier of the external entity being referenced, or null if none was supplied.

systemId:String

The system identifier of the external entity being referenced.

Returns:InputSource

An InputSource object describing the new input source, or null to request that the parser open a regular URI connection to the system identifier.

Annotations
@Deprecated
Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
IOException:
A Java-specific IO exception, possibly the result of creating a new InputStream or Reader for the InputSource.
setErrorFlagback to summary
public final void setErrorFlag()

Force set the error flag to true.

warningback to summary
public void warning(Locator[] locs, String errorMessage)

Implements com.sun.msv.reader.GrammarReaderController.warning.

warningback to summary
public void warning(SAXParseException spe)

Implements org.xml.sax.ErrorHandler.warning.

Doc from org.xml.sax.ErrorHandler.warning.

Receive notification of a warning.

SAX parsers will use this method to report conditions that are not errors or fatal errors as defined by the XML recommendation. The default behaviour is to take no action.

The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end.

Filters may use this method to report other, non-XML warnings as well.

Parameters
spe:SAXParseException

The warning information encapsulated in a SAX parse exception.