public class ProfileUtil extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
ProfileUtil.ProcessorConfigurationExtractor |
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_PROFILE |
static ProfileUtil.ProcessorConfigurationExtractor |
ENRICHER_CONFIG
Get the enricher configuration
|
static ProfileUtil.ProcessorConfigurationExtractor |
GENERATOR_CONFIG
Get the generator configuration
|
static String[] |
PROFILE_FILENAMES |
static ProfileUtil.ProcessorConfigurationExtractor |
WATCHER_CONFIG
Get the watcher configuration
|
Modifier and Type | Method and Description |
---|---|
static ProcessorConfig |
blendProfileWithConfiguration(ProfileUtil.ProcessorConfigurationExtractor configExtractor,
String profile,
File resourceDir,
ProcessorConfig config)
Find an enricher or generator config, possibly via a profile and merge it with a given configuration.
|
static Profile |
findProfile(String profileArg,
File resourceDir)
Find a profile.
|
static List<Profile> |
fromYaml(InputStream is)
Load a profile from an input stream.
|
static Profile |
lookup(String name,
File directory)
Lookup profiles from a given directory and merge it with a profile of the
same name found in the classpath
|
static List<Profile> |
readAllFromClasspath(String name,
String ext)
Read all profiles found in the classpath.
|
public static final String[] PROFILE_FILENAMES
public static final String DEFAULT_PROFILE
public static final ProfileUtil.ProcessorConfigurationExtractor GENERATOR_CONFIG
public static final ProfileUtil.ProcessorConfigurationExtractor ENRICHER_CONFIG
public static final ProfileUtil.ProcessorConfigurationExtractor WATCHER_CONFIG
public static Profile findProfile(String profileArg, File resourceDir) throws IOException
findProfile(String, File)
profileArg
- the profile's nameresourceDir
- a directory to check for profiles.IOException
public static ProcessorConfig blendProfileWithConfiguration(ProfileUtil.ProcessorConfigurationExtractor configExtractor, String profile, File resourceDir, ProcessorConfig config) throws IOException
configExtractor
- how to extract the config from a profile when foundprofile
- the profile name (can be null, then no profile is used)resourceDir
- resource directory where to lookup the profile (in addition to a classpath lookup)config
- the provided configurationIOException
public static Profile lookup(String name, File directory) throws IOException
name
- name of the profile to lookupdirectory
- directory to lookupIOException
- if somethings fails during lookuppublic static List<Profile> readAllFromClasspath(String name, String ext) throws IOException
name
- name of the profile to lookupext
- to use (e.g. 'default' for checking 'profile-default.yml'. Can also be null or empty.IOException
- if reading of a profile failspublic static List<Profile> fromYaml(InputStream is) throws IOException
is
- inputstream to read the profile fromIOException
- if deserialization failsCopyright © 2018. All rights reserved.