Package com.adobe.epubcheck.util
Class SourceSet.Parser
- java.lang.Object
-
- com.adobe.epubcheck.util.SourceSet.Parser
-
- Enclosing class:
- SourceSet
private static final class SourceSet.Parser extends java.lang.ObjectThe `srcser` parser implementation. Folows the logic of the "parsing a srcset attribute" algorithm, see https://html.spec.whatwg.org/#parsing-a-srcset-attribute
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classSourceSet.Parser.State
-
Field Summary
Fields Modifier and Type Field Description private SourceSet.ErrorHandlererrorHandlerprivate static java.util.regex.PatternPOSITIVE_FLOAT
-
Constructor Summary
Constructors Constructor Description Parser(SourceSet.ErrorHandler errorHandler)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voiderror(SourceSet.ParseError code, int position)private SourceSet.ImageSourcefinalizeSource(java.lang.StringBuilder url, java.util.List<java.lang.String> descriptors)SourceSetparse(java.lang.CharSequence srcset)private static intremoveTrailingCommas(java.lang.StringBuilder sb)Remove trailing commas and return the count of commas removed
-
-
-
Field Detail
-
POSITIVE_FLOAT
private static java.util.regex.Pattern POSITIVE_FLOAT
-
errorHandler
private final SourceSet.ErrorHandler errorHandler
-
-
Constructor Detail
-
Parser
public Parser(SourceSet.ErrorHandler errorHandler)
-
-
Method Detail
-
parse
public SourceSet parse(java.lang.CharSequence srcset)
-
removeTrailingCommas
private static int removeTrailingCommas(java.lang.StringBuilder sb)
Remove trailing commas and return the count of commas removed
-
finalizeSource
private SourceSet.ImageSource finalizeSource(java.lang.StringBuilder url, java.util.List<java.lang.String> descriptors)
-
error
private void error(SourceSet.ParseError code, int position)
-
-