001package io.jstach.opt.spring;
002
003import java.util.List;
004
005import io.jstach.jstachio.spi.AbstractJStachio;
006import io.jstach.jstachio.spi.JStachioExtension;
007import io.jstach.jstachio.spi.JStachioExtensions;
008
009/**
010 * A JStachio that does not use the service loader.
011 *
012 * @author agentgt
013 */
014public class SpringJStachio extends AbstractJStachio {
015
016        private final JStachioExtensions extensions;
017
018        /**
019         * Passed the found services usually injected by Spring.
020         * @param extensions not null.
021         */
022        public SpringJStachio(List<JStachioExtension> extensions) {
023                this(JStachioExtensions.of(extensions));
024        }
025
026        /**
027         * Passed the found services usually injected by Spring.
028         * @param extensions not null.
029         */
030        public SpringJStachio(JStachioExtensions extensions) {
031                this.extensions = extensions;
032        }
033
034        @Override
035        public JStachioExtensions extensions() {
036                return this.extensions;
037        }
038
039}