ConfigEntry(String key, String value, String modifiers, String comment, List<String> preLines) { this.rawLine = null; this.key = key; this.value = value; this.comment = comment; this.modifiers = modifiers; this.preLines = immutableList(preLines); }
ConfigEntry(String key, String value, String modifiers, String comment, List<String> preLines) { this.rawLine = null; this.key = key; this.value = value; this.comment = comment; this.modifiers = modifiers; this.preLines = immutableList(preLines); }
ConfigEntry(String key, String value, String modifiers, String comment, List<String> preLines) { this.rawLine = null; this.key = key; this.value = value; this.comment = comment; this.modifiers = modifiers; this.preLines = immutableList(preLines); }
/** * Constructor. * * @param value The raw header value. */ protected HeaderRangeArray(String value) { this.typeRanges = StringRange.parse(value); this.typeRangesList = immutableList(typeRanges); }
/** * Constructor. * * @param value The raw header value. */ protected HeaderRangeArray(String value) { this.typeRanges = StringRange.parse(value); this.typeRangesList = immutableList(typeRanges); }
/** * Constructor. * * @param value The raw header value. */ protected HeaderRangeArray(String value) { this.typeRanges = StringRange.parse(value); this.typeRangesList = immutableList(typeRanges); }
private Accept(String value) { this.mediaRanges = MediaTypeRange.parse(value); this.mediaRangesList = immutableList(mediaRanges); }
private Accept(String value) { this.mediaRanges = MediaTypeRange.parse(value); this.mediaRangesList = immutableList(mediaRanges); }
private Accept(String value) { this.mediaRanges = MediaTypeRange.parse(value); this.mediaRangesList = immutableList(mediaRanges); }
/** * Constructor * * @param encoders The encoders to add to this group. */ public EncoderGroup(Encoder[] encoders) { this.encoders = immutableList(encoders); List<String> lc = new ArrayList<>(); List<Encoder> l = new ArrayList<>(); for (Encoder e : encoders) { for (String c: e.getCodings()) { lc.add(c); l.add(e); } } this.encodings = lc.toArray(new String[lc.size()]); this.encodingsList = unmodifiableList(lc); this.encodingsEncoders = l.toArray(new Encoder[l.size()]); }
/** * Constructor * * @param encoders The encoders to add to this group. */ public EncoderGroup(Encoder[] encoders) { this.encoders = immutableList(encoders); List<String> lc = new ArrayList<>(); List<Encoder> l = new ArrayList<>(); for (Encoder e : encoders) { for (String c: e.getCodings()) { lc.add(c); l.add(e); } } this.encodings = lc.toArray(new String[lc.size()]); this.encodingsList = unmodifiableList(lc); this.encodingsEncoders = l.toArray(new Encoder[l.size()]); }
/** * Constructor * * @param encoders The encoders to add to this group. */ public EncoderGroup(Encoder[] encoders) { this.encoders = immutableList(encoders); List<String> lc = new ArrayList<>(); List<Encoder> l = new ArrayList<>(); for (Encoder e : encoders) { for (String c: e.getCodings()) { lc.add(c); l.add(e); } } this.encodings = lc.toArray(new String[lc.size()]); this.encodingsList = unmodifiableList(lc); this.encodingsEncoders = l.toArray(new Encoder[l.size()]); }
/** * Constructor. * * @param ps * The modifiable properties that were used to initialize the parsers. * A snapshot of these will be made so that we can clone and modify this group. * @param parsers * The parsers defined in this group. * The order is important because they will be tried in reverse order (e.g. newer first) in which they will be * tried to match against media types. */ public ParserGroup(PropertyStore ps, Parser[] parsers) { super(ps); this.parsers = immutableList(parsers); List<MediaType> lmt = new ArrayList<>(); List<Parser> l = new ArrayList<>(); for (Parser p : parsers) { for (MediaType m: p.getMediaTypes()) { lmt.add(m); l.add(p); } } this.mediaTypes = lmt.toArray(new MediaType[lmt.size()]); this.mediaTypesList = unmodifiableList(lmt); this.mediaTypeParsers = l.toArray(new Parser[l.size()]); }
MediaType(String mt) { Builder b = new Builder(mt); this.mediaType = b.mediaType; this.type = b.type; this.subType = b.subType; this.subTypes = b.subTypes; this.subTypesSorted = b.subTypesSorted; this.subTypesList = immutableList(subTypes); this.parameters = unmodifiableMap(b.parameters); this.hasSubtypeMeta = b.hasSubtypeMeta; }
/** * Constructor. * * @param ps * The modifiable properties that were used to initialize the parsers. * A snapshot of these will be made so that we can clone and modify this group. * @param parsers * The parsers defined in this group. * The order is important because they will be tried in reverse order (e.g. newer first) in which they will be * tried to match against media types. */ public ParserGroup(PropertyStore ps, Parser[] parsers) { super(ps); this.parsers = immutableList(parsers); List<MediaType> lmt = new ArrayList<>(); List<Parser> l = new ArrayList<>(); for (Parser p : parsers) { for (MediaType m: p.getMediaTypes()) { lmt.add(m); l.add(p); } } this.mediaTypes = lmt.toArray(new MediaType[lmt.size()]); this.mediaTypesList = unmodifiableList(lmt); this.mediaTypeParsers = l.toArray(new Parser[l.size()]); }
ConfigEntry(String line, List<String> preLines) { this.rawLine = line; int i = line.indexOf('='); String key = line.substring(0, i).trim(); int modIndex = key.length(); for (int j = key.length()-1; j > 0; j--) if (MOD_CHARS.contains(key.charAt(j))) modIndex--; this.modifiers = key.substring(modIndex); this.key = key.substring(0, modIndex); line = line.substring(i+1); i = line.indexOf('#'); if (i != -1) { String[] l2 = StringUtils.split(line, '#', 2); line = l2[0]; if (l2.length == 2) this.comment = l2[1].trim(); else this.comment = null; } else { this.comment = null; } this.value = StringUtils.replaceUnicodeSequences(line.trim()); this.preLines = immutableList(preLines); }
ConfigEntry(String line, List<String> preLines) { this.rawLine = line; int i = line.indexOf('='); String key = line.substring(0, i).trim(); int modIndex = key.length(); for (int j = key.length()-1; j > 0; j--) if (MOD_CHARS.contains(key.charAt(j))) modIndex--; this.modifiers = key.substring(modIndex); this.key = key.substring(0, modIndex); line = line.substring(i+1); i = line.indexOf('#'); if (i != -1) { String[] l2 = StringUtils.split(line, '#', 2); line = l2[0]; if (l2.length == 2) this.comment = l2[1].trim(); else this.comment = null; } else { this.comment = null; } this.value = StringUtils.replaceUnicodeSequences(line.trim()); this.preLines = immutableList(preLines); }
ConfigEntry(String line, List<String> preLines) { this.rawLine = line; int i = line.indexOf('='); String key = line.substring(0, i).trim(); int modIndex = key.length(); for (int j = key.length()-1; j > 0; j--) if (MOD_CHARS.contains(key.charAt(j))) modIndex--; this.modifiers = key.substring(modIndex); this.key = key.substring(0, modIndex); line = line.substring(i+1); i = line.indexOf('#'); if (i != -1) { String[] l2 = StringUtils.split(line, '#', 2); line = l2[0]; if (l2.length == 2) this.comment = l2[1].trim(); else this.comment = null; } else { this.comment = null; } this.value = StringUtils.replaceUnicodeSequences(line.trim()); this.preLines = immutableList(preLines); }
MediaType(String mt) { Builder b = new Builder(mt); this.mediaType = b.mediaType; this.type = b.type; this.subType = b.subType; this.subTypes = b.subTypes; this.subTypesSorted = b.subTypesSorted; this.subTypesList = immutableList(subTypes); this.parameters = unmodifiableMap(b.parameters); this.hasSubtypeMeta = b.hasSubtypeMeta; }
MediaType(String mt) { Builder b = new Builder(mt); this.mediaType = b.mediaType; this.type = b.type; this.subType = b.subType; this.subTypes = b.subTypes; this.subTypesSorted = b.subTypesSorted; this.subTypesList = immutableList(subTypes); this.parameters = unmodifiableMap(b.parameters); this.hasSubtypeMeta = b.hasSubtypeMeta; }