-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
184 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,78 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
* Copyright (c) 2012-2017, jcabi.com | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: 1) Redistributions of source code must retain the above | ||
* copyright notice, this list of conditions and the following | ||
* disclaimer. 2) Redistributions in binary form must reproduce the above | ||
* copyright notice, this list of conditions and the following | ||
* disclaimer in the documentation and/or other materials provided | ||
* with the distribution. 3) Neither the name of the jcabi.com nor | ||
* the names of its contributors may be used to endorse or promote | ||
* products derived from this software without specific prior written | ||
* permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT | ||
* NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL | ||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | ||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
* OF THE POSSIBILITY OF SUCH DAMAGE. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.jcabi</groupId> | ||
<artifactId>jcabi</artifactId> | ||
<version>1.18</version> | ||
</parent> | ||
<artifactId>jcabi-velocity</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
<name>jcabi-velocity</name> | ||
<description>Wrapper of Apache Velocity</description> | ||
<issueManagement> | ||
<system>github</system> | ||
<url>https://github.com/jcabi/jcabi-velocity/issues</url> | ||
</issueManagement> | ||
<ciManagement> | ||
<system>travis</system> | ||
<url>https://travis-ci.org/jcabi/jcabi-velocity</url> | ||
</ciManagement> | ||
<scm> | ||
<connection>scm:git:github.com:jcabi/jcabi-velocity.git</connection> | ||
<developerConnection>scm:git:github.com:jcabi/jcabi-velocity.git</developerConnection> | ||
<url>https://github.com/jcabi/jcabi-velocity</url> | ||
</scm> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.jcabi</groupId> | ||
<artifactId>jcabi-aspects</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.validation</groupId> | ||
<artifactId>validation-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.aspectj</groupId> | ||
<artifactId>aspectjrt</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<!-- | ||
Copyright (c) 2012-2023, jcabi.com | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions | ||
are met: 1) Redistributions of source code must retain the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer. 2) Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided | ||
with the distribution. 3) Neither the name of the jcabi.com nor | ||
the names of its contributors may be used to endorse or promote | ||
products derived from this software without specific prior written | ||
permission. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT | ||
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL | ||
THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | ||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
OF THE POSSIBILITY OF SUCH DAMAGE. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.jcabi</groupId> | ||
<artifactId>jcabi</artifactId> | ||
<version>1.37.1</version> | ||
</parent> | ||
<artifactId>jcabi-velocity</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
<name>jcabi-velocity</name> | ||
<description>Wrapper of Apache Velocity</description> | ||
<issueManagement> | ||
<system>github</system> | ||
<url>https://github.com/jcabi/jcabi-velocity/issues</url> | ||
</issueManagement> | ||
<ciManagement> | ||
<system>travis</system> | ||
<url>https://travis-ci.org/jcabi/jcabi-velocity</url> | ||
</ciManagement> | ||
<scm> | ||
<connection>scm:git:github.com:jcabi/jcabi-velocity.git</connection> | ||
<developerConnection>scm:git:github.com:jcabi/jcabi-velocity.git</developerConnection> | ||
<url>https://github.com/jcabi/jcabi-velocity</url> | ||
</scm> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
<version>1.18.30</version> | ||
</dependency> | ||
<dependency> | ||
<!-- | ||
Apache Velocity, text formatting tool | ||
@see http://velocity.apache.org/ | ||
--> | ||
<groupId>org.apache.velocity</groupId> | ||
<artifactId>velocity</artifactId> | ||
<version>1.7</version> | ||
</dependency> | ||
</dependencies> | ||
<groupId>org.apache.velocity</groupId> | ||
<artifactId>velocity</artifactId> | ||
<version>1.7</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.jcabi</groupId> | ||
<artifactId>jcabi-log</artifactId> | ||
<version>0.22.0</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,36 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
* | ||
* Copyright (c) 2012-2017, jcabi.com | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: 1) Redistributions of source code must retain the above | ||
* copyright notice, this list of conditions and the following | ||
* disclaimer. 2) Redistributions in binary form must reproduce the above | ||
* copyright notice, this list of conditions and the following | ||
* disclaimer in the documentation and/or other materials provided | ||
* with the distribution. 3) Neither the name of the jcabi.com nor | ||
* the names of its contributors may be used to endorse or promote | ||
* products derived from this software without specific prior written | ||
* permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT | ||
* NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL | ||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | ||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
* OF THE POSSIBILITY OF SUCH DAMAGE. | ||
--> | ||
Copyright (c) 2012-2023, jcabi.com | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions | ||
are met: 1) Redistributions of source code must retain the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer. 2) Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided | ||
with the distribution. 3) Neither the name of the jcabi.com nor | ||
the names of its contributors may be used to endorse or promote | ||
products derived from this software without specific prior written | ||
permission. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT | ||
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL | ||
THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | ||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
OF THE POSSIBILITY OF SUCH DAMAGE. | ||
--> | ||
<document xmlns="http://maven.apache.org/changes/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/xsd/changes-1.0.0.xsd"> | ||
<body> | ||
<release version="0.8" date="4 Sep 2013" description="migrated to its own repo in Github"/> | ||
<release version="0.1.6" date="13 May 2012" description="first release"/> | ||
</body> | ||
<body> | ||
<release version="0.8" date="4 Sep 2013" description="migrated to its own repo in Github"/> | ||
<release version="0.1.6" date="13 May 2012" description="first release"/> | ||
</body> | ||
</document> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
* Copyright (c) 2012-2017, jcabi.com | ||
/* | ||
* Copyright (c) 2012-2023, jcabi.com | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -32,7 +32,6 @@ | |
import java.io.PrintWriter; | ||
import java.io.StringWriter; | ||
import java.util.Map; | ||
import javax.validation.constraints.NotNull; | ||
import org.apache.velocity.Template; | ||
import org.apache.velocity.VelocityContext; | ||
import org.apache.velocity.app.VelocityEngine; | ||
|
@@ -53,12 +52,10 @@ | |
* | ||
* <p>The class is mutable and thread-safe. | ||
* | ||
* @author Yegor Bugayenko ([email protected]) | ||
* @version $Id$ | ||
* @since 0.1.6 | ||
* @see <a href="http://velocity.apache.org/engine/releases/velocity-1.7/user-guide.html">Velocity User Guide</a> | ||
* @see <a href="http://velocity.apache.org/engine/releases/velocity-1.7/developer-guide.html">Velocity Developer Guide</a> | ||
* @see <a href="http://velocity.apache.org/engine/devel/apidocs/org/apache/velocity/slf4j/Slf4jLogChute.html">Slf4jLogChute</a> | ||
* @since 0.1.6 | ||
*/ | ||
public final class VelocityPage { | ||
|
||
|
@@ -75,15 +72,16 @@ public final class VelocityPage { | |
/** | ||
* The context. | ||
*/ | ||
private final transient VelocityContext context = new VelocityContext(); | ||
private final transient VelocityContext context; | ||
|
||
/** | ||
* Public ctor, with absolute resource name in classpath. | ||
* @param res Name of resource with template (absolute resource name in | ||
* classpath) | ||
*/ | ||
public VelocityPage(@NotNull final String res) { | ||
public VelocityPage(final String res) { | ||
this.name = res; | ||
this.context = new VelocityContext(); | ||
} | ||
|
||
/** | ||
|
@@ -92,7 +90,7 @@ public VelocityPage(@NotNull final String res) { | |
* @param value The value to use | ||
* @return This object | ||
*/ | ||
public VelocityPage set(@NotNull final String prop, final Object value) { | ||
public VelocityPage set(final String prop, final Object value) { | ||
synchronized (this.context) { | ||
this.context.put(prop, value); | ||
} | ||
|
@@ -105,7 +103,7 @@ public VelocityPage set(@NotNull final String prop, final Object value) { | |
* @return This object | ||
* @since 0.8 | ||
*/ | ||
public VelocityPage set(@NotNull final Map<String, Object> args) { | ||
public VelocityPage set(final Map<String, Object> args) { | ||
synchronized (this.context) { | ||
for (final Map.Entry<String, Object> entry : args.entrySet()) { | ||
this.context.put(entry.getKey(), entry.getValue()); | ||
|
@@ -114,9 +112,6 @@ public VelocityPage set(@NotNull final Map<String, Object> args) { | |
return this; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public String toString() { | ||
final Template template = | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
* Copyright (c) 2012-2017, jcabi.com | ||
/* | ||
* Copyright (c) 2012-2023, jcabi.com | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -34,14 +34,12 @@ | |
* <p>The only dependency you need is (check our latest version available | ||
* at <a href="http://www.jcabi.com">www.jcabi.com</a>): | ||
* | ||
* <pre><depedency> | ||
* <pre><dependency> | ||
* <groupId>com.jcabi</groupId> | ||
* <artifactId>jcabi-velocity</artifactId> | ||
* </dependency></pre> | ||
* | ||
* @author Yegor Bugayenko ([email protected]) | ||
* @version $Id$ | ||
* @since 0.1.6 | ||
* @see <a href="http://www.jcabi.com/jcabi-velocity">project website</a> | ||
* @since 0.1.6 | ||
*/ | ||
package com.jcabi.velocity; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.