You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by nb...@apache.org on 2007/05/07 19:24:05 UTC
svn commit: r535935 -
/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java
Author: nbubna
Date: Mon May 7 10:24:04 2007
New Revision: 535935
URL: http://svn.apache.org/viewvc?view=rev&rev=535935
Log:
add <pre> tags to javadoc to maintain line breaks in code examples
Modified:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java
Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java?view=diff&rev=535935&r1=535934&r2=535935
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java Mon May 7 10:24:04 2007
@@ -43,20 +43,20 @@
* Note that 'repository.class' is not necessary;
* if not provided, the factory will fall back on using
* {@link StringResourceRepositoryImpl} as the default.
- *
+ * <pre>
* resource.loader = string
* string.resource.loader.description = Velocity StringResource loader
* string.resource.loader.class = org.apache.velocity.runtime.resource.loader.StringResourceLoader
* string.resource.loader.repository.class = org.apache.velocity.runtime.resource.loader.StringResourceRepositoryImpl
- *
+ * </pre>
* Resources can be added to the repository like this:
- * <code>
+ * <pre><code>
* StringResourceRepository repo = StringResourceLoader.getRepository();
*
* String myTemplateName = "/some/imaginary/path/hello.vm";
* String myTemplate = "Hi, ${username}... this is some template!";
* repo.putStringResource(myTemplateName, myTemplate);
- * </code>
+ * </code></pre>
*
* After this, the templates can be retrieved as usual.
* <br>
@@ -66,9 +66,9 @@
* This can help to avoid conflicts between different frameworks or components
* that are using StringResourceLoader.
* You can then retrieve your named repository like this:
- * <code>
+ * <pre><code>
* StringResourceRepository repo = StringResourceLoader.getRepository("foo");
- * </code>
+ * </code></pre>
* and add string resources to the repo just as in the previous example.
* </p>
* <p>If you have concerns about memory leaks or for whatever reason do not wish
@@ -76,9 +76,9 @@
* should set 'string.resource.loader.repository.static = false' in your properties.
* This will tell the resource loader that the string repository should be stored
* in the Velocity application attributes. To retrieve the repository, do:
- * <code>
+ * <pre><code>
* StringResourceRepository repo = velocityEngine.getApplicationAttribute("foo");
- * </code>
+ * </code></pre>
* If you did not specify a name for the repository, then it will be stored under the
* class name of the repository implementation class (for which the default is
* 'org.apache.velocity.runtime.resource.util.StringResourceRepositoryImpl').
@@ -87,17 +87,17 @@
* <p>Whether your repository is stored statically or in Velocity's application
* attributes, you can also manually create and set it prior to Velocity
* initialization. For a static repository, you can do something like this:
- * <code>
+ * <pre><code>
* StringResourceRepository repo = new MyStringResourceRepository();
* repo.magicallyAddSomeStringResources();
* StringResourceLoader.setRepository("foo", repo);
- * </code>
+ * </code></pre>
* Or for a non-static repository:
- * <code>
+ * <pre><code>
* StringResourceRepository repo = new MyStringResourceRepository();
* repo.magicallyAddSomeStringResources();
* velocityEngine.setApplicationAttribute("foo", repo);
- * </code>
+ * </code></pre>
* Then, assuming the 'string.resource.loader.repository.name' property is
* set to 'some.name', the StringResourceLoader will use that already created
* repository, rather than creating a new one.