eu.peppol.validation.commons.schematron
Class AbstractSchematronResource

java.lang.Object
  extended by eu.peppol.validation.commons.schematron.AbstractSchematronResource
All Implemented Interfaces:
com.phloc.commons.id.IHasID<String>, ISchematronResource
Direct Known Subclasses:
AbstractSchematronXSLTResource

public abstract class AbstractSchematronResource
extends Object
implements ISchematronResource

Abstract implementation of the ISchematronResource interface handling the underlying resource and wrapping one method.

Author:
PEPPOL.AT, BRZ, Philip Helger

Constructor Summary
AbstractSchematronResource(com.phloc.commons.io.IReadableResource aRes)
           
 
Method Summary
 Document applySchematronValidation(com.phloc.commons.io.IReadableResource aXMLResource)
          Apply the schematron validation on the passed XML resource and return an SVRL XML document.
 String getID()
           
 com.phloc.commons.io.IReadableResource getResource()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface eu.peppol.validation.commons.schematron.ISchematronResource
applySchematronValidation, isValidSchematron
 

Constructor Detail

AbstractSchematronResource

public AbstractSchematronResource(@Nonnull
                                  com.phloc.commons.io.IReadableResource aRes)
Method Detail

getID

@Nonnull
public final String getID()
Specified by:
getID in interface com.phloc.commons.id.IHasID<String>

getResource

@Nonnull
public final com.phloc.commons.io.IReadableResource getResource()
Specified by:
getResource in interface ISchematronResource
Returns:
The non-null resource from which to read the Schematron rules.

applySchematronValidation

@Nullable
public final Document applySchematronValidation(@Nonnull
                                                         com.phloc.commons.io.IReadableResource aXMLResource)
                                         throws Exception
Description copied from interface: ISchematronResource
Apply the schematron validation on the passed XML resource and return an SVRL XML document.

Specified by:
applySchematronValidation in interface ISchematronResource
Parameters:
aXMLResource - The XML resource to validate via Schematron. May not be null.
Returns:
null if the passed resource does not exist or the non- null SVRL document otherwise.
Throws:
Exception - In case the transformation somehow goes wrong.
See Also:
on how to convert the document into a domain object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 PEPPOL project. All Rights Reserved.