Package com.adobe.epubcheck.opf
Class ValidationContext
- java.lang.Object
-
- com.adobe.epubcheck.opf.ValidationContext
-
public final class ValidationContext extends java.lang.ObjectHolds various contextual objects used during validation. This validation context is notalby used byCheckerinstances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classValidationContext.ValidationContextBuilderBuilds a newValidationContextfrom various member objects or by copying a parent context.static classValidationContext.ValidationContextPredicatesUtility to createPredicates applying toValidationContextinstances.
-
Field Summary
Fields Modifier and Type Field Description com.google.common.base.Optional<OCFContainer>containerThe OCF Package the resource being validated belongs to.FeatureReportfeatureReportUsed to report some features of the validated resource, without logging.java.util.LocalelocaleThe locale used to log validation messages.java.lang.StringmimeTypeThe media type of the validated resource.com.google.common.base.Optional<OPFItem>opfItemThe Package Document item for the validated resource.com.google.common.base.Optional<OverlayTextChecker>overlayTextCheckerThe src checker for media overlay text elements, absent for single-file validationjava.lang.StringpathThe path to the validated resource.EPUBProfileprofileThe validation profile in use (e.g.java.util.Set<Property>propertiesThe set of properties associated to the resource being validated.java.util.Set<PublicationType>pubTypesThe set of 'dc:type' values declared at the OPF level.com.google.common.base.Optional<ReferenceRegistry>referenceRegistryThe references registry, absent for single-file validationReportreportThe report object used to log validation messages.GenericResourceProviderresourceProviderUsed to open resource streams.com.google.common.base.Optional<ResourceRegistry>resourceRegistryThe publication resource registry, absent for single-file validation.io.mola.galimatias.URLurlThe URL of the validated resource.EPUBVersionversionThe EPUB version being used for validation.
-
Constructor Summary
Constructors Modifier Constructor Description privateValidationContext(ValidationContext.ValidationContextBuilder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringcomputePath()ValidationContext.ValidationContextBuildercopy()java.lang.StringgetMimeType(io.mola.galimatias.URL url)booleanisRemote(io.mola.galimatias.URL url)static ValidationContext.ValidationContextBuilderof(io.mola.galimatias.URL url)java.lang.Stringrelativize(io.mola.galimatias.URL url)static ValidationContext.ValidationContextBuildertest()
-
-
-
Field Detail
-
url
public final io.mola.galimatias.URL url
The URL of the validated resource. Guaranteed non-null.
-
path
public final java.lang.String path
The path to the validated resource. Guaranteed non-null.
-
mimeType
public final java.lang.String mimeType
The media type of the validated resource. Guaranteed non-null.
-
version
public final EPUBVersion version
The EPUB version being used for validation. Guaranteed non-null.
-
profile
public final EPUBProfile profile
The validation profile in use (e.g. DEFAULT, EDUPUB, etc.). Guaranteed non-null.
-
report
public final Report report
The report object used to log validation messages. Guaranteed non-null.
-
locale
public final java.util.Locale locale
The locale used to log validation messages. Guaranteed non-null.
-
featureReport
public final FeatureReport featureReport
Used to report some features of the validated resource, without logging. Guaranteed non-null.
-
resourceProvider
public final GenericResourceProvider resourceProvider
Used to open resource streams. Guaranteed non-null.
-
opfItem
public final com.google.common.base.Optional<OPFItem> opfItem
The Package Document item for the validated resource. Is absent if there is no item representing this resource in the Package Document.
-
container
public final com.google.common.base.Optional<OCFContainer> container
The OCF Package the resource being validated belongs to. Is absent for single-file validations.
-
resourceRegistry
public final com.google.common.base.Optional<ResourceRegistry> resourceRegistry
The publication resource registry, absent for single-file validation.
-
referenceRegistry
public final com.google.common.base.Optional<ReferenceRegistry> referenceRegistry
The references registry, absent for single-file validation
-
overlayTextChecker
public final com.google.common.base.Optional<OverlayTextChecker> overlayTextChecker
The src checker for media overlay text elements, absent for single-file validation
-
pubTypes
public final java.util.Set<PublicationType> pubTypes
The set of 'dc:type' values declared at the OPF level. Guaranteed non-null, can be empty.
-
properties
public final java.util.Set<Property> properties
The set of properties associated to the resource being validated.
-
-
Constructor Detail
-
ValidationContext
private ValidationContext(ValidationContext.ValidationContextBuilder builder)
-
-
Method Detail
-
computePath
private java.lang.String computePath()
-
copy
public ValidationContext.ValidationContextBuilder copy()
-
isRemote
public boolean isRemote(io.mola.galimatias.URL url)
-
relativize
public java.lang.String relativize(io.mola.galimatias.URL url)
-
of
public static final ValidationContext.ValidationContextBuilder of(io.mola.galimatias.URL url)
-
test
public static final ValidationContext.ValidationContextBuilder test()
-
getMimeType
public java.lang.String getMimeType(io.mola.galimatias.URL url)
-
-