public void parse(Attribute attribute, EncryptionData.Builder builder, ParseState state) { EncryptionMethod method = EncryptionMethod.fromValue(attribute.value); if (method == null) { throw ParseException.create(ParseExceptionType.INVALID_ENCRYPTION_METHOD, tag: null, context: attribute.ToString()); } else { builder.withMethod(method); } }
public void parse(Attribute attribute, StartData.Builder builder, ParseState state) { builder.withPrecise(ParseUtil.parseYesNo(attribute)); }
public void parse(String line, ParseState state) { lineParser.parse(line, state); // deprecated }
public override void parse(Attribute attribute, T builder, ParseState state) { // deprecated }
public void parse(Attribute attribute, StartData.Builder builder, ParseState state) { builder.withTimeOffset(ParseUtil.parseFloat(attribute.value)); }
public void parse(Attribute attribute, EncryptionData.Builder builder, ParseState state) { String[] versionStrings = ParseUtil.parseQuotedString(attribute.value).Split(Constants.LIST_SEPARATOR); List <int> versions = new List <int>(); foreach (String version in versionStrings) { try { versions.Add(Int32.Parse(version)); } catch (FormatException) { throw ParseException.create(ParseExceptionType.INVALID_KEY_FORMAT_VERSIONS, tag: null, context: attribute.ToString()); } } builder.withKeyFormatVersions(versions); }
public override Playlist parse() { validateAvailable(); ParseState state = new ParseState(mEncoding); LineParser playlistParser = new PlaylistLineParser(); LineParser trackLineParser = new TrackLineParser(); try { while (mScanner.hasNext()) { String line = mScanner.next(); checkWhitespace(line); if (line.Length == 0 || isComment(line)) { continue; } else { if (isExtTag(line)) { String tagKey = getExtTagKey(line); mExtTagParsers.TryGetValue(tagKey, out IExtTagParser tagParser); if (tagParser == null) { //To support forward compatibility, when parsing Playlists, Clients //MUST: //o ignore any unrecognized tags. if (mParsingMode.allowUnknownTags) { tagParser = ExtLineParser.EXT_UNKNOWN_HANDLER; } else { throw ParseException.create(ParseExceptionType.UNSUPPORTED_EXT_TAG_DETECTED, tagKey, line); } } tagParser.parse(line, state); if (state.isMedia() && state.getMedia().endOfList) { break; } } else if (state.isMaster()) { playlistParser.parse(line, state); } else if (state.isMedia()) { trackLineParser.parse(line, state); } else { throw ParseException.create(ParseExceptionType.UNKNOWN_PLAYLIST_TYPE, line); } } } Playlist playlist = state.buildPlaylist(); PlaylistValidation validation = PlaylistValidation.from(playlist, mParsingMode); if (validation.isValid()) { return(playlist); } else { throw new PlaylistException(mScanner.getInput(), validation.getErrors()); } } catch (ParseException exception) { exception.setInput(mScanner.getInput()); throw exception; } }
public override void parse(Attribute attribute, T builder, ParseState state) { builder.withAverageBandwidth(ParseUtil.parseInt(attribute.value, tag)); }
public override void parse(Attribute attribute, T builder, ParseState state) { builder.withResolution(ParseUtil.parseResolution(attribute.value, tag)); }
public void parse(Attribute attribute, StreamInfo.Builder builder, ParseState state) { builder.withSubtitles(ParseUtil.parseQuotedString(attribute.value)); }
public abstract void parse(Attribute attribute, T builder, ParseState state);
public void parse(Attribute attribute, IFrameStreamInfo.Builder builder, ParseState state) { builder.withUri(ParseUtil.parseQuotedString(attribute.value)); }
public void parse(Attribute attribute, MediaData.Builder builder, ParseState state) { builder.withForced(ParseUtil.parseYesNo(attribute)); }
public void parse(Attribute attribute, MediaData.Builder builder, ParseState state) { builder.withAssociatedLanguage(ParseUtil.parseQuotedString(attribute.value)); }
public void parse(Attribute attribute, EncryptionData.Builder builder, ParseState state) { List <Byte> initializationVector = ParseUtil.parseHexadecimal(attribute.value); if ((initializationVector.Count != Constants.IV_SIZE) && (initializationVector.Count != Constants.IV_SIZE_ALTERNATIVE)) { throw ParseException.create(ParseExceptionType.INVALID_IV_SIZE, tag: null, context: attribute.ToString()); } builder.withInitializationVector(initializationVector); }
public override void parse(Attribute attribute, T builder, ParseState state) { builder.withFrameRate(ParseUtil.parseFloat(attribute.value, tag)); }
public void parse(Attribute attribute, EncryptionData.Builder builder, ParseState state) { builder.withKeyFormat(ParseUtil.parseQuotedString(attribute.value)); }
public override void parse(Attribute attribute, T builder, ParseState state) { builder.withVideo(ParseUtil.parseQuotedString(attribute.value, tag)); }
public void parse(Attribute attribute, MapInfo.Builder builder, ParseState state) { builder.withUri(ParseUtil.decodeUri(ParseUtil.parseQuotedString(attribute.value), state.encoding)); }
public void parse(String line, ParseState state) { state.unknownTags.Add(line); }