Top Description Inners Fields Constructors Methods
com.sun.msv.verifier.jarv

public abstract Class FactoryImpl

extends VerifierFactory
Class Inheritance
Known Direct Subclasses
com.sun.msv.verifier.jarv.RELAXCoreFactoryImpl, com.sun.msv.verifier.jarv.RELAXNGFactoryImpl, com.sun.msv.verifier.jarv.TheFactoryImpl, com.sun.msv.verifier.jarv.TREXFactoryImpl, com.sun.msv.verifier.jarv.XSFactoryImpl, com.sun.msv.verifier.jarv.DTDFactoryImpl
Imports
java.io.IOException, javax.xml.parsers.SAXParserFactory, org.iso_relax.verifier.Schema, .VerifierConfigurationException, .VerifierFactory, org.xml.sax.EntityResolver, .InputSource, .Locator, .SAXException, .SAXNotRecognizedException, .SAXNotSupportedException, .SAXParseException, com.sun.msv.grammar.Grammar, com.sun.msv.grammar.xmlschema.XMLSchemaGrammar, com.sun.msv.reader.GrammarReaderController, com.sun.msv.verifier.IVerifier, com.sun.msv.verifier.identity.IDConstraintChecker, com.sun.msv.verifier.regexp.REDocumentDeclaration, com.sun.msv.verifier.util.ErrorHandlerImpl

base implementation of RELAXFactoryImpl and TREXFactoryImpl
Author
Kohsuke KAWAGUCHI

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private static class
FactoryImpl.WrapperException

wrapper exception so that we can throw it from the GrammarReaderController.

Field Summary

Modifier and TypeField and Description
protected final SAXParserFactory
private EntityResolver
resolver

Hides org.iso_relax.verifier.VerifierFactory.resolver.

To be used to resolve files included/imported by the schema.
private boolean

Constructor Summary

AccessConstructor and Description
protected
protected

Method Summary

Modifier and TypeMethod and Description
public Schema
compileSchema(InputSource source)

Implements abstract org.iso_relax.verifier.VerifierFactory.compileSchema.

processes a schema into a Schema object, which is a compiled representation of a schema.
pack-priv static IVerifier
createVerifier(Grammar g)

gets the VGM by sniffing its type.

public EntityResolver
getEntityResolver()

Overrides org.iso_relax.verifier.VerifierFactory.getEntityResolver.

Gets the current entity resolver, which was set by the SetEntityResolver method.
public boolean
isFeature(String
feature name
feature
)

Overrides org.iso_relax.verifier.VerifierFactory.isFeature.

Indicates whether if the feature is supported, or not.
protected abstract Grammar
parse(InputSource source, GrammarReaderController controller)

parses a Grammar from the specified source.

public void
setEntityResolver(EntityResolver _resolver)

Overrides org.iso_relax.verifier.VerifierFactory.setEntityResolver.

Sets an EntityResolver This entity resolver is used to resolve entities encountered while parsing a schema.
public void
setFeature(String
feature name
feature
,
boolean
feature value
v
)

Overrides org.iso_relax.verifier.VerifierFactory.setFeature.

Sets feature value
Inherited from org.iso_relax.verifier.VerifierFactory:
compileSchemacompileSchemacompileSchemacompileSchemagetPropertynewInstancenewInstancenewInstancenewVerifiernewVerifiernewVerifiernewVerifiernewVerifiersetProperty

Field Detail

factoryback to summary
protected final SAXParserFactory factory
resolverback to summary
private EntityResolver resolver

Hides org.iso_relax.verifier.VerifierFactory.resolver.

To be used to resolve files included/imported by the schema. Can be null.

usePanicModeback to summary
private boolean usePanicMode

Constructor Detail

FactoryImplback to summary
protected FactoryImpl(SAXParserFactory factory)
FactoryImplback to summary
protected FactoryImpl()

Method Detail

compileSchemaback to summary
public Schema compileSchema(InputSource source) throws VerifierConfigurationException, SAXException

Implements abstract org.iso_relax.verifier.VerifierFactory.compileSchema.

Doc from org.iso_relax.verifier.VerifierFactory.compileSchema.

processes a schema into a Schema object, which is a compiled representation of a schema. The obtained schema object can then be used concurrently across multiple threads.

createVerifierback to summary
pack-priv static IVerifier createVerifier(Grammar g)

gets the VGM by sniffing its type.

To validate XML Schema correctly, we need to use the specialized VGM.

getEntityResolverback to summary
public EntityResolver getEntityResolver()

Overrides org.iso_relax.verifier.VerifierFactory.getEntityResolver.

Doc from org.iso_relax.verifier.VerifierFactory.getEntityResolver.

Gets the current entity resolver, which was set by the SetEntityResolver method.

isFeatureback to summary
public boolean isFeature(String feature) throws SAXNotRecognizedException, SAXNotSupportedException

Overrides org.iso_relax.verifier.VerifierFactory.isFeature.

Doc from org.iso_relax.verifier.VerifierFactory.isFeature.

Indicates whether if the feature is supported, or not.

Parameters
feature:String

feature name

parseback to summary
protected abstract Grammar parse(InputSource source, GrammarReaderController controller) throws SAXException, VerifierConfigurationException

parses a Grammar from the specified source. return null if an error happens.

setEntityResolverback to summary
public void setEntityResolver(EntityResolver _resolver)

Overrides org.iso_relax.verifier.VerifierFactory.setEntityResolver.

Doc from org.iso_relax.verifier.VerifierFactory.setEntityResolver.

Sets an EntityResolver This entity resolver is used to resolve entities encountered while parsing a schema.

setFeatureback to summary
public void setFeature(String feature, boolean v) throws SAXNotRecognizedException, SAXNotSupportedException

Overrides org.iso_relax.verifier.VerifierFactory.setFeature.

Doc from org.iso_relax.verifier.VerifierFactory.setFeature.

Sets feature value

Parameters
feature:String

feature name

v:boolean

feature value

com.sun.msv.verifier.jarv back to summary

private Class FactoryImpl.ThrowController

extends Object
implements GrammarReaderController
Class Inheritance
All Implemented Interfaces
com.sun.msv.reader.GrammarReaderController, org.xml.sax.EntityResolver

Constructor Summary

AccessConstructor and Description
private

Method Summary

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

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

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

Implements org.xml.sax.EntityResolver.resolveEntity.

Allow the application to resolve external entities.
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ThrowControllerback to summary
private ThrowController()

Method Detail

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

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

resolveEntityback to summary
public InputSource resolveEntity(String p, String s) throws SAXException, IOException

Implements org.xml.sax.EntityResolver.resolveEntity.

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

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
p:String

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

s: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.

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.
warningback to summary
public void warning(Locator[] locs, String errorMessage)

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

com.sun.msv.verifier.jarv back to summary

private Class FactoryImpl.WrapperException

extends RuntimeException
Class Inheritance
Annotations
@SuppressWarnings:serial

wrapper exception so that we can throw it from the GrammarReaderController.

Field Summary

Modifier and TypeField and Description
public final SAXException
e

Constructor Summary

AccessConstructor and Description
pack-priv

Field Detail

eback to summary
public final SAXException e

Constructor Detail

WrapperExceptionback to summary
pack-priv WrapperException(SAXException e)