|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.kuali.common.util.spring.SpringUtils
public class SpringUtils
| Constructor Summary | |
|---|---|
SpringUtils()
|
|
| Method Summary | ||
|---|---|---|
static List<org.springframework.core.env.PropertySource<?>> |
asList(org.springframework.core.env.PropertySource<?>... sources)
Null safe method for converting an untyped array of property sources into a list. |
|
static void |
closeQuietly(org.springframework.context.ConfigurableApplicationContext context)
Null safe close for a context |
|
static Properties |
convert(org.springframework.core.env.EnumerablePropertySource<?> source)
Convert an EnumerablePropertySource into a Properties object. |
|
static PropertySourceConversionResult |
convertEnumerablePropertySources(List<org.springframework.core.env.PropertySource<?>> sources)
Convert any PropertySources that extend EnumerablePropertySource into Properties object's |
|
static void |
debug(org.springframework.context.ApplicationContext ctx)
|
|
static boolean |
exists(org.springframework.core.env.Environment env,
String key)
Return true if the environment value for key is not null. |
|
static List<org.springframework.core.env.PropertySource<?>> |
extractPropertySourcesAndClose(org.springframework.context.ConfigurableApplicationContext context)
|
|
static
|
getAllBeans(org.springframework.context.ConfigurableApplicationContext ctx,
Class<T> type)
|
|
static
|
getAllBeans(List<String> locations,
Class<T> type)
|
|
static
|
getAllBeans(String location,
Class<T> type)
|
|
static Properties |
getAllEnumerableProperties(org.springframework.core.env.ConfigurableEnvironment env)
Examine ConfigurableEnvironment for PropertySource's that extend EnumerablePropertySource and aggregate them into a single
Properties object |
|
static boolean |
getBoolean(org.springframework.core.env.Environment env,
String key)
|
|
static boolean |
getBoolean(org.springframework.core.env.Environment env,
String key,
boolean defaultValue)
|
|
static long |
getBytes(org.springframework.core.env.Environment env,
String key)
Parse bytes from a size string that ends with a unit of measure. |
|
static long |
getBytes(org.springframework.core.env.Environment env,
String key,
String defaultValue)
Parse bytes from a size string that ends with a unit of measure. |
|
static org.springframework.context.ConfigurableApplicationContext |
getConfigurableApplicationContext()
|
|
static org.springframework.context.ConfigurableApplicationContext |
getContextWithPreRegisteredBean(String beanName,
Object bean)
|
|
static org.springframework.context.ConfigurableApplicationContext |
getContextWithPreRegisteredBeans(List<String> beanNames,
List<Object> beans)
|
|
static org.springframework.context.ConfigurableApplicationContext |
getContextWithPreRegisteredBeans(String id,
String displayName,
List<String> beanNames,
List<Object> beans)
|
|
static String |
getDefaultPropertyContextLocation(String gav)
Converts a GAV into Spring's classpath style notation for the default project properties context. |
|
static double |
getDouble(org.springframework.core.env.Environment env,
String key)
|
|
static double |
getDouble(org.springframework.core.env.Environment env,
String key,
double defaultValue)
|
|
static List<String> |
getExcludes(org.springframework.core.env.Environment env,
String key)
|
|
static List<String> |
getExcludes(org.springframework.core.env.Environment env,
String key,
String defaultValue)
|
|
static File |
getFile(org.springframework.core.env.Environment env,
String key)
|
|
static org.springframework.core.env.PropertySource<?> |
getGlobalPropertySource(List<String> locations,
String encoding)
Return a SpringContext that resolves all placeholders from the PropertySource passed in |
|
static org.springframework.core.env.PropertySource<?> |
getGlobalPropertySource(ProjectContext project,
List<ProjectContext> others)
project needs to be a top level project eg rice-sampleapp, olefs-webapp. |
|
static org.springframework.core.env.PropertySource<?> |
getGlobalPropertySource(ProjectContext project,
List<ProjectContext> others,
Properties properties)
project needs to be a top level project eg rice-sampleapp, olefs-webapp. |
|
static org.springframework.core.env.PropertySource<?> |
getGlobalPropertySource(ProjectContext project,
ProjectContext other)
project needs to be a top level project eg rice-sampleapp, olefs-webapp. |
|
static org.springframework.core.env.PropertySource<?> |
getGlobalPropertySource(ProjectContext context,
String... locations)
|
|
static org.springframework.core.env.PropertySource<?> |
getGlobalPropertySource(ProjectProperties project)
project needs to be a top level project eg rice-sampleapp, olefs-webapp. |
|
static org.springframework.core.env.PropertySource<?> |
getGlobalPropertySource(ProjectProperties project,
List<ProjectProperties> others)
project needs to be a top level project eg rice-sampleapp, olefs-webapp. |
|
static org.springframework.core.env.PropertySource<?> |
getGlobalPropertySource(String name,
List<ProjectProperties> pps)
|
|
static List<String> |
getIncludes(org.springframework.core.env.Environment env,
String key)
|
|
static List<String> |
getIncludes(org.springframework.core.env.Environment env,
String key,
String defaultValue)
|
|
static
|
getInstance(org.springframework.core.env.Environment env,
String key)
Given a property holding the name of a class, return an instance of that class |
|
static
|
getInstance(org.springframework.core.env.Environment env,
String key,
Class<T> defaultValue)
Given a property holding the name of a class, return an instance of that class |
|
static int |
getInteger(org.springframework.core.env.Environment env,
String key)
|
|
static int |
getInteger(org.springframework.core.env.Environment env,
String key,
int defaultValue)
|
|
static List<String> |
getListFromCSV(org.springframework.core.env.Environment env,
String key,
String defaultValue)
|
|
static long |
getLong(org.springframework.core.env.Environment env,
String key)
|
|
static long |
getLong(org.springframework.core.env.Environment env,
String key,
long defaultValue)
|
|
static long |
getMillis(org.springframework.core.env.Environment env,
String key,
String defaultValue)
Parse milliseconds from a time string that ends with a unit of measure. |
|
static String |
getProperty(org.springframework.core.env.Environment env,
String key)
Get a fully resolved property value from the environment. |
|
static String |
getProperty(org.springframework.core.env.Environment env,
String key,
String defaultValue)
Always return a fully resolved value. |
|
static org.springframework.core.env.PropertySource<?> |
getPropertySource(String name,
List<ProjectProperties> pps)
|
|
static List<org.springframework.core.env.PropertySource<?>> |
getPropertySources(Class<?> annotatedClass)
|
|
static List<org.springframework.core.env.PropertySource<?>> |
getPropertySources(Class<?> annotatedClass,
String propertiesBeanName,
Properties properties)
|
|
static List<org.springframework.core.env.PropertySource<?>> |
getPropertySources(org.springframework.context.ConfigurableApplicationContext context)
This method returns a list of any PropertySource objects registered in the indicated context. |
|
static List<org.springframework.core.env.PropertySource<?>> |
getPropertySources(org.springframework.context.ConfigurableApplicationContext context,
Comparator<org.springframework.core.env.PropertySource<?>> comparator)
This method returns a list of any PropertySource objects registered in the indicated context. |
|
static List<org.springframework.core.env.PropertySource<?>> |
getPropertySources(org.springframework.core.env.ConfigurableEnvironment env)
Get all PropertySource objects from the environment as a List. |
|
static List<org.springframework.core.env.PropertySource<?>> |
getPropertySources(SpringService service,
Class<?> annotatedClass,
String propertiesBeanName,
Properties properties)
Deprecated. |
|
static List<org.springframework.core.env.PropertySource<?>> |
getPropertySources(SpringService service,
String location,
String mavenPropertiesBeanName,
Properties mavenProperties)
Deprecated. |
|
static List<org.springframework.core.env.PropertySource<?>> |
getPropertySources(String location)
Scan the XML Spring context for any beans that implement PropertySource |
|
static List<org.springframework.core.env.PropertySource<?>> |
getPropertySources(String location,
String mavenPropertiesBeanName,
Properties mavenProperties)
|
|
static List<org.springframework.core.env.PropertySource<?>> |
getPropertySourcesFromAnnotatedClass(String annotatedClassName)
|
|
static org.springframework.core.env.PropertySource<?> |
getSinglePropertySource(Class<?> annotatedClass)
Scan the annotated class to find the single bean registered in the context that implements PropertySource. |
|
static org.springframework.core.env.PropertySource<?> |
getSinglePropertySource(Class<?> annotatedClass,
String propertiesBeanName,
Properties properties)
Scan the annotated class to find the single bean registered in the context that implements PropertySource. |
|
static SpringContext |
getSinglePropertySourceContext(List<String> locations,
String encoding)
Return a SpringContext that resolves all placeholders from the list of property locations passed in + System/Environment properties |
|
static SpringContext |
getSinglePropertySourceContext(ProjectContext context,
String location)
Return a SpringContext that resolves all placeholders from the list of property locations passed in + System/Environment properties |
|
static SpringContext |
getSinglePropertySourceContext(org.springframework.core.env.PropertySource<?> source)
Return a SpringContext that resolves all placeholders from the PropertySource passed in |
|
static SpringContext |
getSpringContext(Class<?> annotatedClass,
ProjectContext project,
List<ProjectContext> others)
|
|
static SpringContext |
getSpringContext(List<Class<?>> annotatedClasses,
ProjectContext project,
List<ProjectContext> others)
|
|
static Executable |
getSpringExecutable(org.springframework.core.env.Environment env,
boolean skip,
org.springframework.core.env.PropertySource<?> ps,
List<Class<?>> annotatedClasses)
|
|
static SpringExecutable |
getSpringExecutable(ProjectContext project,
String location,
Class<?> annotatedClass)
Return a SpringExecutable for the project, properties location, and config passed in. |
|
static SpringExecutable |
getSpringExecutable(ProjectContext project,
String location,
List<Class<?>> annotatedClasses)
Return a SpringExecutable for the project, properties location, and config passed in. |
|
static boolean |
isTrue(org.springframework.core.env.Environment env,
String property)
Return true if, and only if, property is set in the environment and evaluates to true. |
|
static void |
reconfigurePropertySources(org.springframework.core.env.ConfigurableEnvironment env,
String name,
Properties properties)
Remove any existing property sources and add one property source backed by the properties passed in |
|
static void |
refreshQuietly(org.springframework.context.ConfigurableApplicationContext context)
Null safe refresh for a context |
|
static void |
removeAllPropertySources(org.springframework.core.env.ConfigurableEnvironment env)
Remove any existing property sources |
|
static void |
showPropertySources(org.springframework.core.env.ConfigurableEnvironment env)
|
|
static void |
showPropertySources(List<org.springframework.core.env.PropertySource<?>> propertySources)
|
|
static void |
validateExists(List<String> locations)
Make sure all of the locations actually exist |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SpringUtils()
| Method Detail |
|---|
public static SpringContext getSpringContext(List<Class<?>> annotatedClasses,
ProjectContext project,
List<ProjectContext> others)
public static SpringContext getSpringContext(Class<?> annotatedClass,
ProjectContext project,
List<ProjectContext> others)
public static org.springframework.core.env.PropertySource<?> getGlobalPropertySource(ProjectContext project,
ProjectContext other)
project needs to be a top level project eg rice-sampleapp, olefs-webapp. others is projects for submodules organized into a list where the last one
in wins.
public static org.springframework.core.env.PropertySource<?> getGlobalPropertySource(ProjectContext project,
List<ProjectContext> others)
project needs to be a top level project eg rice-sampleapp, olefs-webapp. others is projects for submodules organized into a list where the last one
in wins.
public static org.springframework.core.env.PropertySource<?> getGlobalPropertySource(ProjectContext project,
List<ProjectContext> others,
Properties properties)
project needs to be a top level project eg rice-sampleapp, olefs-webapp. others is projects for submodules organized into a list where the last one
in wins.
public static org.springframework.core.env.PropertySource<?> getGlobalPropertySource(ProjectProperties project)
project needs to be a top level project eg rice-sampleapp, olefs-webapp. others is projects for submodules organized into a list where the last one
in wins.
public static org.springframework.core.env.PropertySource<?> getGlobalPropertySource(ProjectProperties project,
List<ProjectProperties> others)
project needs to be a top level project eg rice-sampleapp, olefs-webapp. others is projects for submodules organized into a list where the last one
in wins.
public static List<String> getIncludes(org.springframework.core.env.Environment env,
String key,
String defaultValue)
public static List<String> getIncludes(org.springframework.core.env.Environment env,
String key)
public static List<String> getExcludes(org.springframework.core.env.Environment env,
String key,
String defaultValue)
public static List<String> getExcludes(org.springframework.core.env.Environment env,
String key)
public static <T> T getInstance(org.springframework.core.env.Environment env,
String key,
Class<T> defaultValue)
public static <T> T getInstance(org.springframework.core.env.Environment env,
String key)
public static List<String> getListFromCSV(org.springframework.core.env.Environment env,
String key,
String defaultValue)
@Deprecated
public static List<org.springframework.core.env.PropertySource<?>> getPropertySources(SpringService service,
Class<?> annotatedClass,
String propertiesBeanName,
Properties properties)
public static org.springframework.core.env.PropertySource<?> getSinglePropertySource(Class<?> annotatedClass)
PropertySource. If more than one bean is located, throw
IllegalStateException.
public static org.springframework.core.env.PropertySource<?> getSinglePropertySource(Class<?> annotatedClass,
String propertiesBeanName,
Properties properties)
PropertySource. If more than one bean is located, throw
IllegalStateException.
public static List<org.springframework.core.env.PropertySource<?>> getPropertySources(Class<?> annotatedClass,
String propertiesBeanName,
Properties properties)
@Deprecated
public static List<org.springframework.core.env.PropertySource<?>> getPropertySources(SpringService service,
String location,
String mavenPropertiesBeanName,
Properties mavenProperties)
public static List<org.springframework.core.env.PropertySource<?>> getPropertySources(String location,
String mavenPropertiesBeanName,
Properties mavenProperties)
public static Executable getSpringExecutable(org.springframework.core.env.Environment env,
boolean skip,
org.springframework.core.env.PropertySource<?> ps,
List<Class<?>> annotatedClasses)
public static int getInteger(org.springframework.core.env.Environment env,
String key)
public static int getInteger(org.springframework.core.env.Environment env,
String key,
int defaultValue)
public static long getLong(org.springframework.core.env.Environment env,
String key)
public static long getLong(org.springframework.core.env.Environment env,
String key,
long defaultValue)
public static double getDouble(org.springframework.core.env.Environment env,
String key)
public static double getDouble(org.springframework.core.env.Environment env,
String key,
double defaultValue)
public static long getMillis(org.springframework.core.env.Environment env,
String key,
String defaultValue)
FormatUtils.getMillis(String time)
public static long getBytes(org.springframework.core.env.Environment env,
String key,
String defaultValue)
FormatUtils.getBytes(String size)
public static long getBytes(org.springframework.core.env.Environment env,
String key)
FormatUtils.getBytes(String size)
public static File getFile(org.springframework.core.env.Environment env,
String key)
public static boolean getBoolean(org.springframework.core.env.Environment env,
String key,
boolean defaultValue)
public static boolean getBoolean(org.springframework.core.env.Environment env,
String key)
public static org.springframework.core.env.PropertySource<?> getGlobalPropertySource(String name,
List<ProjectProperties> pps)
public static org.springframework.core.env.PropertySource<?> getGlobalPropertySource(List<String> locations,
String encoding)
public static SpringContext getSinglePropertySourceContext(ProjectContext context,
String location)
public static SpringExecutable getSpringExecutable(ProjectContext project,
String location,
List<Class<?>> annotatedClasses)
public static SpringExecutable getSpringExecutable(ProjectContext project,
String location,
Class<?> annotatedClass)
public static SpringContext getSinglePropertySourceContext(List<String> locations,
String encoding)
public static SpringContext getSinglePropertySourceContext(org.springframework.core.env.PropertySource<?> source)
public static org.springframework.core.env.PropertySource<?> getGlobalPropertySource(ProjectContext context,
String... locations)
public static org.springframework.core.env.PropertySource<?> getPropertySource(String name,
List<ProjectProperties> pps)
public static String getDefaultPropertyContextLocation(String gav)
org.kuali.common:kuali-jdbc -> classpath:org/kuali/common/kuali-jdbc-properties-context.xml
public static void validateExists(List<String> locations)
public static org.springframework.context.ConfigurableApplicationContext getContextWithPreRegisteredBeans(String id,
String displayName,
List<String> beanNames,
List<Object> beans)
public static org.springframework.context.ConfigurableApplicationContext getConfigurableApplicationContext()
public static org.springframework.context.ConfigurableApplicationContext getContextWithPreRegisteredBeans(List<String> beanNames,
List<Object> beans)
public static void refreshQuietly(org.springframework.context.ConfigurableApplicationContext context)
public static void closeQuietly(org.springframework.context.ConfigurableApplicationContext context)
public static org.springframework.context.ConfigurableApplicationContext getContextWithPreRegisteredBean(String beanName,
Object bean)
public static List<org.springframework.core.env.PropertySource<?>> getPropertySourcesFromAnnotatedClass(String annotatedClassName)
public static List<org.springframework.core.env.PropertySource<?>> getPropertySources(Class<?> annotatedClass)
public static List<org.springframework.core.env.PropertySource<?>> extractPropertySourcesAndClose(org.springframework.context.ConfigurableApplicationContext context)
public static List<org.springframework.core.env.PropertySource<?>> getPropertySources(String location)
PropertySource
public static List<org.springframework.core.env.PropertySource<?>> getPropertySources(org.springframework.context.ConfigurableApplicationContext context)
public static <T> Map<String,T> getAllBeans(List<String> locations,
Class<T> type)
public static <T> Map<String,T> getAllBeans(String location,
Class<T> type)
public static <T> Map<String,T> getAllBeans(org.springframework.context.ConfigurableApplicationContext ctx,
Class<T> type)
public static List<org.springframework.core.env.PropertySource<?>> getPropertySources(org.springframework.context.ConfigurableApplicationContext context,
Comparator<org.springframework.core.env.PropertySource<?>> comparator)
public static List<org.springframework.core.env.PropertySource<?>> asList(org.springframework.core.env.PropertySource<?>... sources)
public static void debug(org.springframework.context.ApplicationContext ctx)
public static void showPropertySources(List<org.springframework.core.env.PropertySource<?>> propertySources)
public static void showPropertySources(org.springframework.core.env.ConfigurableEnvironment env)
public static String getProperty(org.springframework.core.env.Environment env,
String key)
public static boolean exists(org.springframework.core.env.Environment env,
String key)
public static String getProperty(org.springframework.core.env.Environment env,
String key,
String defaultValue)
defaultValue if a value cannot be located in the environment. Throw an exception if the return value contains
unresolvable placeholders.
public static Properties getAllEnumerableProperties(org.springframework.core.env.ConfigurableEnvironment env)
ConfigurableEnvironment for PropertySource's that extend EnumerablePropertySource and aggregate them into a single
Properties object
public static void reconfigurePropertySources(org.springframework.core.env.ConfigurableEnvironment env,
String name,
Properties properties)
public static void removeAllPropertySources(org.springframework.core.env.ConfigurableEnvironment env)
public static List<org.springframework.core.env.PropertySource<?>> getPropertySources(org.springframework.core.env.ConfigurableEnvironment env)
public static PropertySourceConversionResult convertEnumerablePropertySources(List<org.springframework.core.env.PropertySource<?>> sources)
public static Properties convert(org.springframework.core.env.EnumerablePropertySource<?> source)
public static boolean isTrue(org.springframework.core.env.Environment env,
String property)
property is set in the environment and evaluates to true.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||