All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.adobe.epubcheck.ocf.MappingDocumentChecker Maven / Gradle / Ivy

Go to download

EPUBCheck is a tool to validate the conformance of EPUB publications against the EPUB specifications. EPUBCheck can be run as a standalone command-line tool or used as a Java library.

There is a newer version: 5.1.0
Show newest version
package com.adobe.epubcheck.ocf;

import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.hasProp;

import org.w3c.epubcheck.core.AbstractChecker;

import com.adobe.epubcheck.opf.ValidationContext;
import com.adobe.epubcheck.util.ValidatorMap;
import com.adobe.epubcheck.vocab.EpubCheckVocab;
import com.adobe.epubcheck.xml.XMLParser;
import com.adobe.epubcheck.xml.XMLValidator;
import com.adobe.epubcheck.xml.XMLValidators;

class MappingDocumentChecker extends AbstractChecker
{

  private static final ValidatorMap validatorMap = ValidatorMap.builder()
      .putAll(hasProp(EpubCheckVocab.VOCAB.get(EpubCheckVocab.PROPERTIES.RENDITION_MAPPING)),
          XMLValidators.RENDITION_MAPPING_RNC, XMLValidators.RENDITION_MAPPING_SCH)
      .build();

  public MappingDocumentChecker(ValidationContext context)
  {
    super(context);
  }

  @Override
  public void check()
  {
    XMLParser parser = new XMLParser(context);
    for (XMLValidator validator : validatorMap.getValidators(context))
    {
      parser.addValidator(validator);
    }
    parser.process();

  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy