org.apache.tools.ant.taskdefs.optional
Class SchemaValidate
- Cloneable
public class SchemaValidate
Validate XML Schema documents.
This task validates XML schema documents. It requires an XML parser
that handles the relevant SAx, Xerces or JAXP options.
To resolve remote referencies, Ant may need its proxy set up, using the
setproxy task.
Hands off most of the work to its parent,
XMLValidateTask
INIT_FAILED_MSG , MESSAGE_FILES_VALIDATED , classpath , errorHandler , failOnError , file , filesets , lenient , readerClassName , warn , xmlReader |
addConfiguredXMLCatalog , addFileset , createAttribute , createClasspath , createDTD , createDefaultReader , createProperty , createXmlReader , doValidate , execute , getEntityResolver , getXmlReader , init , initValidator , isSax1Parser , onSuccessfulValidation , setClassName , setClasspath , setClasspathRef , setFailOnError , setFeature , setFile , setLenient , setProperty , setWarn |
bindToOwner , execute , getOwningTarget , getRuntimeConfigurableWrapper , getTaskName , getTaskType , getWrapper , handleErrorFlush , handleErrorOutput , handleFlush , handleInput , handleOutput , init , isInvalid , log , log , log , log , maybeConfigure , perform , reconfigure , setOwningTarget , setRuntimeConfigurableWrapper , setTaskName , setTaskType |
ERROR_DUPLICATE_SCHEMA
public static final String ERROR_DUPLICATE_SCHEMA
Duplicate declaration of schema
ERROR_NO_XSD_SUPPORT
public static final String ERROR_NO_XSD_SUPPORT
schema features not supported
ERROR_PARSER_CREATION_FAILURE
public static final String ERROR_PARSER_CREATION_FAILURE
unable to create parser
ERROR_SAX_1
public static final String ERROR_SAX_1
SAX1 not supported
ERROR_TOO_MANY_DEFAULT_SCHEMAS
public static final String ERROR_TOO_MANY_DEFAULT_SCHEMAS
too many default schemas
MESSAGE_ADDING_SCHEMA
public static final String MESSAGE_ADDING_SCHEMA
adding schema
addSchemaLocations
protected void addSchemaLocations()
build a string list of all schema locations, then set the relevant
property.
createAnonymousSchema
protected void createAnonymousSchema()
create a schema location to hold the anonymous
schema
createDefaultReader
protected XMLReader createDefaultReader()
Create a reader if the use of the class did not specify another one.
The reason to not use JAXPUtils.getXMLReader()
was to
create our own factory with our own options.
- createDefaultReader in interface XMLValidateTask
enableJAXP12SchemaValidation
public boolean enableJAXP12SchemaValidation()
Set schema attributes in a JAXP 1.2 engine.
- true on success, false on failure
enableXercesSchemaValidation
public boolean enableXercesSchemaValidation()
Turn on XSD support in Xerces.
- true on success, false on failure
getNoNamespaceSchemaURL
protected String getNoNamespaceSchemaURL()
get the URL of the no namespace schema
init
public void init()
throws BuildException
Called by the project to let the task initialize properly. The default
implementation is a no-op.
- init in interface XMLValidateTask
initValidator
protected void initValidator()
init the parser : load the parser class, and set features if necessary It
is only after this that the reader is valid
- initValidator in interface XMLValidateTask
onSuccessfulValidation
protected void onSuccessfulValidation(int fileProcessed)
handler called on successful file validation.
- onSuccessfulValidation in interface XMLValidateTask
fileProcessed
- number of files processed.
setDisableDTD
public void setDisableDTD(boolean disableDTD)
flag to disable DTD support.
disableDTD
- a boolean
value.
setFeatureIfSupported
protected void setFeatureIfSupported(String feature,
boolean value)
set a feature if it is supported, log at verbose level if
not
feature
- the feature.value
- a boolean
value.
setFullChecking
public void setFullChecking(boolean fullChecking)
enable full schema checking. Slower but better.
fullChecking
- a boolean
value.
setNoNamespaceFile
public void setNoNamespaceFile(File defaultSchemaFile)
identify a file containing the default schema
defaultSchemaFile
- the location of the default schema.
setNoNamespaceURL
public void setNoNamespaceURL(String defaultSchemaURL)
identify the URL of the default schema
defaultSchemaURL
- the URL of the default schema.