Search in sources :

Example 1 with OPFValidator

use of org.eclipse.mylyn.docs.epub.opf.util.OPFValidator in project mylyn.docs by eclipse.

the class Publication method validateMetadata.

/**
 * Validates the data model contents.
 *
 * @return a list of EMF diagnostics
 */
public List<Diagnostic> validateMetadata() {
    EValidator.Registry.INSTANCE.put(OPFPackage.eINSTANCE, new OPFValidator());
    BasicDiagnostic diagnostics = new BasicDiagnostic();
    for (EObject eo : opfPackage.eContents()) {
        Map<Object, Object> context = new HashMap<Object, Object>();
        Diagnostician.INSTANCE.validate(eo, diagnostics, context);
    }
    return diagnostics.getChildren();
}
Also used : HashMap(java.util.HashMap) BasicDiagnostic(org.eclipse.emf.common.util.BasicDiagnostic) OPFValidator(org.eclipse.mylyn.docs.epub.opf.util.OPFValidator) EObject(org.eclipse.emf.ecore.EObject) EObject(org.eclipse.emf.ecore.EObject)

Aggregations

HashMap (java.util.HashMap)1 BasicDiagnostic (org.eclipse.emf.common.util.BasicDiagnostic)1 EObject (org.eclipse.emf.ecore.EObject)1 OPFValidator (org.eclipse.mylyn.docs.epub.opf.util.OPFValidator)1