You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by jk...@apache.org on 2006/03/11 21:55:35 UTC
svn commit: r385164 [21/32] - in /jakarta/tapestry/trunk: ./ .settings/
annotations/src/java/org/apache/tapestry/annotations/
annotations/src/test/org/apache/tapestry/annotations/ config/
contrib/src/documentation/content/xdocs/tapestry-contrib/Compone...
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/record/RecordUtils.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/record/RecordUtils.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/record/RecordUtils.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/record/RecordUtils.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2005, 2006 The Apache Software Foundation
+// Copyright 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -22,36 +22,28 @@
/**
* Utility methods to support implementations of
- * {@link org.apache.tapestry.record.PropertyPersistenceStrategy}. This
- * consists of code refactored out of
- * {@link org.apache.tapestry.record.SessionPropertyPersistenceStrategy} to
- * support other, similar, persistence types with different rules for how long
- * values are stored in the session.
+ * {@link org.apache.tapestry.record.PropertyPersistenceStrategy}. This consists of code refactored
+ * out of {@link org.apache.tapestry.record.SessionPropertyPersistenceStrategy} to support other,
+ * similar, persistence types with different rules for how long values are stored in the session.
*
* @author Howard M. Lewis Ship
* @since 4.0
*/
-public final class RecordUtils
+public class RecordUtils
{
-
- /** @since 4.1 */
- private RecordUtils()
- {
- }
-
/**
- * Builds a {@link PropertyChange} instance for the given key and value
- * pulled from the {@link org.apache.tapestry.web.WebSession}.
+ * Builds a {@link PropertyChange} instance for the given key and value pulled from the
+ * {@link org.apache.tapestry.web.WebSession}.
*
* @param key
* a key, previously created by
- * {@link #buildChangeKey(String, String, String, String, String)},
- * consisting of a strategy id, application id, page name, id
- * path (optional), and a property name, all seperated by commas.
+ * {@link #buildChangeKey(String, String, String, String, String)}, consisting of a
+ * strategy id, application id, page name, id path (optional), and a property name,
+ * all seperated by commas.
* @param value
* the value stored in the session with this key
- * @return a {@link PropertyChange} storing the property name and id path
- * (if any), and the value
+ * @return a {@link PropertyChange} storing the property name and id path (if any), and the
+ * value
*/
public static PropertyChange buildChange(String key, Object value)
{
@@ -67,10 +59,9 @@
}
/**
- * Iterates over the attributes stored in the session, invoking a callback
- * on each one that matches the given prefix, applicationid and page name.
- * This is used to operate over all stored data for a particular combination
- * of strategy, applicationId and page.
+ * Iterates over the attributes stored in the session, invoking a callback on each one that
+ * matches the given prefix, applicationid and page name. This is used to operate over all
+ * stored data for a particular combination of strategy, applicationId and page.
*
* @param strategyId
* a unique identifier for a particular implementation of
@@ -84,8 +75,8 @@
* @param callback
* the callback to invoke on each matching attibute name
*/
- public static void iterateOverMatchingAttributes(String strategyId, String applicationId, String pageName,
- WebSession session, WebSessionAttributeCallback callback)
+ public static void iterateOverMatchingAttributes(String strategyId, String applicationId,
+ String pageName, WebSession session, WebSessionAttributeCallback callback)
{
Defense.notNull(strategyId, "strategyId");
Defense.notNull(applicationId, "applicationId");
@@ -95,18 +86,18 @@
String prefix = strategyId + "," + applicationId + "," + pageName + ",";
Iterator i = session.getAttributeNames().iterator();
- while(i.hasNext())
+ while (i.hasNext())
{
- String name = (String)i.next();
+ String name = (String) i.next();
- if (name.startsWith(prefix)) callback.handleAttribute(session, name);
+ if (name.startsWith(prefix))
+ callback.handleAttribute(session, name);
}
}
/**
- * Builds a change key, used to identify the change within the
- * {@link WebSession}. A change key can be used as a session attribute
- * name, without reasonable fear of conflict.
+ * Builds a change key, used to identify the change within the {@link WebSession}. A change key
+ * can be used as a session attribute name, without reasonable fear of conflict.
*
* @param strategyId
* a unique identifier for a particular implementation of
@@ -116,15 +107,14 @@
* @param pageName
* the name of the page containing the change
* @param idPath
- * the id path of the component within the page containing the
- * page, possibly null
+ * the id path of the component within the page containing the page, possibly null
* @param propertyName
* the name of the property
- * @return the above values, seperated by commas (well, no comma between the
- * prefix and the application id)
+ * @return the above values, seperated by commas (well, no comma between the prefix and the
+ * application id)
*/
- public static String buildChangeKey(String strategyId, String applicationId, String pageName, String idPath,
- String propertyName)
+ public static String buildChangeKey(String strategyId, String applicationId, String pageName,
+ String idPath, String propertyName)
{
Defense.notNull(strategyId, "strategyId");
Defense.notNull(applicationId, "applicationId");
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/record/SessionPropertyPersistenceStrategy.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/record/SessionPropertyPersistenceStrategy.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/record/SessionPropertyPersistenceStrategy.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/record/SessionPropertyPersistenceStrategy.java Sat Mar 11 12:54:27 2006
@@ -72,9 +72,9 @@
WebSessionAttributeCallback callback = new WebSessionAttributeCallback()
{
- public void handleAttribute(WebSession sess, String name)
+ public void handleAttribute(WebSession session, String name)
{
- PropertyChange change = RecordUtils.buildChange(name, sess.getAttribute(name));
+ PropertyChange change = RecordUtils.buildChange(name, session.getAttribute(name));
result.add(change);
}
@@ -99,9 +99,9 @@
WebSessionAttributeCallback callback = new WebSessionAttributeCallback()
{
- public void handleAttribute(WebSession sess, String name)
+ public void handleAttribute(WebSession session, String name)
{
- sess.setAttribute(name, null);
+ session.setAttribute(name, null);
}
};
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/request/IUploadFile.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/request/IUploadFile.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/request/IUploadFile.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/request/IUploadFile.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -18,75 +18,81 @@
import java.io.InputStream;
/**
- * Represents a file uploaded from a client side form.
+ * Represents a file uploaded from a client side form.
*
- * @author Howard Lewis Ship
- * @since 1.0.8
- */
+ * @author Howard Lewis Ship
+ * @since 1.0.8
+ *
+ **/
public interface IUploadFile
{
+ /**
+ * Returns the name of the file that was uploaded. This
+ * is just the filename portion of the complete path.
+ *
+ **/
+
+ public String getFileName();
+
+ /**
+ * Returns the complete path, as reported by the client
+ * browser. Different browsers report different things
+ * here.
+ *
+ *
+ * @since 2.0.4
+ *
+ **/
+
+ public String getFilePath();
+
+ /**
+ * Returns an input stream of the content of the file. There is no guarantee
+ * that this stream will be valid after the end of the current request cycle,
+ * so it should be processed immediately.
+ *
+ * <p>As of release 1.0.8, this will be a a {@link java.io.ByteArrayInputStream},
+ * but that, too, may change (a future implementation may upload the stream
+ * to a temporary file and return an input stream from that).
+ *
+ **/
+ public InputStream getStream();
+
/**
- * Returns the name of the file that was uploaded. This is just the filename
- * portion of the complete path.
- */
-
- public String getFileName();
-
- /**
- * Returns the complete path, as reported by the client browser. Different
- * browsers report different things here.
+ * Returns the MIME type specified when the file was uploaded. May return null
+ * if the content type is not known.
*
- * @since 2.0.4
- */
-
- public String getFilePath();
-
- /**
- * Returns an input stream of the content of the file. There is no guarantee
- * that this stream will be valid after the end of the current request
- * cycle, so it should be processed immediately.
- * <p>
- * As of release 1.0.8, this will be a a
- * {@link java.io.ByteArrayInputStream}, but that, too, may change (a
- * future implementation may upload the stream to a temporary file and
- * return an input stream from that).
- */
-
- public InputStream getStream();
-
- /**
- * Returns the MIME type specified when the file was uploaded. May return
- * null if the content type is not known.
+ * @since 2.2
*
- * @since 2.2
- */
-
+ **/
+
public String getContentType();
-
+
/**
- * Writes the content of the file to a known location. This should be
- * invoked at most once. In a standard implementation based on Jakarta
- * FileUpload, this will often be implemented efficiently as a file rename.
+ * Writes the content of the file to a known location. This should
+ * be invoked at most once. In a standard
+ * implementation based on Jakarta FileUpload, this will often
+ * be implemented efficiently as a file rename.
*
* @since 3.0
*/
-
+
public void write(File file);
-
+
/**
- * Returns true if the uploaded content is in memory. False generally means
- * the content is stored in a temporary file.
+ * Returns true if the uploaded content is in memory. False generally
+ * means the content is stored in a temporary file.
*/
-
+
public boolean isInMemory();
-
+
/**
* Returns the size, in bytes, of the uploaded content.
*
* @since 3.0
- */
-
- public long getSize();
-}
+ **/
+
+ public long getSize();
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/resolver/AbstractSpecificationResolver.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/resolver/AbstractSpecificationResolver.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/resolver/AbstractSpecificationResolver.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/resolver/AbstractSpecificationResolver.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -20,22 +20,23 @@
import org.apache.tapestry.spec.IComponentSpecification;
/**
- * Base class for resolving a
- * {@link org.apache.tapestry.spec.IComponentSpecification}for a particular
- * page or component, within a specified {@link org.apache.tapestry.INamespace}.
- * In some cases, a search is necessary.
+ * Base class for resolving a {@link org.apache.tapestry.spec.IComponentSpecification}for a
+ * particular page or component, within a specified {@link org.apache.tapestry.INamespace}. In some
+ * cases, a search is necessary.
*
* @author Howard Lewis Ship
* @since 3.0
*/
-public class AbstractSpecificationResolver {
-
+public class AbstractSpecificationResolver
+{
+ /** Set by resolve() */
private INamespace _namespace;
+ /** Set by resolve() */
private IComponentSpecification _specification;
- /** Set by container. */
+ /** Set by container */
private ISpecificationSource _specificationSource;
private ISpecificationResolverDelegate _delegate;
@@ -44,7 +45,7 @@
private Resource _contextRoot;
- /** Initialized in initializeService(). */
+ /** Initialized in initializeService() */
private Resource _webInfLocation;
@@ -54,15 +55,13 @@
{
_webInfLocation = _contextRoot.getRelativeResource("WEB-INF/");
- _webInfAppLocation = _webInfLocation.getRelativeResource(_applicationId
- + "/");
+ _webInfAppLocation = _webInfLocation.getRelativeResource(_applicationId + "/");
}
/**
- * Returns the {@link ISpecificationResolverDelegate}instance registered in
- * the application specification as extension
- * {@link Tapestry#SPECIFICATION_RESOLVER_DELEGATE_EXTENSION_NAME}, or null
- * if no such extension exists.
+ * Returns the {@link ISpecificationResolverDelegate}instance registered in the application
+ * specification as extension {@link Tapestry#SPECIFICATION_RESOLVER_DELEGATE_EXTENSION_NAME},
+ * or null if no such extension exists.
*/
public ISpecificationResolverDelegate getDelegate()
@@ -121,8 +120,8 @@
}
/**
- * Returns the location of the application-specific subdirectory, under
- * /WEB-INF/, in the servlet context.
+ * Returns the location of the application-specific subdirectory, under /WEB-INF/, in the
+ * servlet context.
*/
protected Resource getWebInfAppLocation()
@@ -140,8 +139,7 @@
}
/**
- * Invoked in subclass to set the final specification the initial inputs are
- * resolved to.
+ * Invoked in subclass to set the final specification the initial inputs are resolved to.
*/
protected void setSpecification(IComponentSpecification specification)
@@ -192,17 +190,17 @@
/**
* @since 4.0
*/
- protected INamespace findNamespaceForId(INamespace containerNamespace,
- String libraryId)
+ protected INamespace findNamespaceForId(INamespace containerNamespace, String libraryId)
{
- if (libraryId == null) return containerNamespace;
-
+ if (libraryId == null)
+ return containerNamespace;
+
if (libraryId.equals(INamespace.APPLICATION_NAMESPACE))
return getApplicationNamespace();
-
+
if (libraryId.equals(INamespace.FRAMEWORK_NAMESPACE))
return getFrameworkNamespace();
-
+
return containerNamespace.getChildNamespace(libraryId);
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/resolver/ResolverMessages.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/resolver/ResolverMessages.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/resolver/ResolverMessages.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/resolver/ResolverMessages.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@
import org.apache.hivemind.HiveMind;
import org.apache.hivemind.Location;
-import org.apache.hivemind.Messages;
import org.apache.hivemind.Resource;
import org.apache.hivemind.impl.MessageFormatter;
import org.apache.tapestry.INamespace;
@@ -28,68 +27,65 @@
* @author Howard Lewis Ship
* @since 4.0
*/
-final class ResolverMessages
+class ResolverMessages
{
-
- private final static Messages MESSAGES = new MessageFormatter(ResolverMessages.class);
-
- /** @since 4.1 */
- private ResolverMessages()
- {
- }
+ private final static MessageFormatter _formatter = new MessageFormatter(ResolverMessages.class);
static String noSuchComponentType(String type, INamespace namespace)
{
- return MESSAGES.format("no-such-component-type", type, namespace);
+ return _formatter.format("no-such-component-type", type, namespace);
}
static String noSuchPage(String name, INamespace namespace)
{
- return MESSAGES.format("no-such-page", name, namespace.getNamespaceId());
+ return _formatter.format("no-such-page", name, namespace.getNamespaceId());
}
static String resolvingComponent(String type, INamespace namespace)
{
- return MESSAGES.format("resolving-component", type, namespace);
+ return _formatter.format("resolving-component", type, namespace);
}
static String checkingResource(Resource resource)
{
- return MESSAGES.format("checking-resource", resource);
+ return _formatter.format("checking-resource", resource);
}
- static String installingComponent(String type, INamespace namespace, IComponentSpecification specification)
+ static String installingComponent(String type, INamespace namespace,
+ IComponentSpecification specification)
{
- return MESSAGES.format("installing-component", type, namespace, specification);
+ return _formatter.format("installing-component", type, namespace, specification);
}
- static String installingPage(String pageName, INamespace namespace, IComponentSpecification specification)
+ static String installingPage(String pageName, INamespace namespace,
+ IComponentSpecification specification)
{
- return MESSAGES.format("installing-page", pageName, namespace, specification);
+ return _formatter.format("installing-page", pageName, namespace, specification);
}
static String resolvingPage(String pageName, INamespace namespace)
{
- return MESSAGES.format("resolving-page", pageName, namespace);
+ return _formatter.format("resolving-page", pageName, namespace);
}
static String foundFrameworkPage(String pageName)
{
- return MESSAGES.format("found-framework-page", pageName);
+ return _formatter.format("found-framework-page", pageName);
}
static String foundHTMLTemplate(Resource resource)
{
- return MESSAGES.format("found-html-template", resource);
+ return _formatter.format("found-html-template", resource);
}
public static String componentIsDeprecated(String componentType, Location location)
{
- return MESSAGES.format("component-is-deprecated", componentType, HiveMind.getLocationString(location));
+ return _formatter.format("component-is-deprecated", componentType, HiveMind
+ .getLocationString(location));
}
static String webInfNotAllowed(String simpleName)
{
- return MESSAGES.format("web-inf-not-allowed", simpleName);
+ return _formatter.format("web-inf-not-allowed", simpleName);
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/AbstractToken.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/AbstractToken.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/AbstractToken.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/AbstractToken.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -30,7 +30,6 @@
abstract class AbstractToken implements IScriptToken
{
-
private List _tokens;
private Location _location;
@@ -47,25 +46,27 @@
public void addToken(IScriptToken token)
{
- if (_tokens == null) _tokens = new ArrayList();
+ if (_tokens == null)
+ _tokens = new ArrayList();
_tokens.add(token);
}
/**
- * Invokes {@link IScriptToken#write(StringBuffer,ScriptSession)}on each
- * child token (if there are any).
+ * Invokes {@link IScriptToken#write(StringBuffer,ScriptSession)}on each child token (if there
+ * are any).
*/
protected void writeChildren(StringBuffer buffer, ScriptSession session)
{
- if (_tokens == null) return;
+ if (_tokens == null)
+ return;
Iterator i = _tokens.iterator();
- while(i.hasNext())
+ while (i.hasNext())
{
- IScriptToken token = (IScriptToken)i.next();
+ IScriptToken token = (IScriptToken) i.next();
token.write(buffer, session);
}
@@ -98,7 +99,7 @@
{
try
{
- Boolean b = (Boolean)session.evaluate(expression, Boolean.class);
+ Boolean b = (Boolean) session.evaluate(expression, Boolean.class);
return b.booleanValue();
}
@@ -107,4 +108,4 @@
throw new ApplicationRuntimeException(ex.getMessage(), _location, ex);
}
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/AbstractTokenRule.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/AbstractTokenRule.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/AbstractTokenRule.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/AbstractTokenRule.java Sat Mar 11 12:54:27 2006
@@ -19,48 +19,47 @@
import org.apache.tapestry.util.xml.RuleDirectedParser;
/**
- * Base class for the rules that build
- * {@link org.apache.tapestry.script.IScriptToken}s. Used with classes that can
- * contain a mix of text and elements (those that accept "full content").
+ * Base class for the rules that build {@link org.apache.tapestry.script.IScriptToken}s.
+ * Used with classes that can contain a mix of text and elements (those that
+ * accept "full content").
*
+ *
* @author Howard Lewis Ship
* @since 3.0
- */
+ **/
abstract class AbstractTokenRule extends BaseRule
{
- private static final int STATE_START = 0;
- private static final int STATE_DOLLAR = 1;
- private static final int STATE_COLLECT_EXPRESSION = 2;
-
/**
* Adds a token to its parent, the top object on the stack.
*/
protected void addToParent(RuleDirectedParser parser, IScriptToken token)
{
- IScriptToken parent = (IScriptToken)parser.peek();
+ IScriptToken parent = (IScriptToken) parser.peek();
parent.addToken(token);
}
/**
- * Peeks at the top object on the stack (which must be a
- * {@link IScriptToken}), and converts the text into a series of
- * {@link org.apache.tapestry.script.StaticToken} and
+ * Peeks at the top object on the stack (which must be a {@link IScriptToken}),
+ * and converts the text into a series of {@link org.apache.tapestry.script.StaticToken} and
* {@link org.apache.tapestry.script.InsertToken}s.
*/
public void content(RuleDirectedParser parser, String content)
{
- IScriptToken token = (IScriptToken)parser.peek();
+ IScriptToken token = (IScriptToken) parser.peek();
addTextTokens(token, content, parser.getLocation());
}
+ private static final int STATE_START = 0;
+ private static final int STATE_DOLLAR = 1;
+ private static final int STATE_COLLECT_EXPRESSION = 2;
+
/**
- * Parses the provided text and converts it into a series of
- * {@link IScriptToken}s.
+ * Parses the provided text and converts it into a series of
*/
protected void addTextTokens(IScriptToken token, String text, Location location)
{
@@ -73,110 +72,117 @@
int i = 0;
int braceDepth = 0;
- while(i < buffer.length)
+ while (i < buffer.length)
{
char ch = buffer[i];
- switch(state)
+ switch (state)
{
- case STATE_START:
+ case STATE_START :
- if (ch == '$')
- {
- state = STATE_DOLLAR;
+ if (ch == '$')
+ {
+ state = STATE_DOLLAR;
+ i++;
+ continue;
+ }
+
+ blockLength++;
i++;
continue;
- }
-
- blockLength++;
- i++;
- continue;
- case STATE_DOLLAR:
+ case STATE_DOLLAR :
- if (ch == '{')
- {
- state = STATE_COLLECT_EXPRESSION;
- i++;
-
- expressionStart = i;
- expressionLength = 0;
- braceDepth = 1;
+ if (ch == '{')
+ {
+ state = STATE_COLLECT_EXPRESSION;
+ i++;
- continue;
- }
+ expressionStart = i;
+ expressionLength = 0;
+ braceDepth = 1;
- // The '$' was just what it was, not the start of a ${}
- // expression
- // block, so include it as part of the static text block.
+ continue;
+ }
- blockLength++;
+ // The '$' was just what it was, not the start of a ${} expression
+ // block, so include it as part of the static text block.
- state = STATE_START;
- continue;
+ blockLength++;
- case STATE_COLLECT_EXPRESSION:
+ state = STATE_START;
+ continue;
- if (ch != '}')
- {
- if (ch == '{') braceDepth++;
+ case STATE_COLLECT_EXPRESSION :
- i++;
- expressionLength++;
- continue;
- }
+ if (ch != '}')
+ {
+ if (ch == '{')
+ braceDepth++;
- braceDepth--;
+ i++;
+ expressionLength++;
+ continue;
+ }
- if (braceDepth > 0)
- {
- i++;
- expressionLength++;
- continue;
- }
+ braceDepth--;
- // Hit the closing brace of an expression.
+ if (braceDepth > 0)
+ {
+ i++;
+ expressionLength++;
+ continue;
+ }
- // Degenerate case: the string "${}".
+ // Hit the closing brace of an expression.
- if (expressionLength == 0) blockLength += 3;
+ // Degenerate case: the string "${}".
- if (blockLength > 0) token.addToken(constructStatic(text, blockStart, blockLength, location));
+ if (expressionLength == 0)
+ blockLength += 3;
- if (expressionLength > 0)
- {
- String expression = text.substring(expressionStart, expressionStart + expressionLength);
+ if (blockLength > 0)
+ token.addToken(constructStatic(text, blockStart, blockLength, location));
- token.addToken(new InsertToken(expression, location));
- }
+ if (expressionLength > 0)
+ {
+ String expression =
+ text.substring(expressionStart, expressionStart + expressionLength);
- i++;
- blockStart = i;
- blockLength = 0;
+ token.addToken(new InsertToken(expression, location));
+ }
- // And drop into state start
+ i++;
+ blockStart = i;
+ blockLength = 0;
- state = STATE_START;
+ // And drop into state start
- continue;
+ state = STATE_START;
- default:
- throw new IllegalStateException();
+ continue;
}
}
- // OK, to handle the end. Couple of degenerate cases where
+ // OK, to handle the end. Couple of degenerate cases where
// a ${...} was incomplete, so we adust the block length.
- if (state == STATE_DOLLAR) blockLength++;
+ if (state == STATE_DOLLAR)
+ blockLength++;
- if (state == STATE_COLLECT_EXPRESSION) blockLength += expressionLength + 2;
+ if (state == STATE_COLLECT_EXPRESSION)
+ blockLength += expressionLength + 2;
- if (blockLength > 0) token.addToken(constructStatic(text, blockStart, blockLength, location));
+ if (blockLength > 0)
+ token.addToken(constructStatic(text, blockStart, blockLength, location));
}
- private IScriptToken constructStatic(String text, int blockStart, int blockLength, Location location)
+ private IScriptToken constructStatic(
+ String text,
+ int blockStart,
+ int blockLength,
+ Location location)
{
String literal = text.substring(blockStart, blockStart + blockLength);
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/BodyToken.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/BodyToken.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/BodyToken.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/BodyToken.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -16,37 +16,39 @@
import org.apache.hivemind.Location;
+
/**
- * Generates a String from its child tokens, then applies it to
- * {@link ScriptSessionImpl#setBody(String)}.
+ * Generates a String from its child tokens, then applies it
+ * to {@link ScriptSessionImpl#setBody(String)}.
+ *
+ * @author Howard Lewis Ship
+ * @since 0.2.9
*
- * @author Howard Lewis Ship
- * @since 0.2.9
- */
+ **/
class BodyToken extends AbstractToken
{
-
private int _bufferLengthHighwater = 100;
- public BodyToken(Location location)
- {
- super(location);
- }
+ public BodyToken(Location location)
+ {
+ super(location);
+ }
public void write(StringBuffer buffer, ScriptSession session)
{
- if (buffer != null) throw new IllegalArgumentException();
+ if (buffer != null)
+ throw new IllegalArgumentException();
buffer = new StringBuffer(_bufferLengthHighwater);
writeChildren(buffer, session);
- session.addBodyScript(buffer.toString());
+ session.addBodyScript(buffer.toString());
// Store the buffer length from this run for the next run, since its
// going to be approximately the right size.
_bufferLengthHighwater = Math.max(_bufferLengthHighwater, buffer.length());
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IScriptToken.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IScriptToken.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IScriptToken.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IScriptToken.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -16,31 +16,35 @@
import org.apache.hivemind.Locatable;
+
/**
- * Defines the responsibilities of a template token used by a
- * {@link org.apache.tapestry.IScript}.
+ * Defines the responsibilities of a template token used by a
+ * {@link org.apache.tapestry.IScript}.
+ *
+ * @author Howard Lewis Ship
*
- * @author Howard Lewis Ship
- */
+ **/
public interface IScriptToken extends Locatable
{
+ /**
+ * Invoked to have the token
+ * add its text to the buffer. A token may need access
+ * to the symbols in order to produce its output.
+ *
+ * <p>Top level tokens (such as BodyToken) can expect that
+ * buffer will be null.
+ *
+ **/
+
+ public void write(StringBuffer buffer, ScriptSession session);
+
+ /**
+ * Invoked during parsing to add the token parameter as a child
+ * of this token.
+ *
+ * @since 0.2.9
+ **/
- /**
- * Invoked to have the token add its text to the buffer. A token may need
- * access to the symbols in order to produce its output.
- * <p>
- * Top level tokens (such as BodyToken) can expect that buffer will be null.
- */
-
- public void write(StringBuffer buffer, ScriptSession session);
-
- /**
- * Invoked during parsing to add the token parameter as a child of this
- * token.
- *
- * @since 0.2.9
- */
-
- public void addToken(IScriptToken token);
-}
+ public void addToken(IScriptToken token);
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IfRule.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IfRule.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IfRule.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IfRule.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -18,15 +18,15 @@
import org.xml.sax.Attributes;
/**
- * Constructs an {@link org.apache.tapestry.script.IfToken} from an <if>
- * or <if-not> element, which contains full content.
- *
+ * Constructs an {@link org.apache.tapestry.script.IfToken}
+ * from an <if> or <if-not> element, which
+ * contains full content.
+ *
* @author Howard Lewis Ship
* @since 3.0
*/
class IfRule extends AbstractTokenRule
{
-
private boolean _condition;
public IfRule(boolean condition)
@@ -43,15 +43,14 @@
{
String expression = getAttribute(attributes, "expression");
- if (expression == null) expression = getAttribute(attributes, "property-path"); // 1.0,
- // 1.1
- // DTD
-
- IScriptToken token = new IfToken(_condition, expression, parser.getLocation());
-
- addToParent(parser, token);
-
- parser.push(token);
+ if (expression == null)
+ expression = getAttribute(attributes, "property-path"); // 1.0, 1.1 DTD
+
+ IScriptToken token = new IfToken(_condition, expression, parser.getLocation());
+
+ addToParent(parser, token);
+
+ parser.push(token);
}
}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IncludeScriptRule.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IncludeScriptRule.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IncludeScriptRule.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IncludeScriptRule.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -19,9 +19,9 @@
import org.xml.sax.Attributes;
/**
- * Constructs an {@link org.apache.tapestry.script.IncludeScriptToken} from a
- * <include-script> element, which contains no content.
- *
+ * Constructs an {@link org.apache.tapestry.script.IncludeScriptToken}
+ * from a <include-script> element, which contains no content.
+ *
* @author Howard Lewis Ship
* @since 3.0
*/
@@ -31,10 +31,10 @@
public void startElement(RuleDirectedParser parser, Attributes attributes)
{
String path = getAttribute(attributes, "resource-path");
-
+
IncludeScriptToken token = new IncludeScriptToken(path, parser.getLocation());
- IScriptToken parent = (IScriptToken)parser.peek();
+ IScriptToken parent = (IScriptToken) parser.peek();
parent.addToken(token);
}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IncludeScriptToken.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IncludeScriptToken.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IncludeScriptToken.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IncludeScriptToken.java Sat Mar 11 12:54:27 2006
@@ -14,9 +14,9 @@
package org.apache.tapestry.script;
+import org.apache.hivemind.util.ClasspathResource;
import org.apache.hivemind.Location;
import org.apache.hivemind.Resource;
-import org.apache.hivemind.util.ClasspathResource;
/**
* A token for included scripts.
@@ -59,4 +59,4 @@
session.addExternalScript(includeLocation);
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/InitRule.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/InitRule.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/InitRule.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/InitRule.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -18,9 +18,10 @@
import org.xml.sax.Attributes;
/**
- * Constructs an {@link org.apache.tapestry.script.InitToken} from an
- * <initialization> element, which contains full content.
- *
+ * Constructs an {@link org.apache.tapestry.script.InitToken}
+ * from an <initialization> element, which
+ * contains full content.
+ *
* @author Howard Lewis Ship
* @since 3.0
*/
@@ -29,16 +30,16 @@
public void endElement(RuleDirectedParser parser)
{
- parser.pop();
+ parser.pop();
}
public void startElement(RuleDirectedParser parser, Attributes attributes)
{
- IScriptToken token = new InitToken(parser.getLocation());
-
- addToParent(parser, token);
-
- parser.push(token);
+ IScriptToken token = new InitToken(parser.getLocation());
+
+ addToParent(parser, token);
+
+ parser.push(token);
}
}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/ScriptParser.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/ScriptParser.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/ScriptParser.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/ScriptParser.java Sat Mar 11 12:54:27 2006
@@ -50,6 +50,8 @@
public class ScriptParser
{
+ private RuleDirectedParser _parser;
+
public static final String SCRIPT_DTD_1_0_PUBLIC_ID = "-//Primix Solutions//Tapestry Script 1.0//EN";
public static final String SCRIPT_DTD_1_1_PUBLIC_ID = "-//Howard Ship//Tapestry Script 1.1//EN";
@@ -59,8 +61,6 @@
/** @since 3.0 */
public static final String SCRIPT_DTD_3_0_PUBLIC_ID = "-//Apache Software Foundation//Tapestry Script Specification 3.0//EN";
- private RuleDirectedParser _parser;
-
public ScriptParser(ClassResolver resolver, ExpressionEvaluator evaluator,
ValueConverter valueConverter)
{
@@ -105,4 +105,4 @@
return (IScript) _parser.parse(resourceLocation);
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/StaticToken.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/StaticToken.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/StaticToken.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/StaticToken.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -16,27 +16,29 @@
import org.apache.hivemind.Location;
+
/**
- * A token for static portions of the template.
- *
- * @author Howard Lewis Ship
- */
+ * A token for static portions of the template.
+ *
+ * @author Howard Lewis Ship
+ *
+ **/
class StaticToken extends AbstractToken
{
-
private String _text;
StaticToken(String text, Location location)
{
- super(location);
-
+ super(location);
+
_text = text;
}
/**
- * Writes the text to the writer.
- */
+ * Writes the text to the writer.
+ *
+ **/
public void write(StringBuffer buffer, ScriptSession session)
{
@@ -47,4 +49,4 @@
{
// Should never be invoked.
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/AbsoluteURLBuilder.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/AbsoluteURLBuilder.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/AbsoluteURLBuilder.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/AbsoluteURLBuilder.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -20,15 +20,14 @@
* @author Howard M. Lewis Ship
* @since 4.0
*/
-public interface AbsoluteURLBuilder {
-
+public interface AbsoluteURLBuilder
+{
/**
- * Constructs a URL from the given URI (that is, service path), schema,
- * server and port.
+ * Constructs a URL from the given URI (that is, service path), schema, server and port.
*
* @param URI
- * either a complete URL (that is, containing a colon), in which
- * case it is returned unchanged, or the path within the server.
+ * either a complete URL (that is, containing a colon), in which case it is returned
+ * unchanged, or the path within the server.
* @param scheme
* scheme to prefix URI with
* @param server
@@ -36,12 +35,11 @@
* @param port
* to suffix the server with (unless the URI begins with "//")
*/
- String constructURL(String URI, String scheme, String server, int port);
+ public String constructURL(String URI, String scheme, String server, int port);
/**
- * Constructs a URL, defaulting scheme, server and port to the values for
- * the current request.
+ * Constructs a URL, defaulting scheme, server and port to the values for the current request.
*/
- String constructURL(String URI);
-}
+ public String constructURL(String URI);
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/ApplicationGlobals.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/ApplicationGlobals.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/ApplicationGlobals.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/ApplicationGlobals.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -23,36 +23,33 @@
import org.apache.tapestry.web.WebContext;
/**
- * A "global" holder for various services and configurations. In many cases,
- * these values end up as properties of the
- * {@link org.apache.tapestry.services.Infrastructure}. The servlet and portlet
- * implementations differentiate themselves by storing different values into
- * these properties.
+ * A "global" holder for various services and configurations. In many cases, these values end up as
+ * properties of the {@link org.apache.tapestry.services.Infrastructure}. The servlet and portlet
+ * implementations differentiate themselves by storing different values into these properties.
*
* @author Howard Lewis Ship
* @since 4.0
*/
public interface ApplicationGlobals
{
-
/**
- * Invoked by the (indirectly) by the servlet at init(), after parsing the
- * application specification.
+ * Invoked by the (indirectly) by the servlet at init(), after parsing the application
+ * specification.
*/
- void storeActivator(WebActivator activator);
+ public void storeActivator(WebActivator activator);
- void storeSpecification(IApplicationSpecification applicationSpecification);
+ public void storeSpecification(IApplicationSpecification applicationSpecification);
/**
* Invoked (indirectly) by the servlet at init().
*/
- void storeServletContext(ServletContext context);
+ public void storeServletContext(ServletContext context);
/**
* Invoked (indirectly) by the servlet at init().
*/
- void storeWebContext(WebContext context);
+ public void storeWebContext(WebContext context);
/**
* Returns the previously stored context.
@@ -60,36 +57,35 @@
* @see #store(WebContext)}.
*/
- WebContext getWebContext();
+ public WebContext getWebContext();
/**
* Returns the previously stored context.
*
* @see #storeServletContext(ServletContext)
*/
- ServletContext getServletContext();
+ public ServletContext getServletContext();
- WebActivator getActivator();
+ public WebActivator getActivator();
- IApplicationSpecification getSpecification();
+ public IApplicationSpecification getSpecification();
- String getActivatorName();
+ public String getActivatorName();
/**
- * Stores the default set of engine service definitions. Application
- * services override factory services with the same
- * {@link org.apache.tapestry.engine.IEngineService#getName()name}.
+ * Stores the default set of engine service definitions. Application services override factory
+ * services with the same {@link org.apache.tapestry.engine.IEngineService#getName()name}.
*
* @param factoryServices
* List of {@link org.apache.tapestry.engine.IEngineService}.
*/
- void storeFactoryServices(List factoryServices);
+ public void storeFactoryServices(List factoryServices);
/**
* Returns the factory default services as a List of
* {@link org.apache.tapestry.engine.IEngineService}.
*/
- List getFactoryServices();
-}
+ public List getFactoryServices();
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/EngineFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/EngineFactory.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/EngineFactory.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/EngineFactory.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -20,15 +20,14 @@
/**
* Responsible for creating new instance of {@link org.apache.tapestry.IEngine}.
- *
+ *
* @author Howard Lewis Ship
* @since 4.0
*/
public interface EngineFactory
{
-
- /**
- * Creates and initializes a new engine instance for the specified locale.
- */
- IEngine constructNewEngineInstance(Locale locale);
+ /**
+ * Creates and initializes a new engine instance for the specified locale.
+ */
+ public IEngine constructNewEngineInstance(Locale locale);
}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/EngineManager.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/EngineManager.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/EngineManager.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/EngineManager.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -17,26 +17,24 @@
import org.apache.tapestry.IEngine;
/**
- * Service responsible for obtaining instances of
- * {@link org.apache.tapestry.IEngine} to service the current request. An engine
- * service may be retrieved from a pool, or extracted from the HttpSession.
- * After the request is processed, the engine is re-stored into the HttpSession
- * (if stateful) or back into the pool (if not stateful).
- *
+ * Service responsible for obtaining instances of {@link org.apache.tapestry.IEngine}
+ * to service the current request. An engine service may be retrieved from a pool, or extracted
+ * from the HttpSession. After the request is processed, the engine is re-stored into the
+ * HttpSession (if stateful) or back into the pool (if not stateful).
+ *
* @author Howard Lewis Ship
* @since 4.0
*/
public interface EngineManager
{
-
- /**
- * Locates or creates an engine instance for the current request.
- */
- IEngine getEngineInstance();
-
- /**
- * Store the engine back at the end of the current request.
- */
-
- void storeEngineInstance(IEngine engine);
+ /**
+ * Locates or creates an engine instance for the current request.
+ */
+ IEngine getEngineInstance();
+
+ /**
+ * Store the engine back at the end of the current request.
+ */
+
+ void storeEngineInstance(IEngine engine);
}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/ObjectPool.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/ObjectPool.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/ObjectPool.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/ObjectPool.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,24 +14,24 @@
package org.apache.tapestry.services;
+
/**
- * An pool for objects. Objects may be stored in a Pool for later reuse.
- *
+ * An pool for objects. Objects may be stored in a Pool for later reuse.
+ *
* @author Howard Lewis Ship
* @since 4.0
*/
public interface ObjectPool
{
-
- /**
- * Returns an object from the pool, previously stored with the given key.
- * May return null if no such object exists.
- */
- Object get(Object key);
-
- /**
- * Stores an object into the pool for later retrieval with the provided key.
- */
-
- void store(Object key, Object value);
+ /**
+ * Returns an object from the pool, previously stored with the given key. May
+ * return null if no such object exists.
+ */
+ Object get(Object key);
+
+ /**
+ * Stores an object into the pool for later retrieval with the provided key.
+ */
+
+ void store(Object key, Object value);
}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/ResetEventHub.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/ResetEventHub.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/ResetEventHub.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/ResetEventHub.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -19,19 +19,18 @@
/**
* Service interface for a source of <b>reset</b> events; this events are used
* to inform other services that they should discard any cached data.
- *
+ *
* @author Howard Lewis Ship
* @since 4.0
*/
public interface ResetEventHub
{
-
public void addResetEventListener(ResetEventListener l);
public void removeResetEventListener(ResetEventListener l);
- /**
- * Notifies registered listeners.
- */
+ /**
+ * Notifies registered listeners.
+ */
public void fireResetEvent();
}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/TemplateSource.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/TemplateSource.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/TemplateSource.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/TemplateSource.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -19,55 +19,54 @@
import org.apache.tapestry.parse.ComponentTemplate;
/**
- * A source of localized HTML templates for components. The cache is the means
- * of access for components to load thier templates, which they need not do
- * until just before rendering.
- * <p>
- * The template cache must be able to locate and parse templates as needed. It
- * may maintain templates in memory.
- *
+ * A source of localized HTML templates for components.
+ * The cache is the means of access for components to load thier templates,
+ * which they need not do until just before rendering.
+ *
+ * <p>The template cache must be able to locate and parse templates as needed.
+ * It may maintain templates in memory.
+ *
* @author Howard Ship
*/
public interface TemplateSource
{
-
/**
- * Name of an {@link org.apache.tapestry.IAsset} of a component that
- * provides the template for the asset. This overrides the default (that the
- * template is in the same directory as the specification). This allows
- * pages or component templates to be located properly, relative to static
- * assets (such as images and stylesheets).
+ * Name of an {@link org.apache.tapestry.IAsset} of a component that provides the template
+ * for the asset. This overrides the default (that the template is in
+ * the same directory as the specification). This allows
+ * pages or component templates to be located properly, relative to static
+ * assets (such as images and stylesheets).
+ *
+ * @since 2.2
*
- * @since 2.2
*/
-
- String TEMPLATE_ASSET_NAME = "$template";
+
+ public static final String TEMPLATE_ASSET_NAME = "$template";
/**
- * Name of the component parameter that will be automatically bound to the
- * HTML tag that is used to insert the component in the parent template. If
- * the parent component does not have a template (i.e. it extends
- * AbstractComponent, not BaseComponent), then this parameter is bound to
- * null.
+ * Name of the component parameter that will be automatically bound to
+ * the HTML tag that is used to insert the component in the parent template.
+ * If the parent component does not have a template (i.e. it extends
+ * AbstractComponent, not BaseComponent), then this parameter is bound to null.
+ *
+ * @since 3.0
*
- * @since 3.0
*/
-
- String TEMPLATE_TAG_PARAMETER_NAME = "templateTag";
-
+
+ public static final String TEMPLATE_TAG_PARAMETER_NAME = "templateTag";
+
/**
- * Locates the template for the component.
+ * Locates the template for the component.
+ *
+ * @param cycle The request cycle loading the template; this is required
+ * in some cases when the template is loaded from an {@link org.apache.tapestry.IAsset}.
+ * @param component The component for which a template should be loaded.
+ *
+ * @throws org.apache.tapestry.ApplicationRuntimeException if the resource cannot be located or loaded.
*
- * @param cycle
- * The request cycle loading the template; this is required in
- * some cases when the template is loaded from an
- * {@link org.apache.tapestry.IAsset}.
- * @param component
- * The component for which a template should be loaded.
- * @throws org.apache.tapestry.ApplicationRuntimeException
- * if the resource cannot be located or loaded.
*/
- ComponentTemplate getTemplate(IRequestCycle cycle, IComponent component);
-}
+ public ComponentTemplate getTemplate(IRequestCycle cycle, IComponent component);
+
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/WebRequestServicer.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/WebRequestServicer.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/WebRequestServicer.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/WebRequestServicer.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2005, 2006 The Apache Software Foundation
+// Copyright 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -20,17 +20,14 @@
import org.apache.tapestry.web.WebResponse;
/**
- * Interface for objects that can handle web requests; few classes implement
- * this, instead they implement
- * {@link org.apache.tapestry.services.WebRequestServicerFilter} and plug into
- * the tapestry.request.WebRequestServicerPipeline configuration point.
+ * Interface for objects that can handle web requests; few classes implement this, instead they
+ * implement {@link org.apache.tapestry.services.WebRequestServicerFilter} and plug into the
+ * tapestry.request.WebRequestServicerPipeline configuration point.
*
* @author Howard M. Lewis Ship
* @since 4.0
*/
public interface WebRequestServicer
{
-
- void service(WebRequest request, WebResponse response)
- throws IOException;
-}
+ public void service(WebRequest request, WebResponse response) throws IOException;
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/WebRequestServicerFilter.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/WebRequestServicerFilter.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/WebRequestServicerFilter.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/WebRequestServicerFilter.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2005, 2006 The Apache Software Foundation
+// Copyright 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -27,7 +27,6 @@
*/
public interface WebRequestServicerFilter
{
-
- void service(WebRequest request, WebResponse response, WebRequestServicer servicer)
- throws IOException;
-}
+ public void service(WebRequest request, WebResponse response, WebRequestServicer servicer)
+ throws IOException;
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/AbsoluteURLBuilderImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/AbsoluteURLBuilderImpl.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/AbsoluteURLBuilderImpl.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/AbsoluteURLBuilderImpl.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -21,23 +21,24 @@
* @author Howard M. Lewis Ship
* @since 4.0
*/
-public class AbsoluteURLBuilderImpl implements AbsoluteURLBuilder {
-
+public class AbsoluteURLBuilderImpl implements AbsoluteURLBuilder
+{
private WebRequest _request;
- public String constructURL(String URI, String scheme, String server,
- int port)
+ public String constructURL(String URI, String scheme, String server, int port)
{
// Though, really, what does a leading colon with no scheme before it
// mean?
- if (URI.indexOf(':') >= 0) return URI;
+ if (URI.indexOf(':') >= 0)
+ return URI;
StringBuffer buffer = new StringBuffer();
// Should check the length here, first.
- if (URI.length() > 2 && URI.substring(0, 2).equals("//")) {
+ if (URI.length()> 2 && URI.substring(0, 2).equals("//"))
+ {
buffer.append(scheme);
buffer.append(':');
buffer.append(URI);
@@ -48,12 +49,14 @@
buffer.append("://");
buffer.append(server);
- if (port > 0) {
+ if (port > 0)
+ {
buffer.append(':');
buffer.append(port);
}
- if (URI.charAt(0) != '/') buffer.append('/');
+ if (URI.charAt(0) != '/')
+ buffer.append('/');
buffer.append(URI);
@@ -71,7 +74,8 @@
// Some of the Tomcat code indicates that port 443 is the default
// for https, and that needs to be researched.
- if (scheme.equals("http") && port == 80) port = 0;
+ if (scheme.equals("http") && port == 80)
+ port = 0;
return constructURL(URI, scheme, server, port);
}
@@ -80,4 +84,4 @@
{
_request = request;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/AbstractSetupApplicationGlobals.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/AbstractSetupApplicationGlobals.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/AbstractSetupApplicationGlobals.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/AbstractSetupApplicationGlobals.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2005, 2006 The Apache Software Foundation
+// Copyright 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -26,7 +26,8 @@
* @author Howard M. Lewis Ship
* @since 4.0
*/
-public class AbstractSetupApplicationGlobals {
+public class AbstractSetupApplicationGlobals
+{
private ApplicationGlobals _globals;
@@ -55,4 +56,4 @@
{
_infrastructure = infrastructure;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ApplicationGlobalsImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ApplicationGlobalsImpl.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ApplicationGlobalsImpl.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ApplicationGlobalsImpl.java Sat Mar 11 12:54:27 2006
@@ -95,4 +95,4 @@
{
_servletContext = context;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ApplicationSpecificationInitializer.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ApplicationSpecificationInitializer.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ApplicationSpecificationInitializer.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ApplicationSpecificationInitializer.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -37,9 +37,6 @@
*/
public class ApplicationSpecificationInitializer implements ApplicationInitializer
{
-
- public static final String APP_SPEC_PATH_PARAM = "org.apache.tapestry.application-specification";
-
private Log _log;
private ClasspathResourceFactory _classpathResourceFactory;
@@ -48,6 +45,8 @@
private ISpecificationParser _parser;
+ public static final String APP_SPEC_PATH_PARAM = "org.apache.tapestry.application-specification";
+
public void initialize(HttpServlet servlet)
{
IApplicationSpecification spec = null;
@@ -60,7 +59,8 @@
spec = constructStandinSpecification(servlet);
}
- else spec = _parser.parseApplicationSpecification(specResource);
+ else
+ spec = _parser.parseApplicationSpecification(specResource);
_globals.storeActivator(new HttpServletWebActivator(servlet));
_globals.storeSpecification(spec);
@@ -70,7 +70,8 @@
{
String path = servlet.getInitParameter(APP_SPEC_PATH_PARAM);
- if (path != null) return _classpathResourceFactory.newResource(path);
+ if (path != null)
+ return _classpathResourceFactory.newResource(path);
ServletContext context = servlet.getServletContext();
String servletName = servlet.getServletName();
@@ -80,7 +81,8 @@
Resource webInfAppLocation = webInfLocation.getRelativeResource(servletName + "/");
Resource result = check(webInfAppLocation, expectedName);
- if (result != null) return result;
+ if (result != null)
+ return result;
return check(webInfLocation, expectedName);
}
@@ -89,7 +91,8 @@
{
Resource result = resource.getRelativeResource(name);
- if (_log.isDebugEnabled()) _log.debug("Checking for existence of " + result);
+ if (_log.isDebugEnabled())
+ _log.debug("Checking for existence of " + result);
if (result.getResourceURL() != null)
{
@@ -108,8 +111,8 @@
// Pretend the file exists in the most common expected location.
- Resource virtualLocation = new ContextResource(servlet.getServletContext(), "/WEB-INF/" + servletName
- + ".application");
+ Resource virtualLocation = new ContextResource(servlet.getServletContext(), "/WEB-INF/"
+ + servletName + ".application");
result.setSpecificationLocation(virtualLocation);
@@ -137,4 +140,5 @@
{
_parser = parser;
}
-}
+
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/BaseTagWriter.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/BaseTagWriter.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/BaseTagWriter.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/BaseTagWriter.java Sat Mar 11 12:54:27 2006
@@ -60,4 +60,4 @@
writer.println();
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/BindingPrefixContribution.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/BindingPrefixContribution.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/BindingPrefixContribution.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/BindingPrefixContribution.java Sat Mar 11 12:54:27 2006
@@ -49,4 +49,4 @@
{
_prefix = prefix;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/BindingSourceImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/BindingSourceImpl.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/BindingSourceImpl.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/BindingSourceImpl.java Sat Mar 11 12:54:27 2006
@@ -81,4 +81,4 @@
{
_contributions = contributions;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ComponentConstructorFactoryImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ComponentConstructorFactoryImpl.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ComponentConstructorFactoryImpl.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ComponentConstructorFactoryImpl.java Sat Mar 11 12:54:27 2006
@@ -138,4 +138,4 @@
{
_serviceId = serviceId;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ComponentMessages.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ComponentMessages.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ComponentMessages.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ComponentMessages.java Sat Mar 11 12:54:27 2006
@@ -53,4 +53,4 @@
{
return _locale;
}
-}
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org