Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "COSMOS SDD Tooling Validator Design"

(API)
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
= Overview =
 
= Overview =
 +
The SDD Validator is an Eclipse plug-in that provides functionality for validating XML against various types of rule sets. Currently supported types of rules are XML Schema rules, Schematron rules and custom user created rules written in Java. The Validator also provides the ability to read XML into SDOs, and write the SDOs back out to XML. While intended primarily for working with SDDs, the Validator is flexible enough to handle any arbitrary XML.
  
The SDD Validator is an Eclipse plug-in that provides functionality for validating XML against various types of rule sets. Currently supported types of rules are XML Schema rules, Schematron rules and custom user created rules written in Java. The Validator also provides the ability to read XML into SDO's, and write the SDO's back out to XML. While intended primarily for working with SDD's, the Validator is flexible enough to handle any arbitrary XML.
+
There are two methods available for using the Validator. First, an Eclipse based application may require the Validator as plug-in dependency and use the provided APIs. Second, the Validator includes the ability to run as an Eclipse Rich Client Platform (RCP) application with a command line interface.
 
+
There are two methods available for using the Validator. First, an Eclipse based application may required the Validator as plug-in dependency and use the provided API's. Second, the Validator includes the ability to run as an Eclipse Rich Client Platform (RCP) application with a command line interface.
+
  
 
= Rules =
 
= Rules =
 
 
All rules must implement the <tt>ValidationRule</tt> interface, which contains a single method: <tt>validate()</tt>. A rule may perform any kind of validation action desired, provided it takes an <tt>InputStream</tt> as input and returns an array of <tt>XMLValidationError</tt>. Below are the pre-written rule types included with the Validator.
 
All rules must implement the <tt>ValidationRule</tt> interface, which contains a single method: <tt>validate()</tt>. A rule may perform any kind of validation action desired, provided it takes an <tt>InputStream</tt> as input and returns an array of <tt>XMLValidationError</tt>. Below are the pre-written rule types included with the Validator.
  
== XML Schema Rules ==
+
=== XML Schema Rules ===
 
+
 
<tt>SchemaValidationRule</tt> provides functionality for validating against one or more XML Schemas. A <tt>SchemaValidationRule</tt> is constructed with an array of either <tt>Files</tt> or <tt>InputStreams</tt> containing the schemas against which the XML will be validated. Schemas may be added to or removed from the rule at any time. It is also possible to get a list of all schema <tt>Files</tt> or <tt>InputStreams</tt> associated with an instance of <tt>SchemaValidationRule</tt>.
 
<tt>SchemaValidationRule</tt> provides functionality for validating against one or more XML Schemas. A <tt>SchemaValidationRule</tt> is constructed with an array of either <tt>Files</tt> or <tt>InputStreams</tt> containing the schemas against which the XML will be validated. Schemas may be added to or removed from the rule at any time. It is also possible to get a list of all schema <tt>Files</tt> or <tt>InputStreams</tt> associated with an instance of <tt>SchemaValidationRule</tt>.
  
 
<tt>SchemaValidationRule</tt> performs validation using the [http://jaxp.dev.java.net/ Java API for XML Processing (JAXP)], which allows the validation to be independent of the underlying XML parser and thus run the same on different JRE versions and implementations.
 
<tt>SchemaValidationRule</tt> performs validation using the [http://jaxp.dev.java.net/ Java API for XML Processing (JAXP)], which allows the validation to be independent of the underlying XML parser and thus run the same on different JRE versions and implementations.
  
== Schematron Rules ==
+
=== Schematron Rules ===
 +
<tt>SchematronValidationRule</tt> provides functionality for validating against an [http://www.schematron.com/ ISO Schematron] rules file. A <tt>SchematronValidationRule</tt> is constructed with a Schematron rules file and a Schematron skeleton file. The provided implementation is tied to the [http://www.schematron.com/validators.html Schematron Text] validator, which extends the base ISO Schematron skeleton file. Users would need to create a Custom Rule if another type of Schematron error reporting is desired.
  
<tt>SchematronValidationRule</tt> provides functionality for validating against an [http://www.schematron.com/ ISO Schematron] rules file. A <tt>SchematronValidationRule</tt> is constructed with a Schematron rules file and a Schematron skeleton file. The provided implementation uses the Schematron Text validator (available on the [http://www.schematron.com/validators.html Schematron Validators] page), but it can be extended to use other types of Schematron validators.
+
Briefly, a Schematron skeleton is an XSL Transform that can be thought of as a compiler for rules files. The result of transforming the rules file with the skeleton is another XSL Transform, which can then be applied against an XML file to generate an error report. <tt>SchematronValidationRule</tt> takes care of compiling the rules file and parsing the generated error report.
  
Briefly, a Schematron skeleton is an XSL Transform that can be thought of as a compiler for rules files. The result of transforming the rules file with the skeleton is another XSL Transform, which can then be applied against an XML file to generate an error report. <tt>SchematronValidationRule</tt> takes care of compiling the rules file are parsing the generated error report.
+
=== SDD Specific Rules ===
 +
'''More info goes here about rules required to ensure compliance with SDD spec, above what the Schema requires.'''
  
== SDD Specific Rules ==
+
=== Custom Java Rules ===
 +
Users can create their own rules to perform other types of validation beyond what the included rule types provide. There is no restriction on what custom rules can do, other than that they must implement the <tt>ValidationRule</tt> interface.
  
More info goes here about rules required to ensure compliance with SDD spec, above what the Schema requires.
+
= Interfaces =
 +
== API ==
 +
The Validator API provides two different levels of functionality:
 +
# A low level API for reading, writing and validating generic XML or a single Package or Deployment Descriptor. This capability is available through the <tt>XML_DAS</tt> and <tt>SDD_DAS</tt> interfaces.
 +
# A high level API for handling entire SDDs, meaning one or more Package Descriptors and one or more Deployment Descriptors. This capability is provided by the <tt>SDDManager</tt> interface.
 +
A more detailed description of each interface is provided below.
  
== Custom Java Rules ==
+
=== XML_DAS ===
 +
<code><pre>DataGraph loadDataGraph(InputStream inputStream, String[] schemaFiles)</pre></code>
 +
Creates an SDO <tt>DataGraph</tt> representing the XML in the given <tt>InputStream</tt>. Since some basic validation occurs during loading of the XML, a list of Schema files referenced by the XML is required. An <tt>XMLValidationException</tt> may be thrown, but lack of an exception does not necessarily mean the XML is valid.
 +
<code><pre>void saveDataGraph(DataGraph dataGraph, OutputStream outputStream, String rootElementName, String rootElementURI,
 +
String encoding)</pre></code>
 +
Converts the <tt>DataGraph</tt> to XML and writes it to the given <tt>OutputStream</tt>. Requires the desired Root Element Name and URI to be specified since that information is not stored in the <tt>DataGraph</tt>. Optionally, a character encoding can be specified, or null results in the default encoding. This method validates the XML before writing it out.
 +
<code><pre>void saveDataGraph(DataGraph dataGraph, OutputStream outputStream, String rootElementName, String rootElementURI,
 +
String encoding, boolean performValidation)</pre></code>
 +
Converts the <tt>DataGraph</tt> to XML and writes it to the given <tt>OutputStream</tt>. Requires the desired Root Element Name and URI to be specified since that information is not stored in the <tt>DataGraph</tt>. Optionally, a character encoding can be specified, or null results in the default encoding. This method allows a choice of whether the XML is validated before being written out.
 +
<code><pre>XMLValidationError[] validate(DataGraph dataGraph, String rootElementName, String rootElementURI)</pre></code>
 +
Validates the given <tt>DataGraph</tt> by running all the <tt>ValidationRules</tt> associated with the <tt>XML_DAS</tt>. Since the <tt>DataGraph</tt> will be converted to XML before validation, the Root Element Name and URI are required. Returns a list of validation errors found, or an empty list if the XML is valid.
 +
<code><pre>void addValidation(ValidationRule validationRule)</pre></code>
 +
Adds a <tt>ValidationRule</tt> to the list of rules associated with the <tt>XML_DAS</tt>.
 +
<code><pre>void removeValidation(ValidationRule validationRule)</pre></code>
 +
Removes a <tt>ValidationRule</tt> from the list of rules associated with the <tt>XML_DAS</tt>.
 +
<code><pre>ValidationRule[] getValidationRules()</pre></code>
 +
Returns a list of all <tt>ValidationRules</tt> associated with an <tt>XML_DAS</tt>.
 +
 
 +
=== SDD_DAS ===
 +
<code><pre>DataGraph loadDataGraph(InputStream inputStream)</pre></code>
 +
Creates an SDO <tt>DataGraph</tt> representing the XML in the given <tt>InputStream</tt>. The SDD Schema files are used for the basic validation that occurs during loading of the XML. An <tt>XMLValidationException</tt> may be thrown, but lack of an exception does not necessarily mean the XML is valid.
 +
<code><pre>void saveDataGraph(DataGraph dataGraph, OutputStream outputStream, String encoding)</pre></code>
 +
Converts the <tt>DataGraph</tt> to XML and writes it to the given <tt>OutputStream</tt>. The appropriate Root Element Name and URI are used depending on whether the <tt>DataGraph</tt> is a Package Descriptor or Deployment Descriptor. Optionally, a character encoding can be specified, or null results in the default encoding. This method validates the XML before writing it out.
 +
<code><pre>void saveDataGraph(DataGraph dataGraph, OutputStream outputStream, String encoding, boolean performValidation)</pre></code>
 +
Converts the <tt>DataGraph</tt> to XML and writes it to the given <tt>OutputStream</tt>. The appropriate Root Element Name and URI are used depending on whether the <tt>DataGraph</tt> is a Package Descriptor or Deployment Descriptor. Optionally, a character encoding can be specified, or null results in the default encoding. This method allows a choice of whether the XML is validated before being written out.
 +
<code><pre>XMLValidationError[] validate(DataGraph dataGraph)</pre></code>
 +
Validates the given <tt>DataGraph</tt> by running all the <tt>ValidationRules</tt> associated with the <tt>SDD_DAS</tt>. Returns a list of validation errors found, or an empty list if the XML is valid.
 +
<code><pre>void addValidation(ValidationRule validationRule)</pre></code>
 +
Adds a <tt>ValidationRule</tt> to the list of rules associated with the <tt>SDD_DAS</tt>.
 +
<code><pre>void removeValidation(ValidationRule validationRule)</pre></code>
 +
Removes a <tt>ValidationRule</tt> from the list of rules associated with the <tt>SDD_DAS</tt>.
 +
<code><pre>ValidationRule[] getValidationRules()</pre></code>
 +
Returns a list of all <tt>ValidationRules</tt> associated with an <tt>SDD_DAS</tt>.
 +
 
 +
=== SDDManager ===
 +
<code><pre>void addDescriptorFromDataGraph(DataGraph descriptorGraph, File descriptorFile)</pre></code>
 +
Adds a <tt>DataGraph</tt> to the list of descriptors maintained by the <tt>SDDManager</tt>. Any validation rules which are already associated with the <tt>SDDManager</tt> will be applied to the new descriptor, in addition to all additional rules added after the descriptor is added. The <tt>File</tt> argument is the file the descriptor will be written to when one of the <tt>writeDescriptors()</tt> or <tt>writeAllDescriptors()</tt> methods is called.
 +
<code><pre>DataGraph addDescriptorFromFile(File descriptorFile)</pre></code>
 +
Loads XML from the given <tt>File</tt> into a <tt>DataGraph</tt> and adds it to the descriptor list maintained by the <tt>SDDManager</tt>. Any validation rules which are already associated with the <tt>SDDManager</tt> will be applied to the new descriptor, in addition to all additional rules added after the descriptor is added. When any of the <tt>writeDescriptors</tt> or <tt>writeAllDescriptors</tt> methods is called, the descriptor will be written back to the file from which it was loaded.
 +
<code><pre>void removeDescriptor(DataGraph descriptorGraph)</pre></code>
 +
Removes the given <tt>DataGraph</tt> from the list of descriptors maintained by the <tt>SDDManager</tt>.
 +
<code><pre>void writeAllDescriptors()</pre></code>
 +
Writes all the descriptors in the <tt>SDDManager's</tt> descriptor list out to their associated XML files. This method performs validation on each descriptor before writing it to the output file.
 +
<code><pre>void writeAllDescriptors(boolean performValidation)</pre></code>
 +
Writes all the descriptors in the <tt>SDDManager's</tt> descriptor list out to their associated XML files. This method allows a choice of whether the descriptors are validated before being written.
 +
<code><pre>void writeDescriptors(DataGraph [] descriptorGraphs)</pre></code>
 +
Writes the given descriptors out to their associated XML files. If any <tt>DataGraphs</tt> are in the list provided but not in the list maintained by the <tt>SDDManager</tt>, then they are ignored silently. This method performs validation on each descriptor before writing it to the output file.
 +
<code><pre>void writeDescriptors(DataGraph [] descriptorGraphs, boolean performValidation)</pre></code>
 +
Writes the given descriptors out to their associated XML files. If any <tt>DataGraphs</tt> are in the list provided but not in the list maintained by the <tt>SDDManager</tt>, then they are ignored silently. This method allows a choice of whether the descriptors are validated before being written.
 +
<code><pre>XMLValidationError[] validateAllDescriptors()</pre></code>
 +
Validates all descriptors associated with the <tt>SDDManager</tt>, and returns a list of <tt>XMLValidationErrors</tt>. Validation means running each of the <tt>ValidationRules</tt> in the <tt>SDDManager's</tt> list against all descriptors of the appropriate type (either Package or Deployment).
 +
<code><pre>XMLValidationError[] validateDescriptors(DataGraph [] descriptorGraphs)</pre></code>
 +
Validates the given descriptors and returns a list of <tt>XMLValidationErrors</tt>. If any <tt>DataGraphs</tt> are in the list provided but not in the list maintained by the <tt>SDDManager</tt>, then they are ignored silently. Validation means running each of the <tt>ValidationRules</tt> in the <tt>SDDManager's</tt> list against all descriptors of the appropriate type (either Package or Deployment).
 +
<code><pre>void addValidation(ValidationRule validationRule, int descriptorType)</pre></code>
 +
Adds a <tt>ValidationRule</tt> to the list maintained by the <tt>SDDManager</tt>. Rules can be associated with one of the descriptor types, either PACKAGE_DESCRIPTOR or DEPLOYMENT_DESCRIPTOR.
 +
<code><pre>void removeValidation(ValidationRule validationRule, int descriptorType)</pre></code>
 +
Removes a <tt>ValidationRule</tt> from the list maintained by the <tt>SDDManager</tt>. The descriptor type must be specified to tell the <tt>SDDManager</tt> wheter to remove the rule from the DEPLOYMENT_DESCRIPTOR list or the PACKAGE_DESCRIPTOR list.
 +
<code><pre>DataGraph [] getPackageDescriptorGraphs()</pre></code>
 +
Returns a list of all Package Descriptor <tt>DataGraphs</tt> associated with the <tt>SDDManager</tt>.
 +
<code><pre>DataGraph [] getDeploymentDescriptorGraphs()</pre></code>
 +
Returns a list of all Deployment Descriptor <tt>DataGraphs</tt> associated with the <tt>SDDManager</tt>.
 +
<code><pre>DataGraph [] getAllDescriptorGraphs()</pre></code>
 +
Returns a list of all <tt>DataGraphs</tt> (both Deployment Descriptors and Package Descriptors) associated with the <tt>SDDManager</tt>.
 +
<code><pre>ValidationRule [] getPackageDescriptorRules()</pre></code>
 +
Returns the <tt>SDDManager's</tt> list of <tt>ValidationRules</tt> which are targeted to Package Descriptors.
 +
<code><pre>ValidationRule [] getDeploymentDescriptorRules()</pre></code>
 +
Returns the <tt>SDDManager's</tt> list of <tt>ValidationRules</tt> which are targeted to Deployment Descriptors.
 +
<code><pre>ValidationRule [] getAllValidationRules()</pre></code>
 +
Returns the <tt>SDDManager's</tt> list of <tt>ValidationRules</tt>, for both Package and Deployment Descriptors.
 +
<code><pre>void setEncoding(String encoding)</pre></code>
 +
Sets the encoding to use when writing descriptors out to XML. A null value will cause the default encoding to be used, as will writing out descriptors before calling this method.
  
= Interfaces =
 
== API's ==
 
 
== Command Line ==
 
== Command Line ==
  
More info about command line interface goes here.
+
'''More info about command line interface goes here.'''
  
 
[[Category:SDD Tooling]]
 
[[Category:SDD Tooling]]

Latest revision as of 11:33, 29 April 2008

Overview

The SDD Validator is an Eclipse plug-in that provides functionality for validating XML against various types of rule sets. Currently supported types of rules are XML Schema rules, Schematron rules and custom user created rules written in Java. The Validator also provides the ability to read XML into SDOs, and write the SDOs back out to XML. While intended primarily for working with SDDs, the Validator is flexible enough to handle any arbitrary XML.

There are two methods available for using the Validator. First, an Eclipse based application may require the Validator as plug-in dependency and use the provided APIs. Second, the Validator includes the ability to run as an Eclipse Rich Client Platform (RCP) application with a command line interface.

Rules

All rules must implement the ValidationRule interface, which contains a single method: validate(). A rule may perform any kind of validation action desired, provided it takes an InputStream as input and returns an array of XMLValidationError. Below are the pre-written rule types included with the Validator.

XML Schema Rules

SchemaValidationRule provides functionality for validating against one or more XML Schemas. A SchemaValidationRule is constructed with an array of either Files or InputStreams containing the schemas against which the XML will be validated. Schemas may be added to or removed from the rule at any time. It is also possible to get a list of all schema Files or InputStreams associated with an instance of SchemaValidationRule.

SchemaValidationRule performs validation using the Java API for XML Processing (JAXP), which allows the validation to be independent of the underlying XML parser and thus run the same on different JRE versions and implementations.

Schematron Rules

SchematronValidationRule provides functionality for validating against an ISO Schematron rules file. A SchematronValidationRule is constructed with a Schematron rules file and a Schematron skeleton file. The provided implementation is tied to the Schematron Text validator, which extends the base ISO Schematron skeleton file. Users would need to create a Custom Rule if another type of Schematron error reporting is desired.

Briefly, a Schematron skeleton is an XSL Transform that can be thought of as a compiler for rules files. The result of transforming the rules file with the skeleton is another XSL Transform, which can then be applied against an XML file to generate an error report. SchematronValidationRule takes care of compiling the rules file and parsing the generated error report.

SDD Specific Rules

More info goes here about rules required to ensure compliance with SDD spec, above what the Schema requires.

Custom Java Rules

Users can create their own rules to perform other types of validation beyond what the included rule types provide. There is no restriction on what custom rules can do, other than that they must implement the ValidationRule interface.

Interfaces

API

The Validator API provides two different levels of functionality:

  1. A low level API for reading, writing and validating generic XML or a single Package or Deployment Descriptor. This capability is available through the XML_DAS and SDD_DAS interfaces.
  2. A high level API for handling entire SDDs, meaning one or more Package Descriptors and one or more Deployment Descriptors. This capability is provided by the SDDManager interface.

A more detailed description of each interface is provided below.

XML_DAS

DataGraph loadDataGraph(InputStream inputStream, String[] schemaFiles)

Creates an SDO DataGraph representing the XML in the given InputStream. Since some basic validation occurs during loading of the XML, a list of Schema files referenced by the XML is required. An XMLValidationException may be thrown, but lack of an exception does not necessarily mean the XML is valid.

void saveDataGraph(DataGraph dataGraph, OutputStream outputStream, String rootElementName, String rootElementURI,
String encoding)

Converts the DataGraph to XML and writes it to the given OutputStream. Requires the desired Root Element Name and URI to be specified since that information is not stored in the DataGraph. Optionally, a character encoding can be specified, or null results in the default encoding. This method validates the XML before writing it out.

void saveDataGraph(DataGraph dataGraph, OutputStream outputStream, String rootElementName, String rootElementURI,
String encoding, boolean performValidation)

Converts the DataGraph to XML and writes it to the given OutputStream. Requires the desired Root Element Name and URI to be specified since that information is not stored in the DataGraph. Optionally, a character encoding can be specified, or null results in the default encoding. This method allows a choice of whether the XML is validated before being written out.

XMLValidationError[] validate(DataGraph dataGraph, String rootElementName, String rootElementURI)

Validates the given DataGraph by running all the ValidationRules associated with the XML_DAS. Since the DataGraph will be converted to XML before validation, the Root Element Name and URI are required. Returns a list of validation errors found, or an empty list if the XML is valid.

void addValidation(ValidationRule validationRule)

Adds a ValidationRule to the list of rules associated with the XML_DAS.

void removeValidation(ValidationRule validationRule)

Removes a ValidationRule from the list of rules associated with the XML_DAS.

ValidationRule[] getValidationRules()

Returns a list of all ValidationRules associated with an XML_DAS.

SDD_DAS

DataGraph loadDataGraph(InputStream inputStream)

Creates an SDO DataGraph representing the XML in the given InputStream. The SDD Schema files are used for the basic validation that occurs during loading of the XML. An XMLValidationException may be thrown, but lack of an exception does not necessarily mean the XML is valid.

void saveDataGraph(DataGraph dataGraph, OutputStream outputStream, String encoding)

Converts the DataGraph to XML and writes it to the given OutputStream. The appropriate Root Element Name and URI are used depending on whether the DataGraph is a Package Descriptor or Deployment Descriptor. Optionally, a character encoding can be specified, or null results in the default encoding. This method validates the XML before writing it out.

void saveDataGraph(DataGraph dataGraph, OutputStream outputStream, String encoding, boolean performValidation)

Converts the DataGraph to XML and writes it to the given OutputStream. The appropriate Root Element Name and URI are used depending on whether the DataGraph is a Package Descriptor or Deployment Descriptor. Optionally, a character encoding can be specified, or null results in the default encoding. This method allows a choice of whether the XML is validated before being written out.

XMLValidationError[] validate(DataGraph dataGraph)

Validates the given DataGraph by running all the ValidationRules associated with the SDD_DAS. Returns a list of validation errors found, or an empty list if the XML is valid.

void addValidation(ValidationRule validationRule)

Adds a ValidationRule to the list of rules associated with the SDD_DAS.

void removeValidation(ValidationRule validationRule)

Removes a ValidationRule from the list of rules associated with the SDD_DAS.

ValidationRule[] getValidationRules()

Returns a list of all ValidationRules associated with an SDD_DAS.

SDDManager

void addDescriptorFromDataGraph(DataGraph descriptorGraph, File descriptorFile)

Adds a DataGraph to the list of descriptors maintained by the SDDManager. Any validation rules which are already associated with the SDDManager will be applied to the new descriptor, in addition to all additional rules added after the descriptor is added. The File argument is the file the descriptor will be written to when one of the writeDescriptors() or writeAllDescriptors() methods is called.

DataGraph addDescriptorFromFile(File descriptorFile)

Loads XML from the given File into a DataGraph and adds it to the descriptor list maintained by the SDDManager. Any validation rules which are already associated with the SDDManager will be applied to the new descriptor, in addition to all additional rules added after the descriptor is added. When any of the writeDescriptors or writeAllDescriptors methods is called, the descriptor will be written back to the file from which it was loaded.

void removeDescriptor(DataGraph descriptorGraph)

Removes the given DataGraph from the list of descriptors maintained by the SDDManager.

void writeAllDescriptors()

Writes all the descriptors in the SDDManager's descriptor list out to their associated XML files. This method performs validation on each descriptor before writing it to the output file.

void writeAllDescriptors(boolean performValidation)

Writes all the descriptors in the SDDManager's descriptor list out to their associated XML files. This method allows a choice of whether the descriptors are validated before being written.

void writeDescriptors(DataGraph [] descriptorGraphs)

Writes the given descriptors out to their associated XML files. If any DataGraphs are in the list provided but not in the list maintained by the SDDManager, then they are ignored silently. This method performs validation on each descriptor before writing it to the output file.

void writeDescriptors(DataGraph [] descriptorGraphs, boolean performValidation)

Writes the given descriptors out to their associated XML files. If any DataGraphs are in the list provided but not in the list maintained by the SDDManager, then they are ignored silently. This method allows a choice of whether the descriptors are validated before being written.

XMLValidationError[] validateAllDescriptors()

Validates all descriptors associated with the SDDManager, and returns a list of XMLValidationErrors. Validation means running each of the ValidationRules in the SDDManager's list against all descriptors of the appropriate type (either Package or Deployment).

XMLValidationError[] validateDescriptors(DataGraph [] descriptorGraphs)

Validates the given descriptors and returns a list of XMLValidationErrors. If any DataGraphs are in the list provided but not in the list maintained by the SDDManager, then they are ignored silently. Validation means running each of the ValidationRules in the SDDManager's list against all descriptors of the appropriate type (either Package or Deployment).

void addValidation(ValidationRule validationRule, int descriptorType)

Adds a ValidationRule to the list maintained by the SDDManager. Rules can be associated with one of the descriptor types, either PACKAGE_DESCRIPTOR or DEPLOYMENT_DESCRIPTOR.

void removeValidation(ValidationRule validationRule, int descriptorType)

Removes a ValidationRule from the list maintained by the SDDManager. The descriptor type must be specified to tell the SDDManager wheter to remove the rule from the DEPLOYMENT_DESCRIPTOR list or the PACKAGE_DESCRIPTOR list.

DataGraph [] getPackageDescriptorGraphs()

Returns a list of all Package Descriptor DataGraphs associated with the SDDManager.

DataGraph [] getDeploymentDescriptorGraphs()

Returns a list of all Deployment Descriptor DataGraphs associated with the SDDManager.

DataGraph [] getAllDescriptorGraphs()

Returns a list of all DataGraphs (both Deployment Descriptors and Package Descriptors) associated with the SDDManager.

ValidationRule [] getPackageDescriptorRules()

Returns the SDDManager's list of ValidationRules which are targeted to Package Descriptors.

ValidationRule [] getDeploymentDescriptorRules()

Returns the SDDManager's list of ValidationRules which are targeted to Deployment Descriptors.

ValidationRule [] getAllValidationRules()

Returns the SDDManager's list of ValidationRules, for both Package and Deployment Descriptors.

void setEncoding(String encoding)

Sets the encoding to use when writing descriptors out to XML. A null value will cause the default encoding to be used, as will writing out descriptors before calling this method.

Command Line

More info about command line interface goes here.

Back to the top