Modifier and Type | Class and Description |
---|---|
public static class | XMLValidateTask.Attribute
The class to create to set a feature of the parser. |
public static class | XMLValidateTask.Property
A Parser property. |
protected class | XMLValidateTask.ValidatorErrorHandler
ValidatorErrorHandler role :
|
Modifier and Type | Field and Description |
---|---|
private Vector | attributeList
The vector to store all attributes (features) to be set on the parser. |
protected Path | |
protected XMLValidateTask. | |
protected boolean | |
protected File | file
file to be validated |
private static final FileUtils | FILE_UTILS
helper for path -> URI and URI -> path conversions. |
protected Vector | filesets
sets of file to be validated |
protected static final String | |
protected boolean | |
public static final String | MESSAGE_FILES_VALIDATED
Message for successful validation |
private final Vector | propertyList
List of properties. |
protected String | |
private AntClassLoader | |
protected boolean | |
private XMLCatalog | |
protected XMLReader | xmlReader
the parser is viewed as a SAX2 XMLReader. |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public void | addConfiguredXMLCatalog(XMLCatalog
XMLCatalog to use catalog)add an XMLCatalog as a nested element; optional. |
public void | |
protected void | |
public XMLValidateTask. | |
public Path | |
protected XMLReader | Returns: a new reader.Create a reader if the use of the class did not specify another one. |
private Object | Returns: reader or parserReturns a SAX-based XMLReader or a SAX-based Parser. |
public DTDLocation | |
public XMLValidateTask. | |
protected XMLReader | |
protected boolean | |
public void | |
protected EntityResolver | |
protected XMLReader | |
public void | init()
Overrides org. |
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 |
protected boolean | Returns: true when a SAX1 parser is in usetest that returns true if we are using a SAX1 parser. |
protected void | onSuccessfulValidation(int
number of files processed. fileProcessed)handler called on successful file validation. |
public void | setClassName(String
should be an implementation of SAX2
className)org.xml.sax.XMLReader or SAX2 org.xml.sax.Parser .
If className is an implementation of
If not set, the default will be used. Specify the class name of the SAX parser to be used. |
public void | setClasspath(Path
the classpath to load the parser classpath)Specify the classpath to be searched to load the parser (optional) |
public void | setClasspathRef(Reference
reference to a classpath defined elsewhere r)Where to find the parser class; optional. |
public void | setFailOnError(boolean
if set to fail)false do not fail on errorSpecify how parser error are to be handled. |
protected void | setFeature(String
the name of the feature to set feature, boolean the value of the feature value)Set a feature on the parser. |
public void | |
public void | setLenient(boolean
if set to bool)false only fail on malformed XMLSpecify whether the parser should be validating. |
protected void | |
public void | setWarn(boolean
if set to bool)false do not send warningsSpecify how parser error are to be handled. |
attributeList | back to summary |
---|---|
private Vector<XMLValidateTask. The vector to store all attributes (features) to be set on the parser. |
classpath | back to summary |
---|---|
protected Path classpath |
errorHandler | back to summary |
---|---|
protected XMLValidateTask. |
failOnError | back to summary |
---|---|
protected boolean failOnError |
file | back to summary |
---|---|
protected File file file to be validated |
FILE_UTILS | back to summary |
---|---|
private static final FileUtils FILE_UTILS helper for path -> URI and URI -> path conversions. |
filesets | back to summary |
---|---|
protected Vector<FileSet> filesets sets of file to be validated |
INIT_FAILED_MSG | back to summary |
---|---|
protected static final String INIT_FAILED_MSG |
lenient | back to summary |
---|---|
protected boolean lenient |
MESSAGE_FILES_VALIDATED | back to summary |
---|---|
public static final String MESSAGE_FILES_VALIDATED Message for successful validation |
propertyList | back to summary |
---|---|
private final Vector<XMLValidateTask. List of properties. |
readerClassName | back to summary |
---|---|
protected String readerClassName |
readerLoader | back to summary |
---|---|
private AntClassLoader readerLoader |
warn | back to summary |
---|---|
protected boolean warn |
xmlCatalog | back to summary |
---|---|
private XMLCatalog xmlCatalog |
xmlReader | back to summary |
---|---|
protected XMLReader xmlReader the parser is viewed as a SAX2 XMLReader. If a SAX1 parser is specified, it's wrapped in an adapter that make it behave as a XMLReader. a more 'standard' way of doing this would be to use the JAXP1.1 SAXParser interface. |
XMLValidateTask | back to summary |
---|---|
public XMLValidateTask() |
addConfiguredXMLCatalog | back to summary |
---|---|
public void addConfiguredXMLCatalog(XMLCatalog catalog) add an XMLCatalog as a nested element; optional.
|
addFileset | back to summary |
---|---|
public void addFileset(FileSet set) specify a set of file to be checked
|
cleanup | back to summary |
---|---|
protected void cleanup() Cleans up resources.
|
createAttribute | back to summary |
---|---|
public XMLValidateTask. Add an attribute nested element. This is used for setting arbitrary features of the SAX parser. Valid attributes include
|
createClasspath | back to summary |
---|---|
public Path createClasspath()
|
createDefaultReader | back to summary |
---|---|
protected XMLReader createDefaultReader() Create a reader if the use of the class did not specify another one. If a BuildException is thrown, the caller may revert to an alternate reader.
|
createDefaultReaderOrParser | back to summary |
---|---|
private Object createDefaultReaderOrParser() Returns a SAX-based XMLReader or a SAX-based Parser.
|
createDTD | back to summary |
---|---|
public DTDLocation createDTD() Create a DTD location record; optional. This stores the location of a DTD. The DTD is identified by its public Id.
|
createProperty | back to summary |
---|---|
public XMLValidateTask. Creates a property.
|
createXmlReader | back to summary |
---|---|
protected XMLReader createXmlReader() create the XML reader.
This is one by instantiating anything specified by
|
doValidate | back to summary |
---|---|
protected boolean doValidate(File afile) parse the file
|
execute | back to summary |
---|---|
public void execute() throws BuildException Overrides org. execute the task
|
getEntityResolver | back to summary |
---|---|
protected EntityResolver getEntityResolver() accessor to the xmlCatalog used in the task
|
getXmlReader | back to summary |
---|---|
protected XMLReader getXmlReader() get the XML reader. Non-null only after
|
init | back to summary |
---|---|
public void init() throws BuildException Overrides org. Called by the project to let the task initialize properly.
|
initValidator | back to summary |
---|---|
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
|
isSax1Parser | back to summary |
---|---|
protected boolean isSax1Parser() test that returns true if we are using a SAX1 parser.
|
onSuccessfulValidation | back to summary |
---|---|
protected void onSuccessfulValidation(int fileProcessed) handler called on successful file validation.
|
setClassName | back to summary |
---|---|
public void setClassName(String className) Specify the class name of the SAX parser to be used. (optional)
|
setClasspath | back to summary |
---|---|
public void setClasspath(Path classpath) Specify the classpath to be searched to load the parser (optional)
|
setClasspathRef | back to summary |
---|---|
public void setClasspathRef(Reference r) Where to find the parser class; optional.
|
setFailOnError | back to summary |
---|---|
public void setFailOnError(boolean fail) Specify how parser error are to be handled.
Optional, default is
If set to
|
setFeature | back to summary |
---|---|
protected void setFeature(String feature, boolean value) throws BuildException Set a feature on the parser.
|
setFile | back to summary |
---|---|
public void setFile(File file) specify the file to be checked; optional.
|
setLenient | back to summary |
---|---|
public void setLenient(boolean bool) Specify whether the parser should be validating. Default
is If set to false, the validation will fail only if the parsed document is not well formed XML.
this option is ignored if the specified class
with
|
setProperty | back to summary |
---|---|
protected void setProperty(String name, String value) throws BuildException Sets a property.
|
setWarn | back to summary |
---|---|
public void setWarn(boolean bool) Specify how parser error are to be handled.
If set to
|
Modifier and Type | Field and Description |
---|---|
private String | attributeName
The name of the attribute to set. |
private boolean | attributeValue
The value of the feature. |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public String | |
public boolean | |
public void | |
public void |
attributeName | back to summary |
---|---|
private String attributeName The name of the attribute to set. Valid attributes include |
attributeValue | back to summary |
---|---|
private boolean attributeValue The value of the feature. |
Attribute | back to summary |
---|---|
public Attribute() |
getName | back to summary |
---|---|
public String getName() Gets the attribute name.
|
getValue | back to summary |
---|---|
public boolean getValue() Gets the attribute value.
|
setName | back to summary |
---|---|
public void setName(String name) Set the feature name.
|
setValue | back to summary |
---|---|
public void setValue(boolean value) Set the feature value to true or false.
|
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public String | |
public String | |
public void | |
public void |
Property | back to summary |
---|---|
public Property() |
getName | back to summary |
---|---|
public String getName() accessor to the name of the property
|
getValue | back to summary |
---|---|
public String getValue() getter for the value of the property
|
setName | back to summary |
---|---|
public void setName(String name) setter for the name of the property
|
setValue | back to summary |
---|---|
public void setValue(String value) sets the value of the property
|
Modifier and Type | Field and Description |
---|---|
protected File | |
protected boolean | |
protected String |
Access | Constructor and Description |
---|---|
protected |
Modifier and Type | Method and Description |
---|---|
private void | |
public void | error(SAXParseException
the error exception)Implements org. |
public void | fatalError(SAXParseException
the fatal error exception)Implements org. |
public boolean | Returns: did an error happen during last parsing ?did an error happen during last parsing ? |
private String | |
public void | |
public void | warning(SAXParseException
the warning exception)Implements org. |
currentFile | back to summary |
---|---|
protected File currentFile |
failed | back to summary |
---|---|
protected boolean failed |
lastErrorMessage | back to summary |
---|---|
protected String lastErrorMessage |
ValidatorErrorHandler | back to summary |
---|---|
protected ValidatorErrorHandler() |
doLog | back to summary |
---|---|
private void doLog(SAXParseException e, int logLevel) |
error | back to summary |
---|---|
public void error(SAXParseException exception) Implements org. receive notification of a recoverable error
|
fatalError | back to summary |
---|---|
public void fatalError(SAXParseException exception) Implements org. record a fatal error
|
getFailure | back to summary |
---|---|
public boolean getFailure() did an error happen during last parsing ?
|
getMessage | back to summary |
---|---|
private String getMessage(SAXParseException e) |
init | back to summary |
---|---|
public void init(File file) initialises the class
|
warning | back to summary |
---|---|
public void warning(SAXParseException exception) Implements org. receive notification of a warning
|