public final class ResourceProfile extends BaseProfile<ResourceProfile,ResourceProvider>
| Modifier and Type | Field and Description |
|---|---|
static String |
KEY_PREFIX
Prefix of property keys about resources.
|
static Pattern |
NAME_PATTERN
Resource name pattern.
|
QUALIFIER| Constructor and Description |
|---|
ResourceProfile(String name,
Class<? extends ResourceProvider> providerClass,
ProfileContext context,
Map<String,String> configuration)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,String> |
getConfiguration()
Returns the extra configuration of this resource.
|
ProfileContext |
getContext()
Returns the current profile context.
|
String |
getName()
Returns this name.
|
Class<? extends ResourceProvider> |
getProviderClass()
Returns the class of corresponded provider.
|
protected ResourceProfile |
getThis()
Returns this object.
|
static Collection<? extends ResourceProfile> |
loadFrom(Properties properties,
ClassLoader loader)
Deprecated.
use
loadFrom(Properties, ProfileContext) instead |
static Collection<? extends ResourceProfile> |
loadFrom(Properties properties,
ProfileContext context)
Loads resource profiles from the properties.
|
static void |
removeCorrespondingKeys(Properties properties)
Removes entries corresponding to resource profiles.
|
void |
storeTo(Properties properties)
Stores this profile into the specified properties.
|
createProvider, getClassLoader, loadProviderClasspublic static final Pattern NAME_PATTERN
public static final String KEY_PREFIX
public ResourceProfile(String name, Class<? extends ResourceProvider> providerClass, ProfileContext context, Map<String,String> configuration)
name - the name of this resourceproviderClass - the class which can provide this resourcecontext - the current profile contextconfiguration - the extra configurationIllegalArgumentException - if any parameter is nullpublic String getName()
public Class<? extends ResourceProvider> getProviderClass()
BaseProfilegetProviderClass in class BaseProfile<ResourceProfile,ResourceProvider>public ProfileContext getContext()
BaseProfilegetContext in class BaseProfile<ResourceProfile,ResourceProvider>public Map<String,String> getConfiguration()
protected ResourceProfile getThis()
BaseProfilegetThis in class BaseProfile<ResourceProfile,ResourceProvider>@Deprecated public static Collection<? extends ResourceProfile> loadFrom(Properties properties, ClassLoader loader)
loadFrom(Properties, ProfileContext) insteadproperties - source propertiesloader - class loader to load the ResourceProviderIllegalArgumentException - if properties are invalid, or if any parameter is nullpublic static Collection<? extends ResourceProfile> loadFrom(Properties properties, ProfileContext context)
properties - source propertiescontext - the current contextIllegalArgumentException - if properties are invalid, or if any parameter is nullpublic void storeTo(Properties properties)
properties - target properties objectIllegalArgumentException - if target properties already contains keys about this resource,
or if any parameter is nullpublic static void removeCorrespondingKeys(Properties properties)
properties - target propertiesIllegalArgumentException - if any parameter is nullCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.