@Inject public CoreExportsProvider( PlexusContainer container, @Nullable CoreExports exports ) { if ( exports == null ) { this.exports = new CoreExports( CoreExtensionEntry.discoverFrom( container.getContainerRealm() ) ); } else { this.exports = exports; } }
public class Ap3Help extends Help implements Ap3Command { @Inject @Nullable protected GlobalOptions globalOptions = new GlobalOptions(); @Override public void setArgs(String[] args) { //do nothing } }
@Inject UnrestrictedInstance( @Nullable final Y single, @Named( "fixed" ) final Y fixed ) { this.single = single; this.fixed = fixed; } }
static class PlaceholderInstance extends AbstractX { @Inject @Nullable @Named( "${name}" ) Y single; }
static class PlaceholderConfig extends AbstractX { @Inject @Nullable @Named( "4${value}2" ) int single; }
@Inject NamedInstance( @Nullable @Named( "TEST" ) final Y single ) { this.single = single; }
@Inject public AetherRepositoryConnectorFactory(FileProcessor fileProcessor, @Nullable SSLSocketFactory sslSocketFactory) throws NoSuchAlgorithmException { this.fileProcessor = fileProcessor; // explicitly use jdk-default ssl socket factory if none is provided externally // this is necessary because okhttp default socket factory does not honour // javax.net.ssl.keyStore/trustStore system properties, which are the only way // to use custom ket/trust stores in maven in m2e this.sslSocketFactory = sslSocketFactory != null? sslSocketFactory: SSLContext.getDefault().getSocketFactory(); }
@Inject NamedType( @Named( "fixed" ) final Y fixed, @Nullable @Named final Y single ) { this.single = single; this.fixed = fixed; } }
@Inject Slf4jLoggerFactory( @Nullable ILoggerFactory factory ) { setLoggerFactory( factory ); }
/** * @since version */ public abstract class BaseAp3Command implements Ap3Command { @Inject @Nullable protected GlobalOptions globalOptions = new GlobalOptions(); private String[] passedArgs; @Inject private Ap3Logger logger; protected Logger getLog() { return logger; } public void setArgs(String[] args) { this.passedArgs = args; } protected String[] getPassedInArgs() { return passedArgs; } }
private static String buildZipballPath(final String vendor, final String project, final String version, @Nullable final String name) { return String.format(ZIPBALL_PATH, vendor, project, version, name == null ? String.format(NAME_PATTERN, vendor, project, version) : name); }
@Inject Slf4jLoggerFactory( @Nullable ILoggerFactory factory ) { setLoggerFactory( factory ); }
@Inject @SuppressWarnings("unchecked") public DefaultProcessConfiguration(@Config("process.defaultConfiguration") @Nullable String path) throws IOException { if (path == null) { log.warn("init -> no default process configuration"); this.cfg = Collections.emptyMap(); return; } log.info("init -> using external default process configuration: {}", path); ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); try (InputStream in = Files.newInputStream(Paths.get(path))) { this.cfg = Optional.ofNullable(mapper.readValue(in, Map.class)).orElse(Collections.emptyMap()); } }
@Inject public TemplateConfiguration(@Config("template.cacheDir") @Nullable String cacheDir) throws IOException { this.cacheDir = getPath(cacheDir, "templateCache"); log.info("init -> using {} to cache templates", this.cacheDir); }
@Inject public RepositoryConfiguration(@Config("repositoryCache.cacheDir") @Nullable String cacheDir) throws IOException { this.cacheDir = getPath(cacheDir, "repoCache"); log.info("init -> using {} to cache repositories", this.cacheDir); }
@Named @Singleton public class RememberMeConfiguration implements Serializable { @Inject @Config("rememberMe.maxAge") private int rememberMeMaxAge; @Inject @Config("rememberMe.cipherKey") @Nullable private byte[] cipherKey; public int getRememberMeMaxAge() { return rememberMeMaxAge; } public byte[] getCipherKey() { return cipherKey; } }
@Inject public LdapConfiguration(@Config("ldap.exposeAttributes") @Nullable String exposeAttributes) { this.exposeAttributes = split(exposeAttributes); }
@Named @Singleton public class GithubConfiguration { @Inject @Config("github.secret") @Nullable private String secret; @Inject @Config("github.githubDomain") private String githubDomain; @Inject @Config("github.defaultFilter") private Map<String, Object> defaultFilter; public String getSecret() { return secret; } public String getGithubDomain() { return githubDomain; } public Map<String, Object> getDefaultFilter() { return defaultFilter; } }