diff --git a/spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java b/spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java index 5d83f98bdaa..d65e05058a7 100644 --- a/spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java +++ b/spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java @@ -53,6 +53,7 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life * Name of the ConversionService bean in the factory. * If none is supplied, default conversion rules apply. * @see org.springframework.core.convert.ConversionService + * @since 3.0 */ String CONVERSION_SERVICE_BEAN_NAME = "conversionService"; @@ -60,12 +61,14 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life * Name of the LoadTimeWeaver bean in the factory. If such a bean is supplied, * the context will use a temporary ClassLoader for type matching, in order * to allow the LoadTimeWeaver to process all actual bean classes. + * @since 2.5 * @see org.springframework.instrument.classloading.LoadTimeWeaver */ String LOAD_TIME_WEAVER_BEAN_NAME = "loadTimeWeaver"; /** * Name of the {@link Environment} bean in the factory. + * @since 3.1 */ String ENVIRONMENT_BEAN_NAME = "environment"; @@ -84,6 +87,7 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life /** * Set the unique id of this application context. + * @since 3.0 */ void setId(String id); @@ -99,12 +103,14 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life /** * Return the Environment for this application context in configurable form. + * @since 3.1 */ ConfigurableEnvironment getEnvironment(); /** * Set the {@code Environment} for this application context. * @param environment the new environment + * @since 3.1 */ void setEnvironment(ConfigurableEnvironment environment); diff --git a/spring-core/src/main/java/org/springframework/core/env/ConfigurableEnvironment.java b/spring-core/src/main/java/org/springframework/core/env/ConfigurableEnvironment.java index 9e7cb58e7d2..5ba0763ac56 100644 --- a/spring-core/src/main/java/org/springframework/core/env/ConfigurableEnvironment.java +++ b/spring-core/src/main/java/org/springframework/core/env/ConfigurableEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,24 +35,24 @@ import java.util.Map; * *

Example: adding a new property source with highest search priority

*
- *   ConfigurableEnvironment environment = new StandardEnvironment();
- *   MutablePropertySources propertySources = environment.getPropertySources();
- *   Map myMap = new HashMap();
- *   myMap.put("xyz", "myValue");
- *   propertySources.addFirst(new MapPropertySource("MY_MAP", myMap));
+ * ConfigurableEnvironment environment = new StandardEnvironment();
+ * MutablePropertySources propertySources = environment.getPropertySources();
+ * Map myMap = new HashMap();
+ * myMap.put("xyz", "myValue");
+ * propertySources.addFirst(new MapPropertySource("MY_MAP", myMap));
  * 
* *

Example: removing the default system properties property source

*
- *   MutablePropertySources propertySources = environment.getPropertySources();
- *   propertySources.remove(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME)
+ * MutablePropertySources propertySources = environment.getPropertySources();
+ * propertySources.remove(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME)
  * 
* *

Example: mocking the system environment for testing purposes

*
- *   MutablePropertySources propertySources = environment.getPropertySources();
- *   MockPropertySource mockEnvVars = new MockPropertySource().withProperty("xyz", "myValue");
- *   propertySources.replace(StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, mockEnvVars);
+ * MutablePropertySources propertySources = environment.getPropertySources();
+ * MockPropertySource mockEnvVars = new MockPropertySource().withProperty("xyz", "myValue");
+ * propertySources.replace(StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, mockEnvVars);
  * 
* * When an {@link Environment} is being used by an {@code ApplicationContext}, it is @@ -64,7 +64,6 @@ import java.util.Map; * org.springframework.context.support.PropertySourcesPlaceholderConfigurer property * placeholder configurers}. * - * * @author Chris Beams * @since 3.1 * @see StandardEnvironment diff --git a/spring-core/src/main/java/org/springframework/core/env/Environment.java b/spring-core/src/main/java/org/springframework/core/env/Environment.java index 17767732f91..52c8717e94e 100644 --- a/spring-core/src/main/java/org/springframework/core/env/Environment.java +++ b/spring-core/src/main/java/org/springframework/core/env/Environment.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,8 +77,8 @@ public interface Environment extends PropertyResolver { * activated by setting {@linkplain AbstractEnvironment#ACTIVE_PROFILES_PROPERTY_NAME * "spring.profiles.active"} as a system property or by calling * {@link ConfigurableEnvironment#setActiveProfiles(String...)}. - *

If no profiles have explicitly been specified as active, then any {@linkplain - * #getDefaultProfiles() default profiles} will automatically be activated. + *

If no profiles have explicitly been specified as active, then any + * {@linkplain #getDefaultProfiles() default profiles} will automatically be activated. * @see #getDefaultProfiles * @see ConfigurableEnvironment#setActiveProfiles * @see AbstractEnvironment#ACTIVE_PROFILES_PROPERTY_NAME diff --git a/spring-oxm/src/main/java/org/springframework/oxm/xstream/CatchAllConverter.java b/spring-oxm/src/main/java/org/springframework/oxm/xstream/CatchAllConverter.java index 94bb1998dce..f8a8854ea37 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/xstream/CatchAllConverter.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/xstream/CatchAllConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,23 +25,25 @@ import com.thoughtworks.xstream.io.HierarchicalStreamWriter; /** * XStream {@link Converter} that supports all classes, but throws exceptions for * (un)marshalling. - *

Main purpose of this class is to + * + *

The main purpose of this class is to * {@linkplain com.thoughtworks.xstream.XStream#registerConverter(com.thoughtworks.xstream.converters.Converter, int) register} - * this converter as a catchall last converter with a + * this converter as a catch-all last converter with a * {@linkplain com.thoughtworks.xstream.XStream#PRIORITY_NORMAL normal} - * or higher priority, in addition to converters that explicitly support the domain - * classes that should be supported. As a result, default XStream converters with lower - * priorities and possible security vulnerabilities do not get invoked. - *

For instance:

+ * or higher priority, in addition to converters that explicitly handle the domain + * classes that should be supported. As a result, default XStream converters with + * lower priorities and possible security vulnerabilities do not get invoked. + * + *

For instance: *

  * XStreamMarshaller unmarshaller = new XStreamMarshaller();
  * unmarshaller.getXStream().registerConverter(new MyDomainClassConverter(), XStream.PRIORITY_VERY_HIGH);
  * unmarshaller.getXStream().registerConverter(new CatchAllConverter(), XStream.PRIORITY_NORMAL);
- * MyDomainClass o = unmarshaller.unmarshal(source);
+ * MyDomainClass myObject = unmarshaller.unmarshal(source);
  *