/** * 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()]); }
/** * 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()]); }
public <T> List<T> asList(Class<T> eType) { if (type == LIST_STRING && eType == String.class || type == LIST_INTEGER && eType == Integer.class || type == LIST_CLASS && eType == Class.class || type == LIST_OBJECT) { return (List<T>)value; } else if (type == PropertyType.LIST_STRING) { List<T> l = new ArrayList<>(); for (Object o : (List<?>)value) { T t = ClassUtils.fromString(eType, o.toString()); if (t == null) throw new ConfigException("Invalid property conversion ''{0}'' to ''List<{1}>'' on property ''{2}''", type, eType, name); l.add(t); } return unmodifiableList(l); } else { throw new ConfigException("Invalid property conversion ''{0}'' to ''List<{1}>'' on property ''{2}''", type, eType, name); } }
/** * 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()]); }
public <T> List<T> asList(Class<T> eType) { if (type == LIST_STRING && eType == String.class || type == LIST_INTEGER && eType == Integer.class || type == LIST_CLASS && eType == Class.class || type == LIST_OBJECT) { return (List<T>)value; } else if (type == PropertyType.LIST_STRING) { List<T> l = new ArrayList<>(); for (Object o : (List<?>)value) { T t = ClassUtils.fromString(eType, o.toString()); if (t == null) throw new ConfigException("Invalid property conversion ''{0}'' to ''List<{1}>'' on property ''{2}''", type, eType, name); l.add(t); } return unmodifiableList(l); } else { throw new ConfigException("Invalid property conversion ''{0}'' to ''List<{1}>'' on property ''{2}''", type, eType, name); } }
/** * Constructor. * * @param ps * The modifiable properties that were used to initialize the serializers. * A snapshot of these will be made so that we can clone and modify this group. * @param serializers * The serializers 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 SerializerGroup(PropertyStore ps, Serializer[] serializers) { super(ps); this.serializers = immutableList(serializers); List<MediaTypeRange> lmtr = new ArrayList<>(); LinkedHashSet<MediaType> lmt = new LinkedHashSet<>(); List<Serializer> l = new ArrayList<>(); for (Serializer s : serializers) { for (MediaTypeRange m: s.getMediaTypeRanges()) { lmtr.add(m); l.add(s); } for (MediaType mt : s.getAcceptMediaTypes()) lmt.add(mt); } this.mediaTypeRanges = lmtr.toArray(new MediaTypeRange[lmt.size()]); this.mediaTypesList = unmodifiableList(new ArrayList<>(lmt)); this.mediaTypeRangeSerializers = l.toArray(new Serializer[l.size()]); }
public <T> List<T> asList(Class<T> eType) { if (type == LIST_STRING && eType == String.class || type == LIST_INTEGER && eType == Integer.class || type == LIST_CLASS && eType == Class.class || type == LIST_OBJECT) { return (List<T>)value; } else if (type == PropertyType.LIST_STRING) { List<T> l = new ArrayList<>(); for (Object o : (List<?>)value) { T t = ClassUtils.fromString(eType, o.toString()); if (t == null) throw new ConfigException("Invalid property conversion ''{0}'' to ''List<{1}>'' on property ''{2}''", type, eType, name); l.add(t); } return unmodifiableList(l); } else { throw new ConfigException("Invalid property conversion ''{0}'' to ''List<{1}>'' on property ''{2}''", type, eType, name); } }
/** * Constructor. * * @param ps * The modifiable properties that were used to initialize the serializers. * A snapshot of these will be made so that we can clone and modify this group. * @param serializers * The serializers 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 SerializerGroup(PropertyStore ps, Serializer[] serializers) { super(ps); this.serializers = immutableList(serializers); List<MediaTypeRange> lmtr = new ArrayList<>(); LinkedHashSet<MediaType> lmt = new LinkedHashSet<>(); List<Serializer> l = new ArrayList<>(); for (Serializer s : serializers) { for (MediaTypeRange m: s.getMediaTypeRanges()) { lmtr.add(m); l.add(s); } for (MediaType mt : s.getAcceptMediaTypes()) lmt.add(mt); } this.mediaTypeRanges = lmtr.toArray(new MediaTypeRange[lmt.size()]); this.mediaTypesList = unmodifiableList(new ArrayList<>(lmt)); this.mediaTypeRangeSerializers = l.toArray(new Serializer[l.size()]); }
/** * Constructor. * * @param ps * The modifiable properties that were used to initialize the serializers. * A snapshot of these will be made so that we can clone and modify this group. * @param serializers * The serializers 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 SerializerGroup(PropertyStore ps, Serializer[] serializers) { super(ps); this.serializers = immutableList(serializers); List<MediaTypeRange> lmtr = new ArrayList<>(); LinkedHashSet<MediaType> lmt = new LinkedHashSet<>(); List<Serializer> l = new ArrayList<>(); for (Serializer s : serializers) { for (MediaTypeRange m: s.getMediaTypeRanges()) { lmtr.add(m); l.add(s); } for (MediaType mt : s.getAcceptMediaTypes()) lmt.add(mt); } this.mediaTypeRanges = lmtr.toArray(new MediaTypeRange[lmt.size()]); this.mediaTypesList = unmodifiableList(new ArrayList<>(lmt)); this.mediaTypeRangeSerializers = l.toArray(new Serializer[l.size()]); }
cmClass = cmCache.get(Class.class); beanDictionaryClasses = unmodifiableList(Arrays.asList(getClassArrayProperty(BEAN_beanDictionary))); beanRegistry = new BeanRegistry(this, null);
cmClass = cmCache.get(Class.class); beanDictionaryClasses = unmodifiableList(Arrays.asList(getClassArrayProperty(BEAN_beanDictionary))); beanRegistry = new BeanRegistry(this, null);
cmClass = cmCache.get(Class.class); beanDictionaryClasses = unmodifiableList(Arrays.asList(getClassArrayProperty(BEAN_beanDictionary))); beanRegistry = new BeanRegistry(this, null);