org.eclipse.ocl.examples.emf.validation.validity.export
Class AbstractExporter

java.lang.Object
  extended by org.eclipse.ocl.examples.emf.validation.validity.export.AbstractExporter
All Implemented Interfaces:
IValidityExporter, IValidityExporterDescriptor
Direct Known Subclasses:
HTMLExporter, ModelExporter, TextExporter

public abstract class AbstractExporter
extends java.lang.Object
implements IValidityExporter

Exports ocl validation results.


Field Summary
protected  java.util.List<LeafConstrainingNode> validationErrors
           
protected  java.util.List<LeafConstrainingNode> validationFailures
           
protected  java.util.List<LeafConstrainingNode> validationInfos
           
protected  java.util.List<LeafConstrainingNode> validationSuccess
           
protected  java.util.List<LeafConstrainingNode> validationWarnings
           
 
Constructor Summary
AbstractExporter()
           
 
Method Summary
protected abstract  void createContents(java.lang.Appendable s, org.eclipse.emf.ecore.resource.Resource validatedResource, RootNode rootNode, java.lang.String exportedFileName)
          Returns a stream containing the initial contents to be given to new exported validation results file resource instances.
 void export(java.lang.Appendable s, org.eclipse.emf.ecore.resource.Resource validatedResource, RootNode rootNode, java.lang.String exportedFileName)
          Export the validity results to an Appendable.
 java.lang.String export(org.eclipse.emf.ecore.resource.Resource validatedResource, RootNode rootNode, java.lang.String exportedFileName)
          Export the validity results and return String containing the results.
protected  int getConstraintCount()
           
 IValidityExporter getExporter()
           
protected  java.lang.String getMessage(Result result)
           
protected  java.lang.String getSeverity(Result result)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ocl.examples.emf.validation.validity.export.IValidityExporter
getPreferredExtension
 
Methods inherited from interface org.eclipse.ocl.examples.emf.validation.validity.export.IValidityExporterDescriptor
getExporterType
 

Field Detail

validationErrors

@NonNull
protected final java.util.List<LeafConstrainingNode> validationErrors

validationFailures

@NonNull
protected final java.util.List<LeafConstrainingNode> validationFailures

validationInfos

@NonNull
protected final java.util.List<LeafConstrainingNode> validationInfos

validationSuccess

@NonNull
protected final java.util.List<LeafConstrainingNode> validationSuccess

validationWarnings

@NonNull
protected final java.util.List<LeafConstrainingNode> validationWarnings
Constructor Detail

AbstractExporter

public AbstractExporter()
Method Detail

createContents

protected abstract void createContents(@NonNull
                                       java.lang.Appendable s,
                                       @NonNull
                                       org.eclipse.emf.ecore.resource.Resource validatedResource,
                                       @NonNull
                                       RootNode rootNode,
                                       @Nullable
                                       java.lang.String exportedFileName)
                                throws java.io.IOException
Returns a stream containing the initial contents to be given to new exported validation results file resource instances.

Parameters:
validatedResource - The validated model
rootNode - The validation result model
exportedFileName - The target file name or null if not known and not to be reported
Throws:
java.io.IOException

export

@NonNull
public java.lang.String export(@NonNull
                                       org.eclipse.emf.ecore.resource.Resource validatedResource,
                                       @NonNull
                                       RootNode rootNode,
                                       @Nullable
                                       java.lang.String exportedFileName)
Description copied from interface: IValidityExporter
Export the validity results and return String containing the results.

Specified by:
export in interface IValidityExporter
Parameters:
validatedResource - The resource to validate
rootNode - The Root Node to export
exportedFileName - The target file name or null if not known and not to be reported

export

public void export(@NonNull
                   java.lang.Appendable s,
                   @NonNull
                   org.eclipse.emf.ecore.resource.Resource validatedResource,
                   @NonNull
                   RootNode rootNode,
                   @Nullable
                   java.lang.String exportedFileName)
            throws java.io.IOException
Description copied from interface: IValidityExporter
Export the validity results to an Appendable.

Specified by:
export in interface IValidityExporter
Parameters:
s - The appendable
validatedResource - The resource to validate
rootNode - The Root Node to export
exportedFileName - The target file name or null if not known and not to be reported
Throws:
java.io.IOException

getConstraintCount

protected int getConstraintCount()

getExporter

@NonNull
public IValidityExporter getExporter()
Specified by:
getExporter in interface IValidityExporterDescriptor

getMessage

protected java.lang.String getMessage(Result result)

getSeverity

protected java.lang.String getSeverity(Result result)