uk.ac.starlink.ttools.taplint
Class XsdStage

java.lang.Object
  extended by uk.ac.starlink.ttools.taplint.XsdStage
All Implemented Interfaces:
Stage

public abstract class XsdStage
extends Object
implements Stage

Validation stage for validating a document against a given XML schema.

Since:
3 Jun 2011
Author:
Mark Taylor

Nested Class Summary
static class XsdStage.Result
          Enumerates possible results of the parse.
 
Constructor Summary
protected XsdStage(String topElNamespaceUri, String topElName)
          Constructor.
 
Method Summary
static XsdStage createXsdStage(String topElName, String topElNamespace, String docUrlSuffix, boolean mandatory, String resourceDescription)
          Returns a new XsdStage suitable for one of the standard TAP XML endpoints.
abstract  String getDocumentUrl(URL serviceUrl)
          Returns the URL of the document to validate, given the service URL for the TAP service.
 XsdStage.Result getResult()
          Returns a token giving the result status last time this stage was run.
 void run(Reporter reporter, URL serviceUrl)
          Performs the validation checks for this stage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.ac.starlink.ttools.taplint.Stage
getDescription
 

Constructor Detail

XsdStage

protected XsdStage(String topElNamespaceUri,
                   String topElName)
Constructor.

Parameters:
topElNamespaceUri - namespace of required document root element
topElName - local name of required document root element
Method Detail

getDocumentUrl

public abstract String getDocumentUrl(URL serviceUrl)
Returns the URL of the document to validate, given the service URL for the TAP service.

Parameters:
serviceUrl - TAP service URL
Returns:
url of XML document to validate

run

public void run(Reporter reporter,
                URL serviceUrl)
Description copied from interface: Stage
Performs the validation checks for this stage.

Specified by:
run in interface Stage
Parameters:
reporter - destination for validation messages
serviceUrl - TAP service URL

getResult

public XsdStage.Result getResult()
Returns a token giving the result status last time this stage was run.

Returns:
validation result

createXsdStage

public static XsdStage createXsdStage(String topElName,
                                      String topElNamespace,
                                      String docUrlSuffix,
                                      boolean mandatory,
                                      String resourceDescription)
Returns a new XsdStage suitable for one of the standard TAP XML endpoints.

Parameters:
topElName - required local name for top-level document element
topElNamespace - expected XML namespace for top-level document element (not currently required, which I think is correct, but I could be wrong)
docUrlSuffix - suffix (include leading /) of TAP service URL giving resource endpoint
mandatory - true iff resource is REQUIRED by standard
resourceDescription - short description of what resource contains
Returns:
new stage for XSD validation


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.