#8 code formatting
This commit is contained in:
@@ -3922,7 +3922,7 @@ public sealed class Font : MarshalByRefObject, ICloneable, ISerializable, IDispo
|
||||
|
||||
<para><programlisting language="myxml"><object id="exampleInitObject" type="Examples.ExampleObject" init-method="init"/></programlisting></para>
|
||||
|
||||
<para> <programlisting language="csharp">[C#]
|
||||
<para><programlisting language="csharp">[C#]
|
||||
public class ExampleObject
|
||||
{
|
||||
public void Init()
|
||||
@@ -4741,10 +4741,10 @@ cfg.PostProcessObjectFactory(factory);</programlisting></para>
|
||||
with a database connection and also a value for the maximum number of
|
||||
results to return in a query. Instead of hard coding the values into
|
||||
the main Spring.NET configuration file we use place holders, in the
|
||||
NAnt style of ${variableName}, and obtain their values from
|
||||
NameValueSections in the standard .NET application configuration file.
|
||||
The Spring.NET configuration file looks like: <programlisting
|
||||
language="myxml"><configuration>
|
||||
NAnt style of <literal>${variableName}</literal>, and obtain their
|
||||
values from <literal>NameValueSections</literal> in the standard .NET
|
||||
application configuration file. The Spring.NET configuration file
|
||||
looks like: <programlisting language="myxml"><configuration>
|
||||
|
||||
<configSections>
|
||||
<sectionGroup name="spring">
|
||||
@@ -4770,9 +4770,9 @@ cfg.PostProcessObjectFactory(factory);</programlisting></para>
|
||||
|
||||
</configuration></programlisting></para>
|
||||
|
||||
<para>Notice the presence of two NameValueSections in the
|
||||
configuration file. These name value pairs will be referred to in the
|
||||
Spring.NET configuration file. In this example we are using an
|
||||
<para>Notice the presence of two <literal>NameValueSection</literal>s
|
||||
in the configuration file. These name value pairs will be referred to
|
||||
in the Spring.NET configuration file. In this example we are using an
|
||||
embedded assembly resource for the location of the Spring.NET
|
||||
configuration file so as to reduce the chance of accidental tampering
|
||||
in deployment. This Spring.NET configuration file is shown
|
||||
@@ -4783,29 +4783,29 @@ cfg.PostProcessObjectFactory(factory);</programlisting></para>
|
||||
xsi:schemaLocation="http://www.springframework.net
|
||||
http://www.springframework.net/xsd/spring-objects.xsd" >
|
||||
|
||||
<object name="productDao" type="DaoApp.SimpleProductDao, DaoApp ">
|
||||
<property name="maxResults" value="${maxResults}"/>
|
||||
<property name="dbConnection" ref="myConnection"/>
|
||||
</object>
|
||||
|
||||
<object name="myConnection" type="System.Data.Odbc.OdbcConnection, System.Data">
|
||||
<property name="connectionstring" value="${connection.string}"/>
|
||||
</object>
|
||||
<object name="productDao" type="DaoApp.SimpleProductDao, DaoApp ">
|
||||
<property name="maxResults" value="${maxResults}"/>
|
||||
<property name="dbConnection" ref="myConnection"/>
|
||||
</object>
|
||||
|
||||
<object name="myConnection" type="System.Data.Odbc.OdbcConnection, System.Data">
|
||||
<property name="connectionstring" value="${connection.string}"/>
|
||||
</object>
|
||||
|
||||
<object name="appConfigPropertyHolder"
|
||||
type="Spring.Objects.Factory.Config.PropertyPlaceholderConfigurer, Spring.Core">
|
||||
<object name="appConfigPropertyHolder"
|
||||
type="Spring.Objects.Factory.Config.PropertyPlaceholderConfigurer, Spring.Core">
|
||||
<property name="configSections">
|
||||
<value>DaoConfiguration,DatabaseConfiguration</value>
|
||||
</property>
|
||||
</object>
|
||||
|
||||
<property name="configSections">
|
||||
<value>DaoConfiguration,DatabaseConfiguration</value>
|
||||
</property>
|
||||
|
||||
</object>
|
||||
</objects></programlisting>
|
||||
|
||||
<para>The values of <literal>${maxResults}</literal> and
|
||||
<literal>${connection.string}</literal> match the key names used in
|
||||
the two NameValueSectionHandlers <literal>DaoConfiguration</literal>
|
||||
and <literal>DatabaseConfiguration</literal>. The
|
||||
the two <literal>NameValueSectionHandler</literal>s
|
||||
<literal>DaoConfiguration</literal> and
|
||||
<literal>DatabaseConfiguration</literal>. The
|
||||
<literal>PropertyPlaceholderConfigurer</literal> refers to these two
|
||||
sections via a comma delimited list of section names in the
|
||||
<literal>configSections</literal> property. If you are using section
|
||||
@@ -4846,8 +4846,10 @@ cfg.PostProcessObjectFactory(factory);</programlisting></para>
|
||||
|
||||
<para>If the class is unable to be resolved at runtime to a valid
|
||||
type, resolution of the object will fail once it is about to be
|
||||
created (which is during the PreInstantiateSingletons() phase of an
|
||||
ApplicationContext for a non-lazy-init object.)</para>
|
||||
created (which is during the
|
||||
<literal>PreInstantiateSingletons()</literal> phase of an
|
||||
<literal>ApplicationContext</literal> for a non-lazy-init
|
||||
object.)</para>
|
||||
|
||||
<para>Similarly you can replace 'ref' and 'expression' metadata, as
|
||||
shown below</para>
|
||||
@@ -4961,14 +4963,14 @@ cfg.PostProcessObjectFactory(factory);</programlisting></para>
|
||||
<sect3 xml:id="objects-variablesource">
|
||||
<title>IVariableSource</title>
|
||||
|
||||
<para>The IVariableSource is the base interface for providing the
|
||||
ability to get the value of property placeholders (name-value) pairs
|
||||
from a variety of sources. Out of the box, Spring.NET supports a
|
||||
number of variable sources that allow users to obtain variable values
|
||||
from .NET config files, java-style property files, environment
|
||||
variables, command line arguments and the registry and the new
|
||||
connection strings configuration section in .NET 2.0. The list of
|
||||
implementing classes is listed below. Please refer to the SDK
|
||||
<para>The <literal>IVariableSource</literal> is the base interface for
|
||||
providing the ability to get the value of property placeholders
|
||||
(name-value) pairs from a variety of sources. Out of the box,
|
||||
Spring.NET supports a number of variable sources that allow users to
|
||||
obtain variable values from .NET config files, java-style property
|
||||
files, environment variables, command line arguments and the registry
|
||||
and the new connection strings configuration section in .NET 2.0. The
|
||||
list of implementing classes is listed below. Please refer to the SDK
|
||||
documentation for more information.</para>
|
||||
|
||||
<itemizedlist>
|
||||
@@ -5015,17 +5017,17 @@ cfg.PostProcessObjectFactory(factory);</programlisting></para>
|
||||
property defined in multiple <literal>IVariableSource</literal>
|
||||
implementations, the first one in the list that contains the property
|
||||
value will be used. <programlisting language="myxml"><object type="Spring.Objects.Factory.Config.VariablePlaceholderConfigurer, Spring.Core">
|
||||
<property name="VariableSources">
|
||||
<list>
|
||||
<object type="Spring.Objects.Factory.Config.PropertyFileVariableSource, Spring.Core">
|
||||
<property name="Location" value="~\application.properties" />
|
||||
<property name="IgnoreMissingResources" value="true"/>
|
||||
</object>
|
||||
<object type="Spring.Objects.Factory.Config.ConfigSectionVariableSource, Spring.Core">
|
||||
<property name="SectionNames" value="CryptedConfiguration" />
|
||||
</object>
|
||||
</list>
|
||||
</property>
|
||||
<property name="VariableSources">
|
||||
<list>
|
||||
<object type="Spring.Objects.Factory.Config.PropertyFileVariableSource, Spring.Core">
|
||||
<property name="Location" value="~\application.properties" />
|
||||
<property name="IgnoreMissingResources" value="true"/>
|
||||
</object>
|
||||
<object type="Spring.Objects.Factory.Config.ConfigSectionVariableSource, Spring.Core">
|
||||
<property name="SectionNames" value="CryptedConfiguration" />
|
||||
</object>
|
||||
</list>
|
||||
</property>
|
||||
</object>
|
||||
</programlisting><note>
|
||||
<para>The use of the <property>IgnoreMissingResources</property>
|
||||
|
||||
Reference in New Issue
Block a user