Class SourceSet
java.lang.Object
com.adobe.epubcheck.util.SourceSet
Represents an image source set. See https://html.spec.whatwg.org/#source-set
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classstatic interfaceAn error handler for the `srcset` parserstatic final classRepresent an image source.static enumCodes for the various parsing errors.private static final classThe `srcser` parser implementation. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.google.common.base.Function<SourceSet.ImageSource, String> private final Stringprivate final List<SourceSet.ImageSource> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSourceSet(List<SourceSet.ImageSource> sources, String size) -
Method Summary
Modifier and TypeMethodDescriptionbooleanisEmpty()static SourceSetParses a `srcset` value and swallows the errors.static SourceSetparse(String srcset, SourceSet.ErrorHandler errorHandler) Parses a `srcset` value and reports the errors to the givenSourceSet.ErrorHandler.
-
Field Details
-
LIST_TO_URL_FUNC
private static final com.google.common.base.Function<SourceSet.ImageSource, String> LIST_TO_URL_FUNC -
sources
-
urls
-
size
-
-
Constructor Details
-
SourceSet
-
-
Method Details
-
parse
-
parse
Parses a `srcset` value and reports the errors to the givenSourceSet.ErrorHandler. -
getImageSources
- Returns:
- the list of image sources in the source set.
-
getImageURLs
-
getSourceSize
- Returns:
- the number of sources in this source set.
-
isEmpty
public boolean isEmpty()- Returns:
- whether this source set is empty.
-