org.eclipse.actf.validation.doc.rulebase
Class ReflectionValidationDocument

java.lang.Object
  extended by org.eclipse.actf.validation.doc.rulebase.ReflectionValidationDocument
All Implemented Interfaces:
IValidationDocument

public class ReflectionValidationDocument
extends Object
implements IValidationDocument

embodies a validation document that uses knowledge of the Java API of the model being validated and the validation engine's use of the Java Reflection API to process validation rules. This was the original implementation of a valaidation document in the IBM IRule-based Accessibility Validation Environment (RAVEN).

Author:
Mike Squillace
See Also:
IBM IRule-based Accessibility Validation Environment

Field Summary
 
Fields inherited from interface org.eclipse.actf.validation.doc.rulebase.IValidationDocument
ACTF_NAMESPACE_URI, DOCUMENT_NAME, DOCUMENT_VERSION, ENABLE, MODEL, SCRIPTLANG
 
Constructor Summary
ReflectionValidationDocument(InputStream xmlSource)
          create a ReflectionValidationDocument from the given XML source stream.
 
Method Summary
protected  MethodExecutionPointTarget createMethodExecutionTarget(Element targetTypeElem, String targetTypeName, boolean polymorphic)
           
 AliasElement[] getAliasElements()
          return an array of alias elements of the document.
static Element[] getChildElements(Element element)
           
static Element[] getChildElements(Element element, String name)
           
 String getDocumentName()
          return the value of the actf:name attribute for this document
 String getDocumentVersion()
          return the value of the actf:version attribute for this document
 String getEnable()
          return the value of the actf:enable attribute
 ExecutionPointDescriptor[] getExecutionPointDescriptors()
          retreave the set of execution point descriptors stipulated in this document.
protected  Element getMetaDataElement(String name)
           
 String getModelType()
          return the value of the actf:model attribute
 Element[] getRuleSetElements()
          return the list of ruleset elements of the document.
 ScriptElement[] getScriptElements()
          return an array of script elements of the document.
 String getScriptLanguage()
          return the value of the actf:scriptlang attribute
 ExecutionPointDescriptor parseExecutionPointDescriptor(Element execPointElem)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionValidationDocument

public ReflectionValidationDocument(InputStream xmlSource)
                             throws ParserConfigurationException,
                                    SAXException,
                                    IOException
create a ReflectionValidationDocument from the given XML source stream. The XML document is parsed and may be traversed using the methods of this class.

Parameters:
xmlSource - -- source stream for document
Throws:
SAXException - in case of parsing error
IOException - in case of I/O error
ParserConfigurationException
Method Detail

getDocumentName

public String getDocumentName()
return the value of the actf:name attribute for this document

Specified by:
getDocumentName in interface IValidationDocument
Returns:
name of document or null if no name is specified

getModelType

public String getModelType()
return the value of the actf:model attribute

Specified by:
getModelType in interface IValidationDocument
Returns:
value of actf:enable attribute or null if not present

getDocumentVersion

public String getDocumentVersion()
return the value of the actf:version attribute for this document

Specified by:
getDocumentVersion in interface IValidationDocument
Returns:
version of the document or null if no version is specified

getScriptLanguage

public String getScriptLanguage()
return the value of the actf:scriptlang attribute

Specified by:
getScriptLanguage in interface IValidationDocument
Returns:
value of actf:scriptlang attribute or null if not present

getEnable

public String getEnable()
return the value of the actf:enable attribute

Specified by:
getEnable in interface IValidationDocument
Returns:
value of actf:enable attribute or null if not present

getScriptElements

public ScriptElement[] getScriptElements()
                                  throws MalformedRuleBaseException
return an array of script elements of the document. These elements include immediate children of the <raven:scripts> element. If the <raven:scripts> has only text content, then a single script element should be returned.

Specified by:
getScriptElements in interface IValidationDocument
Returns:
array of script elements or an empty array if no script elements are present
Throws:
MalformedRuleBaseException

getAliasElements

public AliasElement[] getAliasElements()
                                throws MalformedRuleBaseException
return an array of alias elements of the document. These elements include immediate children of the <raven:aliases> element and must have a tag name of 'raven:alias'.

Specified by:
getAliasElements in interface IValidationDocument
Returns:
array of alias elements or an empty array if no alias elements are present
Throws:
MalformedRuleBaseException

getRuleSetElements

public Element[] getRuleSetElements()
return the list of ruleset elements of the document. These elements include immediate children of the <raven:rulesets> element and must have a tag name of 'raven:ruleset'.

Specified by:
getRuleSetElements in interface IValidationDocument
Returns:
array of ruleset elements or an empty array if no ruleset elements are present

getExecutionPointDescriptors

public ExecutionPointDescriptor[] getExecutionPointDescriptors()
retreave the set of execution point descriptors stipulated in this document. Execution points are used to determine when processes are to be started during the executing application or rendering of or interaction with a document.

Specified by:
getExecutionPointDescriptors in interface IValidationDocument
Returns:
execution point descriptors specified by this document

parseExecutionPointDescriptor

public ExecutionPointDescriptor parseExecutionPointDescriptor(Element execPointElem)


createMethodExecutionTarget

protected MethodExecutionPointTarget createMethodExecutionTarget(Element targetTypeElem,
                                                                 String targetTypeName,
                                                                 boolean polymorphic)

getChildElements

public static Element[] getChildElements(Element element)

getChildElements

public static Element[] getChildElements(Element element,
                                         String name)

getMetaDataElement

protected Element getMetaDataElement(String name)
                              throws MalformedRuleBaseException
Throws:
MalformedRuleBaseException