You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by he...@apache.org on 2006/09/19 23:00:26 UTC
svn commit: r447969 [6/10] - in /jakarta/velocity/engine/trunk: ./ build/
build/xsl/ examples/anakia/build/ examples/anakia/xdocs/
examples/anakia/xdocs/about/ examples/anakia/xdocs/stylesheets/
examples/app_example1/ examples/app_example2/ examples/co...
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/MathUtils.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/MathUtils.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/MathUtils.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/MathUtils.java Tue Sep 19 14:00:14 2006
@@ -90,7 +90,7 @@
/**
* Convert the given Number to a BigDecimal
- * @param n
+ * @param n
* @return The number as BigDecimal
*/
public static BigDecimal toBigDecimal (Number n)
@@ -112,7 +112,7 @@
/**
* Convert the given Number to a BigInteger
- * @param n
+ * @param n
* @return The number as BigInteger
*/
public static BigInteger toBigInteger (Number n)
@@ -129,7 +129,7 @@
/**
* Compare the given Number to 0.
- * @param n
+ * @param n
* @return True if number is 0.
*/
public static boolean isZero (Number n)
@@ -156,7 +156,7 @@
/**
* Test, whether the given object is an integer value
* (Byte, Short, Integer, Long, BigInteger)
- * @param n
+ * @param n
* @return True if n is an integer.
*/
public static boolean isInteger (Number n)
@@ -167,8 +167,8 @@
/**
* Wrap the given primitive into the given class if the value is in the
* range of the destination type. If not the next bigger type will be chosen.
- * @param value
- * @param type
+ * @param value
+ * @param type
* @return Number object representing the primitive.
*/
public static Number wrapPrimitive (long value, Class type)
@@ -262,8 +262,8 @@
/**
* Add two numbers and return the correct value / type.
* Overflow detection is done for integer values (byte, short, int, long) only!
- * @param op1
- * @param op2
+ * @param op1
+ * @param op2
* @return Addition result.
*/
public static Number add (Number op1, Number op2)
@@ -299,8 +299,8 @@
/**
* Subtract two numbers and return the correct value / type.
* Overflow detection is done for integer values (byte, short, int, long) only!
- * @param op1
- * @param op2
+ * @param op1
+ * @param op2
* @return Subtraction result.
*/
public static Number subtract (Number op1, Number op2) {
@@ -333,8 +333,8 @@
/**
* Multiply two numbers and return the correct value / type.
* Overflow detection is done for integer values (byte, short, int, long) only!
- * @param op1
- * @param op2
+ * @param op1
+ * @param op2
* @return Multiplication result.
*/
public static Number multiply (Number op1, Number op2) {
@@ -368,8 +368,8 @@
* Divide two numbers. The result will be returned as Integer-type if and only if
* both sides of the division operator are Integer-types. Otherwise a Float, Double,
* or BigDecimal will be returned.
- * @param op1
- * @param op2
+ * @param op1
+ * @param op2
* @return Division result.
*/
public static Number divide (Number op1, Number op2) {
@@ -399,8 +399,8 @@
/**
* Modulo two numbers.
- * @param op1
- * @param op2
+ * @param op1
+ * @param op2
* @return Modulo result.
*
* @throws ArithmeticException If at least one parameter is a BigDecimal
@@ -426,8 +426,8 @@
/**
* Compare two numbers.
- * @param op1
- * @param op2
+ * @param op1
+ * @param op2
* @return 1 if n1 > n2, -1 if n1 < n2 and 0 if equal.
*/
public static int compare (Number op1, Number op2) {
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/Node.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/Node.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/Node.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/Node.java Tue Sep 19 14:00:14 2006
@@ -29,7 +29,7 @@
/**
* This file describes the interface between the Velocity code
- * and the JavaCC generated code.
+ * and the JavaCC generated code.
*
* @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
* @version $Id$
@@ -47,7 +47,7 @@
/**
* This pair of methods are used to inform the node of its
- * parent.
+ * parent.
* @param n
* */
public void jjtSetParent(Node n);
@@ -57,18 +57,18 @@
*/
public Node jjtGetParent();
- /**
+ /**
* This method tells the node to add its argument to the node's
- * list of children.
- * @param n
+ * list of children.
+ * @param n
* @param i
*/
public void jjtAddChild(Node n, int i);
/**
* This method returns a child node. The children are numbered
- * from zero, left to right.
- * @param i
+ * from zero, left to right.
+ * @param i
* @return A child node.
*/
public Node jjtGetChild(int i);
@@ -88,18 +88,18 @@
/*
* ========================================================================
- *
+ *
* The following methods are not generated automatically be the Parser but
- * added manually to be used by Velocity.
+ * added manually to be used by Velocity.
*
* ========================================================================
*/
/**
* @see #jjtAccept(ParserVisitor, Object)
- * @param visitor
- * @param data
- * @return The node execution result.
+ * @param visitor
+ * @param data
+ * @return The node execution result.
*/
public Object childrenAccept(ParserVisitor visitor, Object data);
@@ -177,7 +177,7 @@
public String literal();
/**
- * Mark the node as invalid.
+ * Mark the node as invalid.
*/
public void setInvalid();
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/NodeUtils.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/NodeUtils.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/NodeUtils.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/NodeUtils.java Tue Sep 19 14:00:14 2006
@@ -36,18 +36,18 @@
* In some cases you may want to retrieve these
* special tokens, this is simply a way to
* extract them.
- * @param t
+ * @param t
* @return String with the special tokens.
*/
public static String specialText(Token t)
{
StringBuffer specialText = new StringBuffer();
-
+
if (t.specialToken == null || t.specialToken.image.startsWith("##") )
{
return "";
}
-
+
Token tmp_t = t.specialToken;
while (tmp_t.specialToken != null)
@@ -72,7 +72,7 @@
/*
* more dreaded MORE hack :)
- *
+ *
* looking for ("\\")*"$" sequences
*/
@@ -85,7 +85,7 @@
for( ok = true; ok && j < st.length(); j++)
{
char cc = st.charAt( j );
-
+
if (cc == '\\')
{
/*
@@ -118,27 +118,27 @@
}
}
}
-
+
// This is a potential JDK 1.3/JDK 1.4 gotcha. If we remove
// the toString() method call, then when compiling under JDK 1.4,
// this will be mapped to StringBuffer.append(StringBuffer) and
// under JDK 1.3, it will be mapped to StringBuffer.append(Object).
// So the JDK 1.4 compiled jar will bomb out under JDK 1.3 with a
- // MethodNotFound error.
+ // MethodNotFound error.
//
// @todo Once we are JDK 1.4+ only, remove the toString(), make this
// loop perform a little bit better.
specialText.append(sb.toString());
tmp_t = tmp_t.next;
- }
+ }
return specialText.toString();
}
-
+
/**
* complete node literal
- * @param t
+ * @param t
* @return A node literal.
*
*/
@@ -146,7 +146,7 @@
{
return specialText( t ) + t.image;
}
-
+
/**
* Utility method to interpolate context variables
* into string literals. So that the following will
@@ -158,10 +158,10 @@
* And the string literal argument will
* be transformed into "candy.jpg" before
* the method is executed.
- * @param argStr
- * @param vars
+ * @param argStr
+ * @param vars
* @return Interpoliation result.
- * @throws MethodInvocationException
+ * @throws MethodInvocationException
*/
public static String interpolate(String argStr, Context vars) throws MethodInvocationException
{
@@ -178,11 +178,11 @@
for (++cIdx ; cIdx < argStr.length(); ++cIdx)
{
ch = argStr.charAt(cIdx);
- if (ch == '_' || ch == '-'
+ if (ch == '_' || ch == '-'
|| Character.isLetterOrDigit(ch))
nameBuf.append(ch);
else if (ch == '{' || ch == '}')
- continue;
+ continue;
else
break;
}
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/PropertyExecutor.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/PropertyExecutor.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/PropertyExecutor.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/PropertyExecutor.java Tue Sep 19 14:00:14 2006
@@ -52,10 +52,10 @@
}
/**
- * @param r
- * @param introspector
- * @param clazz
- * @param property
+ * @param r
+ * @param introspector
+ * @param clazz
+ * @param property
* @deprecated RuntimeLogger is deprecated. Use the other constructor.
*/
public PropertyExecutor(final RuntimeLogger r, final Introspector introspector,
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/SetExecutor.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/SetExecutor.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/SetExecutor.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/SetExecutor.java Tue Sep 19 14:00:14 2006
@@ -39,19 +39,19 @@
{
/** Class logger */
protected Log log = null;
-
+
/**
* Method to be executed.
*/
private Method method = null;
-
+
/**
* Execute method against context.
- * @param o
- * @param value
+ * @param o
+ * @param value
* @return The result of the invocation.
- * @throws IllegalAccessException
- * @throws InvocationTargetException
+ * @throws IllegalAccessException
+ * @throws InvocationTargetException
*/
public abstract Object execute(Object o, Object value)
throws IllegalAccessException, InvocationTargetException;
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/SetPropertyExecutor.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/SetPropertyExecutor.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/SetPropertyExecutor.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/SetPropertyExecutor.java Tue Sep 19 14:00:14 2006
@@ -114,11 +114,11 @@
/**
* Execute method against context.
- * @param o
- * @param value
+ * @param o
+ * @param value
* @return The value of the invocation.
- * @throws IllegalAccessException
- * @throws InvocationTargetException
+ * @throws IllegalAccessException
+ * @throws InvocationTargetException
*/
public Object execute(final Object o, final Object value)
throws IllegalAccessException, InvocationTargetException
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/SimpleNode.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/SimpleNode.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/SimpleNode.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/SimpleNode.java Tue Sep 19 14:00:14 2006
@@ -46,12 +46,12 @@
/** */
protected Node[] children;
-
+
/** */
protected int id;
/** */
- protected Parser parser;
+ protected Parser parser;
/** */
protected int info; // added
@@ -61,10 +61,10 @@
/** */
protected boolean invalid = false;
-
+
/** */
protected Token first;
-
+
/** */
protected Token last;
@@ -133,7 +133,7 @@
{
parent = n;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.node.Node#jjtGetParent()
*/
@@ -167,7 +167,7 @@
{
return children[i];
}
-
+
/**
* @see org.apache.velocity.runtime.parser.node.Node#jjtGetNumChildren()
*/
@@ -222,9 +222,9 @@
/**
* Override this method if you want to customize how the node dumps
- * out its children.
- *
- * @param prefix
+ * out its children.
+ *
+ * @param prefix
*/
public void dump(String prefix)
{
@@ -251,13 +251,13 @@
{
Token t = first;
StringBuffer sb = new StringBuffer(t.image);
-
+
while (t != last)
{
t = t.next;
sb.append(t.image);
}
-
+
return sb.toString();
}
@@ -285,8 +285,8 @@
{
log.error(re);
}
- }
-
+ }
+
return data;
}
@@ -297,7 +297,7 @@
throws MethodInvocationException
{
return false;
- }
+ }
/**
* @see org.apache.velocity.runtime.parser.node.Node#value(org.apache.velocity.context.InternalContextAdapter)
@@ -306,7 +306,7 @@
throws MethodInvocationException
{
return null;
- }
+ }
/**
* @see org.apache.velocity.runtime.parser.node.Node#render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer)
@@ -318,7 +318,7 @@
for (i = 0; i < k; i++)
jjtGetChild(i).render(context, writer);
-
+
return true;
}
@@ -346,14 +346,14 @@
{
this.info = info;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.node.Node#getInfo()
*/
public int getInfo()
{
return info;
- }
+ }
/**
* @see org.apache.velocity.runtime.parser.node.Node#setInvalid()
@@ -361,7 +361,7 @@
public void setInvalid()
{
invalid = true;
- }
+ }
/**
* @see org.apache.velocity.runtime.parser.node.Node#isInvalid()
@@ -369,7 +369,7 @@
public boolean isInvalid()
{
return invalid;
- }
+ }
/**
* @see org.apache.velocity.runtime.parser.node.Node#getLine()
@@ -378,13 +378,13 @@
{
return first.beginLine;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.node.Node#getColumn()
*/
public int getColumn()
{
return first.beginColumn;
- }
+ }
}
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ContentResource.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ContentResource.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ContentResource.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ContentResource.java Tue Sep 19 14:00:14 2006
@@ -39,7 +39,7 @@
public ContentResource()
{
}
-
+
/**
* Pull in static content and store it.
* @return True if everything went ok.
@@ -55,19 +55,19 @@
try
{
StringWriter sw = new StringWriter();
-
+
reader = new BufferedReader(
new InputStreamReader(resourceLoader.getResourceStream(name),
encoding));
-
+
char buf[] = new char[1024];
int len = 0;
-
+
while ( ( len = reader.read( buf, 0, 1024 )) != -1)
sw.write( buf, 0, len );
-
+
setData(sw.toString());
-
+
return true;
}
catch ( ResourceNotFoundException e )
@@ -76,7 +76,7 @@
// remaining configured ResourceLoaders.
throw e;
}
- catch ( Exception e )
+ catch ( Exception e )
{
rsvc.getLog().error("Cannot process content resource", e);
return false;
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/Resource.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/Resource.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/Resource.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/Resource.java Tue Sep 19 14:00:14 2006
@@ -61,7 +61,7 @@
protected long lastModified = 0;
/**
- * The next time the file modification time will be checked (in
+ * The next time the file modification time will be checked (in
* milliseconds).
*/
protected long nextCheck = 0;
@@ -76,13 +76,13 @@
*/
protected String encoding = RuntimeConstants.ENCODING_DEFAULT;
- /**
- * Resource might require ancillary storage of some kind
+ /**
+ * Resource might require ancillary storage of some kind
*/
protected Object data = null;
- /**
- * Default constructor
+ /**
+ * Default constructor
*/
public Resource()
{
@@ -108,10 +108,10 @@
* indicates whether the resource could be read.
* @exception ResourceNotFoundException Similar in semantics as
* returning <code>false</code>.
- * @throws ParseErrorException
- * @throws Exception
+ * @throws ParseErrorException
+ * @throws Exception
*/
- public abstract boolean process()
+ public abstract boolean process()
throws ResourceNotFoundException, ParseErrorException, Exception;
/**
@@ -130,7 +130,7 @@
{
this.modificationCheckInterval = modificationCheckInterval;
}
-
+
/**
* Is it time to check to see if the resource
* source has been updated?
@@ -142,7 +142,7 @@
* short circuit this if modificationCheckInterval == 0
* as this means "don't check"
*/
-
+
if (modificationCheckInterval <= 0 )
{
return false;
@@ -163,16 +163,16 @@
{
nextCheck = System.currentTimeMillis() + ( MILLIS_PER_SECOND * modificationCheckInterval);
}
-
+
/**
* Set the name of this resource, for example
* test.vm.
- * @param name
+ * @param name
*/
public void setName(String name)
{
this.name = name;
- }
+ }
/**
* Get the name of this template.
@@ -181,12 +181,12 @@
public String getName()
{
return name;
- }
+ }
/**
* set the encoding of this resource
* for example, "ISO-8859-1"
- * @param encoding
+ * @param encoding
*/
public void setEncoding( String encoding )
{
@@ -212,17 +212,17 @@
public long getLastModified()
{
return lastModified;
- }
-
+ }
+
/**
* Set the last modified time for this
* resource.
- * @param lastModified
+ * @param lastModified
*/
public void setLastModified(long lastModified)
{
this.lastModified = lastModified;
- }
+ }
/**
* Return the template loader that pulled
@@ -233,28 +233,28 @@
{
return resourceLoader;
}
-
+
/**
* Set the template loader for this template. Set
* when the Runtime determines where this template
* came from the list of possible sources.
- * @param resourceLoader
+ * @param resourceLoader
*/
public void setResourceLoader(ResourceLoader resourceLoader)
{
this.resourceLoader = resourceLoader;
- }
+ }
- /**
+ /**
* Set arbitrary data object that might be used
* by the resource.
- * @param data
+ * @param data
*/
public void setData(Object data)
{
this.data = data;
}
-
+
/**
* Get arbitrary data object that might be used
* by the resource.
@@ -263,5 +263,5 @@
public Object getData()
{
return data;
- }
+ }
}
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceCache.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceCache.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceCache.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceCache.java Tue Sep 19 14:00:14 2006
@@ -29,13 +29,13 @@
public interface ResourceCache
{
/**
- * initializes the ResourceCache. Will be
+ * initializes the ResourceCache. Will be
* called before any utilization
*
* @param rs RuntimeServices to use for logging, etc
*/
public void initialize( RuntimeServices rs );
-
+
/**
* retrieves a Resource from the
* cache
@@ -44,7 +44,7 @@
* @return Resource specified or null if not found
*/
public Resource get( Object resourceKey );
-
+
/**
* stores a Resource in the cache
*
@@ -53,7 +53,7 @@
* @return existing Resource stored under this key, or null if none
*/
public Resource put( Object resourceKey, Resource resource );
-
+
/**
* removes a Resource from the cache
*
@@ -61,7 +61,7 @@
* @return stored under key
*/
public Resource remove( Object resourceKey );
-
+
/**
* returns an Iterator of Keys in the cache.
* @return An Iterator of Keys in the cache.
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceCacheImpl.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceCacheImpl.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceCacheImpl.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceCacheImpl.java Tue Sep 19 14:00:14 2006
@@ -51,7 +51,7 @@
* <code>initialize()</code> method.
*/
protected RuntimeServices rsvc = null;
-
+
/**
* @see org.apache.velocity.runtime.resource.ResourceCache#initialize(org.apache.velocity.runtime.RuntimeServices)
*/
@@ -71,7 +71,7 @@
}
rsvc.getLog().debug("ResourceCache: initialized ("+this.getClass()+')');
}
-
+
/**
* @see org.apache.velocity.runtime.resource.ResourceCache#get(java.lang.Object)
*/
@@ -79,7 +79,7 @@
{
return (Resource) cache.get( key );
}
-
+
/**
* @see org.apache.velocity.runtime.resource.ResourceCache#put(java.lang.Object, org.apache.velocity.runtime.resource.Resource)
*/
@@ -87,7 +87,7 @@
{
return (Resource) cache.put( key, value );
}
-
+
/**
* @see org.apache.velocity.runtime.resource.ResourceCache#remove(java.lang.Object)
*/
@@ -95,7 +95,7 @@
{
return (Resource) cache.remove( key );
}
-
+
/**
* @see org.apache.velocity.runtime.resource.ResourceCache#enumerateKeys()
*/
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceFactory.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceFactory.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceFactory.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceFactory.java Tue Sep 19 14:00:14 2006
@@ -36,18 +36,18 @@
public static Resource getResource(String resourceName, int resourceType)
{
Resource resource = null;
-
+
switch (resourceType)
{
case ResourceManager.RESOURCE_TEMPLATE:
resource = new Template();
break;
-
+
case ResourceManager.RESOURCE_CONTENT:
resource = new ContentResource();
break;
}
-
+
return resource;
}
}
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceManager.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceManager.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceManager.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceManager.java Tue Sep 19 14:00:14 2006
@@ -36,7 +36,7 @@
* A template resources.
*/
public static final int RESOURCE_TEMPLATE = 1;
-
+
/**
* A static content resource.
*/
@@ -44,8 +44,8 @@
/**
* Initialize the ResourceManager.
- * @param rs
- * @throws Exception
+ * @param rs
+ * @throws Exception
*/
public void initialize( RuntimeServices rs ) throws Exception;
@@ -68,7 +68,7 @@
throws ResourceNotFoundException, ParseErrorException, Exception;
/**
- * Determines is a template exists, and returns name of the loader that
+ * Determines is a template exists, and returns name of the loader that
* provides it. This is a slightly less hokey way to support
* the Velocity.templateExists() utility method, which was broken
* when per-template encoding was introduced. We can revisit this.
@@ -77,7 +77,7 @@
* @return class name of loader than can provide it
*/
public String getLoaderNameForResource(String resourceName );
-
+
}
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java Tue Sep 19 14:00:14 2006
@@ -48,7 +48,7 @@
* A template resources.
*/
public static final int RESOURCE_TEMPLATE = 1;
-
+
/**
* A static content resource.
*/
@@ -60,17 +60,17 @@
private static final String RESOURCE_LOADER_IDENTIFIER = "_RESOURCE_LOADER_IDENTIFIER_";
/**
- * Object implementing ResourceCache to
+ * Object implementing ResourceCache to
* be our resource manager's Resource cache.
*/
protected ResourceCache globalCache = null;
-
+
/**
* The List of templateLoaders that the Runtime will
* use to locate the InputStream source of a template.
*/
protected ArrayList resourceLoaders = new ArrayList();
-
+
/**
* This is a list of the template input stream source
* initializers, basically properties for a particular
@@ -100,31 +100,31 @@
/**
* Initialize the ResourceManager.
- * @param rs
- * @throws Exception
+ * @param rs
+ * @throws Exception
*/
- public void initialize( RuntimeServices rs )
+ public void initialize( RuntimeServices rs )
throws Exception
{
rsvc = rs;
log = rsvc.getLog();
-
+
log.debug("Default ResourceManager initializing. (" + this.getClass() + ")");
ResourceLoader resourceLoader;
-
+
assembleResourceLoaderInitializers();
-
+
for (int i = 0; i < sourceInitializerList.size(); i++)
{
/**
- * Resource loader can be loaded either via class name or be passed
+ * Resource loader can be loaded either via class name or be passed
* in as an instance.
*/
- ExtendedProperties configuration =
+ ExtendedProperties configuration =
(ExtendedProperties) sourceInitializerList.get(i);
String loaderClass = StringUtils.nullTrim(configuration.getString("class"));
- ResourceLoader loaderInstance =
+ ResourceLoader loaderInstance =
(ResourceLoader) configuration.get("instance");
if ( (loaderClass == null) && (loaderInstance == null) )
@@ -134,14 +134,14 @@
+ ".resource.loader.class' specification in configuation."
+ " This is a critical value. Please adjust configuration.");
continue;
-
- }
- else if ( loaderInstance != null )
+
+ }
+ else if ( loaderInstance != null )
{
resourceLoader = loaderInstance;
-
- }
- else
+
+ }
+ else
{
resourceLoader = ResourceLoaderFactory.getLoader( rsvc, loaderClass);
}
@@ -161,11 +161,11 @@
/*
* now, is a global cache specified?
*/
-
+
String claz = rsvc.getString( RuntimeConstants.RESOURCE_MANAGER_CACHE_CLASS );
-
+
Object o = null;
-
+
if ( claz != null && claz.length() > 0 )
{
try
@@ -178,7 +178,7 @@
") does not exist or is not accessible to the current classloader.");
o = null;
}
-
+
if (!(o instanceof ResourceCache) )
{
log.error("The specified class for ResourceCache (" + claz +
@@ -187,7 +187,7 @@
o = null;
}
}
-
+
/*
* if we didn't get through that, just use the default.
*/
@@ -195,10 +195,10 @@
{
o = new ResourceCacheImpl();
}
-
+
globalCache = (ResourceCache)o;
-
- globalCache.initialize(rsvc);
+
+ globalCache.initialize(rsvc);
log.trace("Default ResourceManager initialization complete.");
}
@@ -215,12 +215,12 @@
if (resourceLoaderInitializersActive)
{
return;
- }
+ }
- Vector resourceLoaderNames =
+ Vector resourceLoaderNames =
rsvc.getConfiguration().getVector(RuntimeConstants.RESOURCE_LOADER);
StringUtils.trimStrings(resourceLoaderNames);
-
+
for (int i = 0; i < resourceLoaderNames.size(); i++)
{
/*
@@ -231,7 +231,7 @@
* The loader id is the prefix used for all properties
* pertaining to a particular loader.
*/
- String loaderID =
+ String loaderID =
resourceLoaderNames.get(i) + "." + RuntimeConstants.RESOURCE_LOADER;
ExtendedProperties loaderConfiguration =
@@ -243,7 +243,7 @@
if ( loaderConfiguration == null)
{
- log.warn("ResourceManager : No configuration information for resource loader named '"
+ log.warn("ResourceManager : No configuration information for resource loader named '"
+ resourceLoaderNames.get(i) + "'. Skipping.");
continue;
}
@@ -262,7 +262,7 @@
*/
sourceInitializerList.add(loaderConfiguration);
}
-
+
resourceLoaderInitializersActive = true;
}
@@ -289,11 +289,11 @@
* If it was placed in the cache then we will use
* the cached version of the resource. If not we
* will load it.
- *
- * Note: the type is included in the key to differentiate ContentResource
+ *
+ * Note: the type is included in the key to differentiate ContentResource
* (static content from #include) with a Template.
*/
-
+
String resourceKey = resourceType + resourceName;
Resource resource = globalCache.get(resourceKey);
@@ -302,7 +302,7 @@
/*
* refresh the resource
*/
-
+
try
{
refreshResource( resource, encoding );
@@ -311,12 +311,12 @@
{
/*
* something exceptional happened to that resource
- * this could be on purpose,
+ * this could be on purpose,
* so clear the cache and try again
*/
-
+
globalCache.remove( resourceKey );
-
+
return getResource( resourceName, resourceType, encoding );
}
catch( ParseErrorException pee )
@@ -331,7 +331,7 @@
}
}
else
- {
+ {
try
{
/*
@@ -339,11 +339,11 @@
*/
resource = loadResource( resourceName, resourceType, encoding );
-
+
if (resource.getResourceLoader().isCachingOn())
{
globalCache.put(resourceKey, resource);
- }
+ }
}
catch( ResourceNotFoundException rnfe2 )
{
@@ -365,7 +365,7 @@
return resource;
}
-
+
/**
* Loads a resource from the current set of resource loaders
*
@@ -379,17 +379,17 @@
* @throws ParseErrorException if template cannot be parsed due
* to syntax (or other) error.
* @throws Exception if a problem in parse
- */
+ */
protected Resource loadResource(String resourceName, int resourceType, String encoding )
throws ResourceNotFoundException, ParseErrorException, Exception
{
Resource resource = ResourceFactory.getResource(resourceName, resourceType);
-
+
resource.setRuntimeServices( rsvc );
resource.setName( resourceName );
resource.setEncoding( encoding );
-
+
/*
* Now we have to try to find the appropriate
* loader for this resource. We have to cycle through
@@ -406,32 +406,32 @@
{
resourceLoader = (ResourceLoader) resourceLoaders.get(i);
resource.setResourceLoader(resourceLoader);
-
+
/*
* catch the ResourceNotFound exception
* as that is ok in our new multi-loader environment
*/
- try
+ try
{
if (resource.process())
{
/*
* FIXME (gmj)
- * moved in here - technically still
- * a problem - but the resource needs to be
- * processed before the loader can figure
- * it out due to to the new
+ * moved in here - technically still
+ * a problem - but the resource needs to be
+ * processed before the loader can figure
+ * it out due to to the new
* multi-path support - will revisit and fix
*/
if (logWhenFound && log.isDebugEnabled())
{
log.debug("ResourceManager : found " + resourceName +
- " with loader " +
+ " with loader " +
resourceLoader.getClassName());
}
-
+
howOldItWas = resourceLoader.getLastModified( resource );
break;
}
@@ -444,7 +444,7 @@
*/
}
}
-
+
/*
* Return null if we can't find a resource.
*/
@@ -457,17 +457,17 @@
/*
* some final cleanup
*/
-
+
resource.setLastModified( howOldItWas );
-
+
resource.setModificationCheckInterval(
resourceLoader.getModificationCheckInterval());
-
+
resource.touch();
-
- return resource;
+
+ return resource;
}
-
+
/**
* Takes an existing resource, and 'refreshes' it. This
* generally means that the source of the resource is checked
@@ -501,7 +501,7 @@
*/
resource.touch();
-
+
if( resource.isSourceModified() )
{
/*
@@ -509,14 +509,14 @@
* encoding is different than the encoding already in the resource
* this strikes me as bad...
*/
-
+
if (!resource.getEncoding().equals( encoding ) )
{
log.warn("Declared encoding for template '" +
resource.getName() +
"' is different on reload. Old = '" +
resource.getEncoding() + "' New = '" + encoding);
-
+
resource.setEncoding( encoding );
}
@@ -536,7 +536,7 @@
* now set the modification info and reset
* the modification check counters
*/
-
+
resource.setLastModified( howOldItWas );
}
}
@@ -557,17 +557,17 @@
* @throws Exception if a problem in parse
*
* @deprecated Use
- * {@link #getResource(String resourceName, int resourceType,
+ * {@link #getResource(String resourceName, int resourceType,
* String encoding )}
*/
public Resource getResource(String resourceName, int resourceType )
throws ResourceNotFoundException, ParseErrorException, Exception
- {
+ {
return getResource( resourceName, resourceType, RuntimeConstants.ENCODING_DEFAULT);
}
/**
- * Determines is a template exists, and returns name of the loader that
+ * Determines is a template exists, and returns name of the loader that
* provides it. This is a slightly less hokey way to support
* the Velocity.templateExists() utility method, which was broken
* when per-template encoding was introduced. We can revisit this.
@@ -578,12 +578,12 @@
public String getLoaderNameForResource(String resourceName )
{
ResourceLoader resourceLoader = null;
-
+
/*
* loop through our loaders...
*/
for (int i = 0; i < resourceLoaders.size(); i++)
- {
+ {
resourceLoader = (ResourceLoader) resourceLoaders.get(i);
InputStream is = null;
@@ -595,7 +595,7 @@
try
{
is=resourceLoader.getResourceStream( resourceName );
-
+
if( is != null)
{
return resourceLoader.getClass().toString();
@@ -610,7 +610,7 @@
finally
{
/*
- * if we did find one, clean up because we were
+ * if we did find one, clean up because we were
* returned an open stream
*/
if (is != null)
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/ClasspathResourceLoader.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/ClasspathResourceLoader.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/ClasspathResourceLoader.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/ClasspathResourceLoader.java Tue Sep 19 14:00:14 2006
@@ -77,7 +77,7 @@
/**
* This is abstract in the base class, so we need it
- * @param configuration
+ * @param configuration
*/
public void init( ExtendedProperties configuration)
{
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java Tue Sep 19 14:00:14 2006
@@ -59,18 +59,18 @@
* ds.resource.loader.cache = false <br>
* ds.resource.loader.modificationCheckInterval = 60 <br>
* <br>
- * <P>Optionally, the developer can instantiate the DataSourceResourceLoader and set the DataSource via code in
+ * <P>Optionally, the developer can instantiate the DataSourceResourceLoader and set the DataSource via code in
* a manner similar to the following:
* <BR>
* <BR>
* DataSourceResourceLoader ds = new DataSourceResourceLoader();<BR>
* ds.setDataSource(DATASOURCE);<BR>
* Velocity.setProperty("ds.resource.loader.instance",ds);<BR>
- * <P> The property <code>ds.resource.loader.class</code> should be left out, otherwise all the other
+ * <P> The property <code>ds.resource.loader.class</code> should be left out, otherwise all the other
* properties in velocity.properties would remain the same.
* <BR>
* <BR>
- *
+ *
* Example WEB-INF/web.xml: <br>
* <br>
* <resource-ref> <br>
@@ -142,8 +142,8 @@
keyColumn = StringUtils.nullTrim(configuration.getString("resource.keycolumn"));
templateColumn = StringUtils.nullTrim(configuration.getString("resource.templatecolumn"));
timestampColumn = StringUtils.nullTrim(configuration.getString("resource.timestampcolumn"));
-
- if (dataSource != null)
+
+ if (dataSource != null)
{
if (log.isDebugEnabled())
{
@@ -155,8 +155,8 @@
}
log.trace("DataSourceResourceLoader initalized.");
- }
- else if (dataSourceName != null)
+ }
+ else if (dataSourceName != null)
{
if (log.isDebugEnabled())
{
@@ -168,19 +168,19 @@
}
log.trace("DataSourceResourceLoader initalized.");
- }
- else
+ }
+ else
{
log.warn("DataSourceResourceLoader not properly initialized. No DataSource was identified.");
}
}
/**
- * Set the DataSource used by this resource loader. Call this as an alternative to
+ * Set the DataSource used by this resource loader. Call this as an alternative to
* specifying the data source name via properties.
- * @param dataSource The data source for this ResourceLoader.
+ * @param dataSource The data source for this ResourceLoader.
*/
- public void setDataSource(final DataSource dataSource)
+ public void setDataSource(final DataSource dataSource)
{
this.dataSource = dataSource;
}
@@ -208,7 +208,7 @@
*
* @param name name of template
* @return InputStream containing template
- * @throws ResourceNotFoundException
+ * @throws ResourceNotFoundException
*/
public synchronized InputStream getResourceStream(final String name)
throws ResourceNotFoundException
@@ -229,7 +229,7 @@
if (rs.next())
{
InputStream ascStream = rs.getAsciiStream(templateColumn);
- if (ascStream == null)
+ if (ascStream == null)
{
throw new ResourceNotFoundException("DataSourceResourceLoader: "
+ "template column for '" + name + "' is null");
@@ -241,14 +241,14 @@
{
throw new ResourceNotFoundException("DataSourceResourceLoader: "
+ "could not find resource '" + name + "'");
-
+
}
}
catch(SQLException sqle)
{
String msg = "DataSourceResourceLoader: database problem while getting resource '"
+ name + "': ";
-
+
log.error(msg, sqle);
throw new ResourceNotFoundException(msg);
}
@@ -256,7 +256,7 @@
{
String msg = "DataSourceResourceLoader: database problem while getting resource '"
+ name + "': ";
-
+
log.error(msg, ne);
throw new ResourceNotFoundException(msg);
}
@@ -275,7 +275,7 @@
*
* @return timestamp as long
*/
- private long readLastModified(final Resource resource, final String operation)
+ private long readLastModified(final Resource resource, final String operation)
{
long timeStamp = 0;
@@ -283,7 +283,7 @@
* get the template name from the resource
*/
String name = resource.getName();
-
+
if (name == null || name.length() == 0)
{
log.error("DataSourceResourceLoader: "
@@ -301,7 +301,7 @@
if (rs.next())
{
- Timestamp ts = rs.getTimestamp(timestampColumn);
+ Timestamp ts = rs.getTimestamp(timestampColumn);
timeStamp = ts != null ? ts.getTime() : 0;
}
else
@@ -314,7 +314,7 @@
{
String msg = "DataSourceResourceLoader: database problem while " + operation + " of '"
+ name + "': ";
-
+
log.error(msg, sqle);
throw ExceptionUtils.createRuntimeException(msg, sqle);
}
@@ -322,7 +322,7 @@
{
String msg = "DataSourceResourceLoader: database problem while " + operation + " of '"
+ name + "': ";
-
+
log.error(msg, ne);
throw ExceptionUtils.createRuntimeException(msg, ne);
}
@@ -341,15 +341,15 @@
*
* @return connection
*/
- private Connection openDbConnection()
+ private Connection openDbConnection()
throws NamingException, SQLException
{
- if (dataSource != null)
+ if (dataSource != null)
{
return dataSource.getConnection();
}
-
- if (ctx == null)
+
+ if (ctx == null)
{
ctx = new InitialContext();
}
@@ -358,7 +358,7 @@
return dataSource.getConnection();
}
-
+
/**
* Closes connection to the datasource
*/
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java Tue Sep 19 14:00:14 2006
@@ -39,8 +39,8 @@
* as relative to the configured root path. If the root path is empty
* treats the template name as an absolute path.
*
- * @author <a href="mailto:wglass@forio.com">Will Glass-Husain</a>
- * @author <a href="mailto:mailmur@yahoo.com">Aki Nieminen</a>
+ * @author <a href="mailto:wglass@forio.com">Will Glass-Husain</a>
+ * @author <a href="mailto:mailmur@yahoo.com">Aki Nieminen</a>
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
* @version $Id$
*/
@@ -68,7 +68,7 @@
{
log.trace("FileResourceLoader : initialization starting.");
}
-
+
paths.addAll( configuration.getVector("path") );
// trim spaces from all paths
@@ -114,12 +114,12 @@
String template = StringUtils.normalizePath(templateName);
if ( template == null || template.length() == 0 )
{
- String msg = "File resource error : argument " + template +
- " contains .. and may be trying to access " +
+ String msg = "File resource error : argument " + template +
+ " contains .. and may be trying to access " +
"content outside of template root. Rejected.";
log.error("FileResourceLoader : " + msg);
-
+
throw new ResourceNotFoundException ( msg );
}
@@ -128,7 +128,7 @@
{
String path = (String) paths.get(i);
InputStream inputStream = findTemplate(path, template);
-
+
if (inputStream != null)
{
/*
@@ -136,11 +136,11 @@
* from so that we can check its modification
* time.
*/
- templatePaths.put(templateName, path);
+ templatePaths.put(templateName, path);
return inputStream;
- }
+ }
}
-
+
/*
* We have now searched all the paths for
* templates and we didn't find anything so
@@ -148,10 +148,10 @@
*/
throw new ResourceNotFoundException("FileResourceLoader : cannot find " + template);
}
-
+
/**
* Try to find a template given a normalized path.
- *
+ *
* @param path a normalized path
* @param template name of template to find
* @return InputStream input stream that will be parsed
@@ -159,19 +159,19 @@
*/
private InputStream findTemplate(String path, String template)
{
- try
+ try
{
File file = getFile(path,template);
-
+
if ( file.canRead() )
{
return new BufferedInputStream(
new FileInputStream(file.getAbsolutePath()));
}
else
- {
+ {
return null;
- }
+ }
}
catch( FileNotFoundException fnfe )
{
@@ -181,7 +181,7 @@
return null;
}
}
-
+
/**
* How to keep track of all the modified times
* across the paths. Note that a file might have
@@ -189,13 +189,13 @@
* path; so we should search the path and see if
* the file we find that way is the same as the one
* that we have cached.
- * @param resource
+ * @param resource
* @return True if the source has been modified.
*/
public boolean isSourceModified(Resource resource)
{
/*
- * we assume that the file needs to be reloaded;
+ * we assume that the file needs to be reloaded;
* if we find the original file and it's unchanged,
* then we'll flip this.
*/
@@ -220,7 +220,7 @@
/*
* noop: if the file is missing now (either the cached
* file is gone, or the file can no longer be found)
- * then we leave modified alone (it's set to true); a
+ * then we leave modified alone (it's set to true); a
* reload attempt will be done, which will either use
* a new template or fail with an appropriate message
* about how the file couldn't be found.
@@ -254,11 +254,11 @@
if (file.canRead())
{
return file.lastModified();
- }
+ }
else
{
return 0;
- }
+ }
}
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarHolder.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarHolder.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarHolder.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarHolder.java Tue Sep 19 14:00:14 2006
@@ -40,7 +40,7 @@
private String urlpath = null;
private JarFile theJar = null;
private JarURLConnection conn = null;
-
+
private Log log = null;
/**
@@ -53,7 +53,7 @@
this.urlpath=urlpath;
init();
-
+
if (log.isDebugEnabled())
{
log.debug("JarHolder: initialized JAR: " + urlpath);
@@ -61,7 +61,7 @@
}
/**
- *
+ *
*/
public void init()
{
@@ -78,7 +78,7 @@
conn.setDoOutput(false);
conn.connect();
theJar = conn.getJarFile();
- }
+ }
catch (IOException ioe)
{
log.error("JarHolder: error establishing connection to JAR at \""
@@ -87,9 +87,9 @@
}
/**
- *
+ *
*/
- public void close()
+ public void close()
{
try
{
@@ -104,7 +104,7 @@
log.trace("JarHolder: JAR file closed");
}
-
+
/**
* @param theentry
* @return The requested resource.
@@ -113,13 +113,13 @@
public InputStream getResource( String theentry )
throws ResourceNotFoundException {
InputStream data = null;
-
- try
+
+ try
{
JarEntry entry = theJar.getJarEntry( theentry );
-
+
if ( entry != null )
- {
+ {
data = theJar.getInputStream( entry );
}
}
@@ -128,7 +128,7 @@
log.error("JarHolder: getResource() error", fnfe);
throw new ResourceNotFoundException( fnfe.getMessage() );
}
-
+
return data;
}
@@ -138,21 +138,21 @@
public Hashtable getEntries()
{
Hashtable allEntries = new Hashtable(559);
-
+
Enumeration all = theJar.entries();
while ( all.hasMoreElements() )
{
JarEntry je = (JarEntry)all.nextElement();
-
+
// We don't map plain directory entries
if ( !je.isDirectory() )
{
- allEntries.put( je.getName(), this.urlpath );
+ allEntries.put( je.getName(), this.urlpath );
}
}
return allEntries;
}
-
+
/**
* @return The URL path of this jar holder.
*/
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java Tue Sep 19 14:00:14 2006
@@ -51,10 +51,10 @@
* conforms to the same rules for the java.net.JarUrlConnection class.
* </p>
*
- * <p> For a working example, see the unit test case,
+ * <p> For a working example, see the unit test case,
* org.apache.velocity.test.MultiLoaderTestCase class
* </p>
- *
+ *
* @author <a href="mailto:mailmur@yahoo.com">Aki Nieminen</a>
* @author <a href="mailto:daveb@miceda-data.com">Dave Bryson</a>
* @version $Id$
@@ -67,28 +67,28 @@
* Value = the JAR URL
*/
private Map entryDirectory = new HashMap(559);
-
+
/**
* Maps JAR URLs to the actual JAR
* Key = the JAR URL
* Value = the JAR
*/
private Map jarfiles = new HashMap(89);
-
+
/**
* Called by Velocity to initialize the loader
- * @param configuration
+ * @param configuration
*/
public void init( ExtendedProperties configuration)
{
log.trace("JarResourceLoader : initialization starting.");
- // rest of Velocity engine still use legacy Vector
+ // rest of Velocity engine still use legacy Vector
// and Hashtable classes. Classes are implicitly
// synchronized even if we don't need it.
Vector paths = configuration.getVector("path");
StringUtils.trimStrings(paths);
-
+
/*
* support the old version but deprecate with a log message
*/
@@ -105,20 +105,20 @@
+ " Please change to the conventional '<name>.resource.loader.path'.");
}
}
-
+
if (paths != null)
{
log.debug("JarResourceLoader # of paths : " + paths.size() );
-
+
for ( int i=0; i<paths.size(); i++ )
{
loadJar( (String)paths.get(i) );
}
}
-
+
log.trace("JarResourceLoader : initialization complete.");
}
-
+
private void loadJar( String path )
{
if (log.isDebugEnabled())
@@ -140,11 +140,11 @@
{
path += "!/";
}
-
+
// Close the jar if it's already open
// this is useful for a reload
closeJar( path );
-
+
// Create a new JarHolder
JarHolder temp = new JarHolder( rsvc, path );
// Add it's entries to the entryCollection
@@ -154,7 +154,7 @@
}
/**
- * Closes a Jar file and set its URLConnection
+ * Closes a Jar file and set its URLConnection
* to null.
*/
private void closeJar( String path )
@@ -165,7 +165,7 @@
theJar.close();
}
}
-
+
/**
* Copy all the entries into the entryDirectory
* It will overwrite any duplicate keys.
@@ -174,7 +174,7 @@
{
entryDirectory.putAll( entries );
}
-
+
/**
* Get an InputStream so that the Runtime can build a
* template with it.
@@ -193,20 +193,20 @@
{
throw new ResourceNotFoundException("Need to have a resource!");
}
-
+
String normalizedPath = StringUtils.normalizePath( source );
-
+
if ( normalizedPath == null || normalizedPath.length() == 0 )
{
- String msg = "JAR resource error : argument " + normalizedPath +
- " contains .. and may be trying to access " +
+ String msg = "JAR resource error : argument " + normalizedPath +
+ " contains .. and may be trying to access " +
"content outside of template root. Rejected.";
-
+
log.error( "JarResourceLoader : " + msg );
-
+
throw new ResourceNotFoundException ( msg );
}
-
+
/*
* if a / leads off, then just nip that :)
*/
@@ -214,11 +214,11 @@
{
normalizedPath = normalizedPath.substring(1);
}
-
+
if ( entryDirectory.containsKey( normalizedPath ) )
{
String jarurl = (String)entryDirectory.get( normalizedPath );
-
+
if ( jarfiles.containsKey( jarurl ) )
{
JarHolder holder = (JarHolder)jarfiles.get( jarurl );
@@ -226,13 +226,13 @@
return results;
}
}
-
+
throw new ResourceNotFoundException( "JarResourceLoader Error: cannot find resource " +
source );
}
-
-
+
+
// TODO: SHOULD BE DELEGATED TO THE JARHOLDER
/**
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java Tue Sep 19 14:00:14 2006
@@ -62,8 +62,8 @@
* This initialization is used by all resource
* loaders and must be called to set up common
* properties shared by all resource loaders
- * @param rs
- * @param configuration
+ * @param rs
+ * @param configuration
*/
public void commonInit( RuntimeServices rs, ExtendedProperties configuration)
{
@@ -94,7 +94,7 @@
catch (Exception e)
{
modificationCheckInterval = 0;
- log.error("Exception using default of '" +
+ log.error("Exception using default of '" +
modificationCheckInterval + '\'', e);
}
@@ -115,16 +115,16 @@
/**
* Initialize the template loader with a
* a resources class.
- * @param configuration
+ * @param configuration
*/
public abstract void init( ExtendedProperties configuration);
/**
* Get the InputStream that the Runtime will parse
* to create a template.
- * @param source
+ * @param source
* @return The input stream for the requested resource.
- * @throws ResourceNotFoundException
+ * @throws ResourceNotFoundException
*/
public abstract InputStream getResourceStream( String source )
throws ResourceNotFoundException;
@@ -132,7 +132,7 @@
/**
* Given a template, check to see if the source of InputStream
* has been modified.
- * @param resource
+ * @param resource
* @return True if the resource has been modified.
*/
public abstract boolean isSourceModified(Resource resource);
@@ -142,7 +142,7 @@
* that was used to create the template. We need the template
* here because we have to extract the name of the template
* in order to locate the InputStream source.
- * @param resource
+ * @param resource
* @return Time in millis when the resource has been modified.
*/
public abstract long getLastModified(Resource resource);
@@ -161,7 +161,7 @@
* would like the Runtime to cache templates that
* have been created with InputStreams provided
* by this loader.
- * @param value
+ * @param value
*/
public void setCachingOn(boolean value)
{
@@ -183,7 +183,7 @@
/**
* Set the interval at which the InputStream source
* should be checked for modifications.
- * @param modificationCheckInterval
+ * @param modificationCheckInterval
*/
public void setModificationCheckInterval(long modificationCheckInterval)
{
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoaderFactory.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoaderFactory.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoaderFactory.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoaderFactory.java Tue Sep 19 14:00:14 2006
@@ -22,7 +22,7 @@
/**
* Factory to grab a template loader.
- *
+ *
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
* @version $Id$
*/
@@ -30,23 +30,23 @@
{
/**
* Gets the loader specified in the configuration file.
- * @param rs
- * @param loaderClassName
+ * @param rs
+ * @param loaderClassName
* @return TemplateLoader
- * @throws Exception
+ * @throws Exception
*/
public static ResourceLoader getLoader(RuntimeServices rs, String loaderClassName)
throws Exception
{
ResourceLoader loader = null;
-
+
try
{
loader = (ResourceLoader) ClassUtils.getNewInstance( loaderClassName );
-
+
rs.getLog().debug("ResourceLoader instantiated: "
+ loader.getClass().getName());
-
+
return loader;
}
// The ugly three strike again: ClassNotFoundException,IllegalAccessException,InstantiationException
@@ -56,8 +56,8 @@
"Look at your properties file and make sure the\n" +
"name of the template loader is correct. Here is the\n" +
"error:", e);
-
- throw new Exception("Problem initializing template loader: " + loaderClassName +
+
+ throw new Exception("Problem initializing template loader: " + loaderClassName +
"\nError is: " + StringUtils.stackTrace(e));
}
}
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/URLResourceLoader.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/URLResourceLoader.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/URLResourceLoader.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/URLResourceLoader.java Tue Sep 19 14:00:14 2006
@@ -28,7 +28,7 @@
/**
* This is a simple URL-based loader.
- *
+ *
* @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
* @author <a href="mailto:nbubna@apache.org">Nathan Bubna</a>
* @version $Id: URLResourceLoader.java 191743 2005-06-21 23:22:20Z dlr $
@@ -46,7 +46,7 @@
log.trace("URLResourceLoader : initialization starting.");
roots = configuration.getStringArray("root");
-
+
if (log.isInfoEnabled())
{
for (int i=0; i < roots.length; i++)
@@ -57,7 +57,7 @@
// init the template paths map
templateRoots = new HashMap();
-
+
log.trace("URLResourceLoader : initialization complete.");
}
@@ -86,7 +86,7 @@
{
URL u = new URL(roots[i] + name);
inputStream = u.openStream();
-
+
if (inputStream != null)
{
if (log.isDebugEnabled()) log.debug("URLResourceLoader: Found '"+name+"' at '"+roots[i]+"'");
@@ -126,7 +126,7 @@
return inputStream;
}
-
+
/**
* Checks to see if a resource has been deleted, moved or modified.
*
@@ -137,7 +137,7 @@
{
long fileLastModified = getLastModified(resource);
// if the file is unreachable or otherwise changed
- if (fileLastModified == 0 ||
+ if (fileLastModified == 0 ||
fileLastModified != resource.getLastModified())
{
return true;
@@ -167,7 +167,7 @@
catch (IOException ioe)
{
// the file is not reachable at its previous address
- log.warn("URLResourceLoader: '" + name +
+ log.warn("URLResourceLoader: '" + name +
"' is no longer reachable at '" + root + "'", ioe);
return 0;
}
Modified: jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/visitor/BaseVisitor.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/visitor/BaseVisitor.java?view=diff&rev=447969&r1=447968&r2=447969
==============================================================================
--- jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/visitor/BaseVisitor.java (original)
+++ jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/visitor/BaseVisitor.java Tue Sep 19 14:00:14 2006
@@ -75,17 +75,17 @@
{
/** Context used during traversal */
protected InternalContextAdapter context;
-
+
/** Writer used as the output sink */
protected Writer writer;
-
+
/**
* @param writer
*/
public void setWriter( Writer writer )
{
this.writer = writer;
- }
+ }
/**
* @param context
@@ -94,169 +94,169 @@
{
this.context = context;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.SimpleNode, java.lang.Object)
*/
public Object visit(SimpleNode node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTprocess, java.lang.Object)
*/
public Object visit(ASTprocess node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTExpression, java.lang.Object)
*/
public Object visit(ASTExpression node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTAssignment, java.lang.Object)
*/
public Object visit(ASTAssignment node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTOrNode, java.lang.Object)
*/
public Object visit(ASTOrNode node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTAndNode, java.lang.Object)
*/
public Object visit(ASTAndNode node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTEQNode, java.lang.Object)
*/
public Object visit(ASTEQNode node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTNENode, java.lang.Object)
*/
public Object visit(ASTNENode node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTLTNode, java.lang.Object)
*/
public Object visit(ASTLTNode node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTGTNode, java.lang.Object)
*/
public Object visit(ASTGTNode node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTLENode, java.lang.Object)
*/
public Object visit(ASTLENode node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTGENode, java.lang.Object)
*/
public Object visit(ASTGENode node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTAddNode, java.lang.Object)
*/
public Object visit(ASTAddNode node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTSubtractNode, java.lang.Object)
*/
public Object visit(ASTSubtractNode node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTMulNode, java.lang.Object)
*/
public Object visit(ASTMulNode node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTDivNode, java.lang.Object)
*/
public Object visit(ASTDivNode node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTModNode, java.lang.Object)
*/
public Object visit(ASTModNode node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTNotNode, java.lang.Object)
*/
public Object visit(ASTNotNode node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTIntegerLiteral, java.lang.Object)
*/
@@ -270,152 +270,152 @@
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTFloatingPointLiteral, java.lang.Object)
*/
public Object visit(ASTFloatingPointLiteral node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTStringLiteral, java.lang.Object)
*/
public Object visit(ASTStringLiteral node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTIdentifier, java.lang.Object)
*/
public Object visit(ASTIdentifier node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTMethod, java.lang.Object)
*/
public Object visit(ASTMethod node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTReference, java.lang.Object)
*/
public Object visit(ASTReference node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTTrue, java.lang.Object)
*/
public Object visit(ASTTrue node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTFalse, java.lang.Object)
*/
public Object visit(ASTFalse node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTBlock, java.lang.Object)
*/
public Object visit(ASTBlock node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTText, java.lang.Object)
*/
public Object visit(ASTText node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTIfStatement, java.lang.Object)
*/
public Object visit(ASTIfStatement node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTElseStatement, java.lang.Object)
*/
public Object visit(ASTElseStatement node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTElseIfStatement, java.lang.Object)
*/
public Object visit(ASTElseIfStatement node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTComment, java.lang.Object)
*/
public Object visit(ASTComment node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTObjectArray, java.lang.Object)
*/
public Object visit(ASTObjectArray node, Object data)
- {
- data = node.childrenAccept(this, data);
- return data;
+ {
+ data = node.childrenAccept(this, data);
+ return data;
}
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTWord, java.lang.Object)
*/
public Object visit(ASTWord node, Object data)
- {
- data = node.childrenAccept(this, data);
+ {
+ data = node.childrenAccept(this, data);
return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTSetDirective, java.lang.Object)
*/
public Object visit(ASTSetDirective node, Object data)
- {
- data = node.childrenAccept(this, data);
+ {
+ data = node.childrenAccept(this, data);
return data;
}
-
+
/**
* @see org.apache.velocity.runtime.parser.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTDirective, java.lang.Object)
*/
public Object visit(ASTDirective node, Object data)
- {
- data = node.childrenAccept(this, data);
+ {
+ data = node.childrenAccept(this, data);
return data;
}
@@ -424,7 +424,7 @@
*/
public Object visit(ASTEscapedDirective node, Object data)
{
- data = node.childrenAccept(this, data);
+ data = node.childrenAccept(this, data);
return data;
}
@@ -433,7 +433,7 @@
*/
public Object visit(ASTEscape node, Object data)
{
- data = node.childrenAccept(this, data);
+ data = node.childrenAccept(this, data);
return data;
}
@@ -442,7 +442,7 @@
*/
public Object visit(ASTMap node, Object data)
{
- data = node.childrenAccept(this, data);
+ data = node.childrenAccept(this, data);
return data;
}
@@ -451,7 +451,7 @@
*/
public Object visit(ASTIntegerRange node, Object data)
{
- data = node.childrenAccept(this, data);
+ data = node.childrenAccept(this, data);
return data;
}
@@ -460,7 +460,7 @@
*/
public Object visit(ASTStop node, Object data)
{
- data = node.childrenAccept(this, data);
+ data = node.childrenAccept(this, data);
return data;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org