You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2006/01/12 18:13:34 UTC
svn commit: r368410 [1/10] - in
/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry: ./ bean/
binding/ callback/ coerce/ components/ describe/ engine/ engine/state/
enhance/ error/ event/ form/ form/translator/ form/validator/ html/ link/
li...
Author: hlship
Date: Thu Jan 12 09:12:21 2006
New Revision: 368410
URL: http://svn.apache.org/viewcvs?rev=368410&view=rev
Log:
Setup a reasonable checkstyle configuration, and fix a large number of errors and warnings -- this time, properly checked into trunk!
Modified:
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/AbstractComponent.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/AbstractPage.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ApplicationServlet.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/BindingException.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/Constants.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IBeanProvider.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/PageNotFoundException.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/PageRedirectException.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RedirectException.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RenderRewoundException.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/StaleLinkException.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/StaleSessionException.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/Tapestry.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/TapestryConstants.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/TapestryMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/TapestryUtils.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/bean/AbstractBeanInitializer.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/bean/BeanMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/bean/EvenOdd.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/binding/AbstractBinding.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/binding/AbstractBindingFactory.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/binding/BindingMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/callback/CallbackMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/CoerceMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/IteratorToListConverter.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/StringConvertedPropertySelectionModel.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/TypeConverter.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/TypeConverterContribution.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/TypeConverterWrapper.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/ValueConverter.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/coerce/ValueConverterImpl.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/components/BlockRenderer.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/components/ComponentMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/components/Delegator.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/components/ForBean.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/components/Foreach.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/DescribeMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/AbstractEngine.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/ActionService.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/ActionServiceParameter.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/EngineMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/EngineUtils.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/RequestCycleEnvironment.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/state/ApplicationStateManager.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/state/ApplicationStateManagerImpl.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/state/StateMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/state/StateObjectFactory.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/state/StateObjectManager.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/state/StateObjectManagerRegistry.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/state/StateObjectPersistenceManager.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/enhance/AbstractPropertyWorker.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/enhance/EnhanceMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/enhance/EnhanceUtils.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/error/ErrorMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/error/StaleLinkExceptionPresenter.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/error/StaleSessionExceptionPresenter.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/event/ObservedChangeEvent.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/event/PageEvent.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/event/ReportStatusEvent.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/AbstractFormComponent.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/AbstractSubmit.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/Form.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/FormEventType.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/FormMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/RadioPropertySelectionRenderer.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/Submit.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/TextArea.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/TextField.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/TranslatedField.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/TranslatedFieldSupport.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/TranslatedFieldSupportImpl.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/Upload.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/ValidatableField.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/ValidatableFieldSupport.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/ValidationMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/translator/Translator.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/validator/Validator.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/validator/ValidatorFactory.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/validator/ValidatorMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/form/validator/ValidatorsBindingFactory.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/HTMLMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/InsertTextMode.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/link/AbstractLinkComponent.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/link/ActionLink.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/link/LinkMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/listener/ListenerMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/markup/AbstractMarkupFilter.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/markup/MarkupFilterUtils.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/markup/MarkupMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/markup/UTFMarkupFilter.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/multipart/MultipartMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/multipart/UploadFormParametersWrapper.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/multipart/UploadPart.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/multipart/ValuePart.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pageload/PageLoader.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pageload/PageloadMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/parse/BindingSetter.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/parse/ParseMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/parse/TemplateParseException.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/parse/TemplateParser.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/parse/TextToken.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/parse/TokenType.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/record/RecordMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/record/RecordUtils.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/request/IUploadFile.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/resolver/AbstractSpecificationResolver.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/resolver/ResolverMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/AbstractToken.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/AbstractTokenRule.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/BodyToken.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IScriptToken.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IfRule.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/IncludeScriptRule.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/InitRule.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/script/StaticToken.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/AbsoluteURLBuilder.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/ApplicationGlobals.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/EngineFactory.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/EngineManager.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/ObjectPool.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/ResetEventHub.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/TemplateSource.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/WebRequestServicer.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/WebRequestServicerFilter.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/AbsoluteURLBuilderImpl.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/AbstractSetupApplicationGlobals.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ApplicationSpecificationInitializer.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ComponentMessagesSourceImpl.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/EngineFactoryImpl.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/EngineServiceOuterProxy.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ExtensionLookupParameter.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ImplMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/TemplateSourceImpl.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/WebContextInitializer.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/WebRequestServicerPipelineBridge.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/spec/ApplicationSpecification.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/spec/BeanLifecycle.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/spec/BindingSpecification.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/spec/IContainedComponent.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/spec/LocatablePropertyHolder.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/spec/SpecMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/test/ScriptMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/util/ComponentAddress.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/util/IdAllocator.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/util/UtilMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/util/exception/ExceptionAnalyzer.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/util/io/DataSqueezerUtil.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/util/io/IoMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/util/text/AsciiCharacterTranslator.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/util/text/DefaultCharacterTranslatorSource.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/util/text/ICharacterTranslator.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/util/text/ICharacterTranslatorSource.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/util/text/LocalizedProperties.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/util/text/LocalizedPropertiesLoader.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/util/text/MarkupCharacterTranslator.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/util/text/WhitespaceMatcher.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/util/xml/DocumentParseException.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/util/xml/IRule.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/util/xml/InvalidStringException.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/valid/AbstractNumericValidator.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/valid/IValidationDelegate.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/valid/NumberValidator.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/valid/UrlValidator.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/valid/ValidField.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/valid/ValidMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/valid/ValidationConstraint.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/valid/ValidationDelegate.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/valid/ValidationStrings.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/valid/ValidatorBinding.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/valid/ValidatorBindingFactory.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/valid/ValidatorException.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/web/LocalizedWebContextResourceFinder.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/web/WebActivator.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/web/WebContext.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/web/WebContextResource.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/web/WebMessages.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/web/WebRequest.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/web/WebResponse.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/web/WebSession.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/web/WebUtils.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/wml/AbstractPostfield.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/wml/GoLinkRenderer.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/wml/Image.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/wml/Input.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/wml/OptionRenderer.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/wml/Timer.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/wml/WMLCharacterTranslatorSource.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/wml/WMLEngine.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/wml/WMLMarkupFilter.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/wml/pages/WMLException.java
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/AbstractComponent.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/AbstractComponent.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/AbstractComponent.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/AbstractComponent.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -40,17 +40,30 @@
* @author Howard Lewis Ship
*/
-public abstract class AbstractComponent extends BaseLocatable implements IComponent
-{
+public abstract class AbstractComponent extends BaseLocatable implements
+ IComponent {
+
+ private static final int MAP_SIZE = 5;
+ private static final int BODY_INIT_SIZE = 5;
+
/**
- * The page that contains the component, possibly itself (if the component is in fact, a page).
+ * Used in place of JDK 1.3's Collections.EMPTY_MAP (which is not available
+ * in JDK 1.2).
+ */
+
+ private static final Map EMPTY_MAP = Collections
+ .unmodifiableMap(new HashMap(1));
+
+ /**
+ * The page that contains the component, possibly itself (if the component
+ * is in fact, a page).
*/
private IPage _page;
/**
- * The component which contains the component. This will only be null if the component is
- * actually a page.
+ * The component which contains the component. This will only be null if the
+ * component is actually a page.
*/
private IComponent _container;
@@ -62,34 +75,25 @@
private String _id;
/**
- * The fully qualified id of this component. This is calculated the first time it is needed,
- * then cached for later.
+ * The fully qualified id of this component. This is calculated the first
+ * time it is needed, then cached for later.
*/
private String _idPath;
- private static final int MAP_SIZE = 5;
-
/**
- * A {@link Map}of all bindings (for which there isn't a corresponding JavaBeans property); the
- * keys are the names of formal and informal parameters.
+ * A {@link Map}of all bindings (for which there isn't a corresponding
+ * JavaBeans property); the keys are the names of formal and informal
+ * parameters.
*/
private Map _bindings;
private Map _components;
- private static final int BODY_INIT_SIZE = 5;
-
private INamespace _namespace;
/**
- * Used in place of JDK 1.3's Collections.EMPTY_MAP (which is not available in JDK 1.2).
- */
-
- private static final Map EMPTY_MAP = Collections.unmodifiableMap(new HashMap(1));
-
- /**
* The number of {@link IRender}objects in the body of this component.
*/
@@ -108,8 +112,8 @@
private Map _assets;
/**
- * A mapping that allows public instance methods to be dressed up as {@link IActionListener}
- * listener objects.
+ * A mapping that allows public instance methods to be dressed up as
+ * {@link IActionListener} listener objects.
*
* @since 1.0.2
*/
@@ -151,8 +155,7 @@
checkActiveLock();
- if (_assets == null)
- _assets = new HashMap(MAP_SIZE);
+ if (_assets == null) _assets = new HashMap(MAP_SIZE);
_assets.put(name, asset);
}
@@ -163,15 +166,15 @@
checkActiveLock();
- if (_components == null)
- _components = new HashMap(MAP_SIZE);
+ if (_components == null) _components = new HashMap(MAP_SIZE);
_components.put(component.getId(), component);
}
/**
- * Adds an element (which may be static text or a component) as a body element of this
- * component. Such elements are rendered by {@link #renderBody(IMarkupWriter, IRequestCycle)}.
+ * Adds an element (which may be static text or a component) as a body
+ * element of this component. Such elements are rendered by
+ * {@link #renderBody(IMarkupWriter, IRequestCycle)}.
*
* @since 2.2
*/
@@ -180,7 +183,8 @@
{
Defense.notNull(element, "element");
- // TODO: Tweak the ordering of operations inside the PageLoader so that this
+ // TODO: Tweak the ordering of operations inside the PageLoader so that
+ // this
// check is allowable. Currently, the component is entering active state
// before it loads its template.
@@ -190,8 +194,7 @@
// allows body. Curently, this is checked by the component
// in render(), which is silly.
- if (_body == null)
- {
+ if (_body == null) {
_body = new IRender[BODY_INIT_SIZE];
_body[0] = element;
@@ -201,8 +204,7 @@
// No more room? Make the array bigger.
- if (_bodyCount == _body.length)
- {
+ if (_bodyCount == _body.length) {
IRender[] newWrapped;
newWrapped = new IRender[_body.length * 2];
@@ -216,8 +218,9 @@
}
/**
- * Invokes {@link #finishLoad()}. Subclasses may overide as needed, but must invoke this
- * implementation. {@link BaseComponent} loads its HTML template.
+ * Invokes {@link #finishLoad()}. Subclasses may overide as needed, but
+ * must invoke this implementation. {@link BaseComponent} loads its HTML
+ * template.
*/
public void finishLoad(IRequestCycle cycle, IPageLoader loader,
@@ -227,63 +230,61 @@
}
/**
- * Converts informal parameters into additional attributes on the curently open tag.
+ * Converts informal parameters into additional attributes on the curently
+ * open tag.
* <p>
- * Invoked from subclasses to allow additional attributes to be specified within a tag (this
- * works best when there is a one-to-one corespondence between an {@link IComponent}and a HTML
- * element.
+ * Invoked from subclasses to allow additional attributes to be specified
+ * within a tag (this works best when there is a one-to-one corespondence
+ * between an {@link IComponent}and a HTML element.
* <p>
- * Iterates through the bindings for this component. Filters out bindings for formal parameters.
+ * Iterates through the bindings for this component. Filters out bindings
+ * for formal parameters.
* <p>
- * For each acceptible key, the value is extracted using {@link IBinding#getObject()}. If the
- * value is null, no attribute is written.
+ * For each acceptible key, the value is extracted using
+ * {@link IBinding#getObject()}. If the value is null, no attribute is
+ * written.
* <p>
- * If the value is an instance of {@link IAsset}, then {@link IAsset#buildURL()}
- * is invoked to convert the asset to a URL.
+ * If the value is an instance of {@link IAsset}, then
+ * {@link IAsset#buildURL()} is invoked to convert the asset to a URL.
* <p>
- * Finally, {@link IMarkupWriter#attribute(String,String)}is invoked with the value (or the
- * URL).
+ * Finally, {@link IMarkupWriter#attribute(String,String)}is invoked with
+ * the value (or the URL).
* <p>
- * The most common use for informal parameters is to support the HTML class attribute (for use
- * with cascading style sheets) and to specify JavaScript event handlers.
+ * The most common use for informal parameters is to support the HTML class
+ * attribute (for use with cascading style sheets) and to specify JavaScript
+ * event handlers.
* <p>
- * Components are only required to generate attributes on the result phase; this can be skipped
- * during the rewind phase.
+ * Components are only required to generate attributes on the result phase;
+ * this can be skipped during the rewind phase.
*/
- protected void renderInformalParameters(IMarkupWriter writer, IRequestCycle cycle)
+ protected void renderInformalParameters(IMarkupWriter writer,
+ IRequestCycle cycle)
{
String attribute;
- if (_bindings == null)
- return;
+ if (_bindings == null) return;
Iterator i = _bindings.entrySet().iterator();
- while (i.hasNext())
- {
- Map.Entry entry = (Map.Entry) i.next();
- String name = (String) entry.getKey();
+ while(i.hasNext()) {
+ Map.Entry entry = (Map.Entry)i.next();
+ String name = (String)entry.getKey();
- if (isFormalParameter(name))
- continue;
+ if (isFormalParameter(name)) continue;
- IBinding binding = (IBinding) entry.getValue();
+ IBinding binding = (IBinding)entry.getValue();
Object value = binding.getObject();
- if (value == null)
- continue;
+ if (value == null) continue;
- if (value instanceof IAsset)
- {
- IAsset asset = (IAsset) value;
+ if (value instanceof IAsset) {
+ IAsset asset = (IAsset)value;
// Get the URL of the asset and insert that.
attribute = asset.buildURL();
- }
- else
- attribute = value.toString();
+ } else attribute = value.toString();
writer.attribute(name, attribute);
}
@@ -301,9 +302,10 @@
/**
* Returns the named binding, or null if it doesn't exist.
* <p>
- * In Tapestry 3.0, it was possible to force a binding to be stored in a component property by
- * defining a concrete or abstract property named "nameBinding" of type {@link IBinding}. This
- * has been removed in release 4.0 and bindings are always stored inside a Map of the component.
+ * In Tapestry 3.0, it was possible to force a binding to be stored in a
+ * component property by defining a concrete or abstract property named
+ * "nameBinding" of type {@link IBinding}. This has been removed in release
+ * 4.0 and bindings are always stored inside a Map of the component.
*
* @see #setBinding(String,IBinding)
*/
@@ -312,10 +314,9 @@
{
Defense.notNull(name, "name");
- if (_bindings == null)
- return null;
+ if (_bindings == null) return null;
- return (IBinding) _bindings.get(name);
+ return (IBinding)_bindings.get(name);
}
/**
@@ -337,12 +338,11 @@
IComponent result = null;
- if (_components != null)
- result = (IComponent) _components.get(id);
+ if (_components != null) result = (IComponent)_components.get(id);
if (result == null)
- throw new ApplicationRuntimeException(Tapestry.format("no-such-component", this, id),
- this, null, null);
+ throw new ApplicationRuntimeException(Tapestry.format(
+ "no-such-component", this, id), this, null, null);
return result;
}
@@ -357,23 +357,24 @@
checkActiveLock();
if (_container != null)
- throw new ApplicationRuntimeException(Tapestry
- .getMessage("AbstractComponent.attempt-to-change-container"));
+ throw new ApplicationRuntimeException(
+ Tapestry
+ .getMessage("AbstractComponent.attempt-to-change-container"));
_container = value;
}
/**
- * Returns the name of the page, a slash, and this component's id path. Pages are different,
- * they override this method to simply return their page name.
+ * Returns the name of the page, a slash, and this component's id path.
+ * Pages are different, they override this method to simply return their
+ * page name.
*
* @see #getIdPath()
*/
public String getExtendedId()
{
- if (_page == null)
- return null;
+ if (_page == null) return null;
return _page.getPageName() + "/" + getIdPath();
}
@@ -386,8 +387,9 @@
public void setId(String value)
{
if (_id != null)
- throw new ApplicationRuntimeException(Tapestry
- .getMessage("AbstractComponent.attempt-to-change-component-id"));
+ throw new ApplicationRuntimeException(
+ Tapestry
+ .getMessage("AbstractComponent.attempt-to-change-component-id"));
_id = value;
}
@@ -397,15 +399,13 @@
String containerIdPath;
if (_container == null)
- throw new NullPointerException(Tapestry
- .format("AbstractComponent.null-container", this));
+ throw new NullPointerException(Tapestry.format(
+ "AbstractComponent.null-container", this));
containerIdPath = _container.getIdPath();
- if (containerIdPath == null)
- _idPath = _id;
- else
- _idPath = containerIdPath + "." + _id;
+ if (containerIdPath == null) _idPath = _id;
+ else _idPath = containerIdPath + "." + _id;
return _idPath;
}
@@ -430,12 +430,13 @@
public void renderBody(IMarkupWriter writer, IRequestCycle cycle)
{
- for (int i = 0; i < _bodyCount; i++)
+ for(int i = 0; i < _bodyCount; i++)
_body[i].render(writer, cycle);
}
/**
- * Adds the binding with the given name, replacing any existing binding with that name.
+ * Adds the binding with the given name, replacing any existing binding with
+ * that name.
* <p>
*
* @see #getBinding(String)
@@ -446,8 +447,7 @@
Defense.notNull(name, "name");
Defense.notNull(binding, "binding");
- if (_bindings == null)
- _bindings = new HashMap(MAP_SIZE);
+ if (_bindings == null) _bindings = new HashMap(MAP_SIZE);
_bindings.put(name, binding);
}
@@ -468,14 +468,14 @@
}
/**
- * Returns an unmodifiable {@link Map}of components, keyed on component id. Never returns null,
- * but may return an empty map. The returned map is immutable.
+ * Returns an unmodifiable {@link Map}of components, keyed on component id.
+ * Never returns null, but may return an empty map. The returned map is
+ * immutable.
*/
public Map getComponents()
{
- if (_components == null)
- return EMPTY_MAP;
+ if (_components == null) return EMPTY_MAP;
return Collections.unmodifiableMap(_components);
@@ -483,33 +483,29 @@
public Map getAssets()
{
- if (_assets == null)
- return EMPTY_MAP;
+ if (_assets == null) return EMPTY_MAP;
return Collections.unmodifiableMap(_assets);
}
public IAsset getAsset(String name)
{
- if (_assets == null)
- return null;
+ if (_assets == null) return null;
- return (IAsset) _assets.get(name);
+ return (IAsset)_assets.get(name);
}
public Collection getBindingNames()
{
// If no conainer, i.e. a page, then no bindings.
- if (_container == null)
- return null;
+ if (_container == null) return null;
HashSet result = new HashSet();
// All the informal bindings go into the bindings Map.
- if (_bindings != null)
- result.addAll(_bindings.keySet());
+ if (_bindings != null) result.addAll(_bindings.keySet());
// Now, iterate over the formal parameters and add the formal parameters
// that have a binding.
@@ -518,15 +514,12 @@
int count = names.size();
- for (int i = 0; i < count; i++)
- {
- String name = (String) names.get(i);
+ for(int i = 0; i < count; i++) {
+ String name = (String)names.get(i);
- if (result.contains(name))
- continue;
+ if (result.contains(name)) continue;
- if (getBinding(name) != null)
- result.add(name);
+ if (getBinding(name) != null) result.add(name);
}
return result;
@@ -540,16 +533,16 @@
public Map getBindings()
{
- if (_bindings == null)
- return Collections.EMPTY_MAP;
+ if (_bindings == null) return Collections.EMPTY_MAP;
return Collections.unmodifiableMap(_bindings);
}
/**
- * Returns a {@link ListenerMap} for the component. A ListenerMap contains a number of
- * synthetic read-only properties that implement the {@link IActionListener}interface, but in
- * fact, cause public instance methods to be invoked.
+ * Returns a {@link ListenerMap} for the component. A ListenerMap
+ * contains a number of synthetic read-only properties that implement the
+ * {@link IActionListener}interface, but in fact, cause public instance
+ * methods to be invoked.
*
* @since 1.0.2
*/
@@ -557,35 +550,36 @@
public ListenerMap getListeners()
{
// This is what's called a violation of the Law of Demeter!
- // This should probably be converted over to some kind of injection, as with
+ // This should probably be converted over to some kind of injection, as
+ // with
// getMessages(), etc.
if (_listeners == null)
- _listeners = getPage().getEngine().getInfrastructure().getListenerMapSource()
- .getListenerMapForObject(this);
+ _listeners = getPage().getEngine().getInfrastructure()
+ .getListenerMapSource().getListenerMapForObject(this);
return _listeners;
}
/**
- * Returns the {@link IBeanProvider}for this component. This is lazily created the first time
- * it is needed.
+ * Returns the {@link IBeanProvider}for this component. This is lazily
+ * created the first time it is needed.
*
* @since 1.0.4
*/
public IBeanProvider getBeans()
{
- if (_beans == null)
- _beans = new BeanProvider(this);
+ if (_beans == null) _beans = new BeanProvider(this);
return _beans;
}
/**
* Invoked, as a convienience, from
- * {@link #finishLoad(IRequestCycle, IPageLoader, IComponentSpecification)}. This implemenation
- * does nothing. Subclasses may override without invoking this implementation.
+ * {@link #finishLoad(IRequestCycle, IPageLoader, IComponentSpecification)}.
+ * This implemenation does nothing. Subclasses may override without invoking
+ * this implementation.
*
* @since 1.0.5
*/
@@ -598,7 +592,8 @@
* The main method used to render the component. Invokes
* {@link #prepareForRender(IRequestCycle)}, then
* {@link #renderComponent(IMarkupWriter, IRequestCycle)}.
- * {@link #cleanupAfterRender(IRequestCycle)}is invoked in a <code>finally</code> block.
+ * {@link #cleanupAfterRender(IRequestCycle)}is invoked in a
+ * <code>finally</code> block.
* <p>
* Subclasses should not override this method; instead they will implement
* {@link #renderComponent(IMarkupWriter, IRequestCycle)}.
@@ -608,16 +603,13 @@
public final void render(IMarkupWriter writer, IRequestCycle cycle)
{
- try
- {
+ try {
_rendering = true;
prepareForRender(cycle);
renderComponent(writer, cycle);
- }
- finally
- {
+ } finally {
_rendering = false;
cleanupAfterRender(cycle);
@@ -625,9 +617,9 @@
}
/**
- * Invoked by {@link #render(IMarkupWriter, IRequestCycle)}to prepare the component to render.
- * This implementation sets JavaBeans properties from matching bound parameters. This
- * implementation does nothing.
+ * Invoked by {@link #render(IMarkupWriter, IRequestCycle)}to prepare the
+ * component to render. This implementation sets JavaBeans properties from
+ * matching bound parameters. This implementation does nothing.
*
* @since 2.0.3
*/
@@ -637,17 +629,19 @@
}
/**
- * Invoked by {@link #render(IMarkupWriter, IRequestCycle)}to actually render the component
- * (with any parameter values already set). This is the method that subclasses must implement.
+ * Invoked by {@link #render(IMarkupWriter, IRequestCycle)}to actually
+ * render the component (with any parameter values already set). This is the
+ * method that subclasses must implement.
*
* @since 2.0.3
*/
- protected abstract void renderComponent(IMarkupWriter writer, IRequestCycle cycle);
+ protected abstract void renderComponent(IMarkupWriter writer,
+ IRequestCycle cycle);
/**
- * Invoked by {@link #render(IMarkupWriter, IRequestCycle)}after the component renders. This
- * implementation does nothing.
+ * Invoked by {@link #render(IMarkupWriter, IRequestCycle)}after the
+ * component renders. This implementation does nothing.
*
* @since 2.0.3
*/
@@ -667,9 +661,9 @@
}
/**
- * Returns the body of the component, the element (which may be static HTML or components) that
- * the component immediately wraps. May return null. Do not modify the returned array. The array
- * may be padded with nulls.
+ * Returns the body of the component, the element (which may be static HTML
+ * or components) that the component immediately wraps. May return null. Do
+ * not modify the returned array. The array may be padded with nulls.
*
* @since 2.3
* @see #getBodyCount()
@@ -694,9 +688,11 @@
/**
* Empty implementation of
- * {@link org.apache.tapestry.event.PageRenderListener#pageEndRender(PageEvent)}. This allows
- * classes to implement {@link org.apache.tapestry.event.PageRenderListener}and only implement
- * the {@link org.apache.tapestry.event.PageRenderListener#pageBeginRender(PageEvent)}method.
+ * {@link org.apache.tapestry.event.PageRenderListener#pageEndRender(PageEvent)}.
+ * This allows classes to implement
+ * {@link org.apache.tapestry.event.PageRenderListener}and only implement
+ * the
+ * {@link org.apache.tapestry.event.PageRenderListener#pageBeginRender(PageEvent)}method.
*
* @since 3.0
*/
@@ -739,8 +735,8 @@
}
/**
- * Returns true if the component has been transitioned into its active state by invoking
- * {@link #enterActiveState()}
+ * Returns true if the component has been transitioned into its active state
+ * by invoking {@link #enterActiveState()}.
*
* @since 4.0
*/
@@ -761,17 +757,20 @@
protected final void checkActiveLock()
{
if (_active)
- throw new UnsupportedOperationException(TapestryMessages.componentIsLocked(this));
+ throw new UnsupportedOperationException(TapestryMessages
+ .componentIsLocked(this));
}
public Messages getMessages()
{
- throw new IllegalStateException(TapestryMessages.providedByEnhancement("getMessages"));
+ throw new IllegalStateException(TapestryMessages
+ .providedByEnhancement("getMessages"));
}
public IComponentSpecification getSpecification()
{
- throw new IllegalStateException(TapestryMessages.providedByEnhancement("getSpecification"));
+ throw new IllegalStateException(TapestryMessages
+ .providedByEnhancement("getSpecification"));
}
/**
@@ -804,7 +803,8 @@
}
/**
- * Convienience method for invoking {@link IMessages#format(String, Locale, Object)}
+ * Convienience method for invoking
+ * {@link IMessages#format(String, Locale, Object)}.
*
* @since 3.0
* @deprecated To be removed in 4.1. Use {@link #getMessages()} instead.
@@ -816,7 +816,8 @@
}
/**
- * Convienience method for invoking {@link Messages#format(String, Object, Object)}.
+ * Convienience method for invoking
+ * {@link Messages#format(String, Object, Object)}.
*
* @since 3.0
* @deprecated To be removed in 4.1. Use {@link #getMessages()} instead.
@@ -828,13 +829,15 @@
}
/**
- * Convienience method for {@link Messages#format(String, Object, Object, Object)}.
+ * Convienience method for
+ * {@link Messages#format(String, Object, Object, Object)}.
*
* @since 3.0
* @deprecated To be removed in 4.1. Use {@link #getMessages()} instead.
*/
- public String format(String key, Object argument1, Object argument2, Object argument3)
+ public String format(String key, Object argument1, Object argument2,
+ Object argument3)
{
return getMessages().format(key, argument1, argument2, argument3);
}
@@ -846,7 +849,8 @@
}
/** @since 4.0 */
- public final void setContainedComponent(IContainedComponent containedComponent)
+ public final void setContainedComponent(
+ IContainedComponent containedComponent)
{
Defense.notNull(containedComponent, "containedComponent");
@@ -857,4 +861,4 @@
_containedComponent = containedComponent;
}
-}
\ No newline at end of file
+}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/AbstractPage.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/AbstractPage.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/AbstractPage.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/AbstractPage.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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,11 +23,11 @@
import org.apache.commons.logging.LogFactory;
import org.apache.hivemind.ApplicationRuntimeException;
import org.apache.tapestry.event.ChangeObserver;
+import org.apache.tapestry.event.PageAttachListener;
import org.apache.tapestry.event.PageBeginRenderListener;
import org.apache.tapestry.event.PageDetachListener;
import org.apache.tapestry.event.PageEndRenderListener;
import org.apache.tapestry.event.PageEvent;
-import org.apache.tapestry.event.PageAttachListener;
import org.apache.tapestry.event.PageRenderListener;
import org.apache.tapestry.event.PageValidateListener;
import org.apache.tapestry.util.StringSplitter;
@@ -39,13 +39,14 @@
* @since 0.2.9
*/
-public abstract class AbstractPage extends BaseComponent implements IPage
-{
+public abstract class AbstractPage extends BaseComponent implements IPage {
+
private static final Log LOG = LogFactory.getLog(AbstractPage.class);
/**
- * Object to be notified when a observered property changes. Observered properties are the ones
- * that will be persisted between request cycles. Unobserved properties are reconstructed.
+ * Object to be notified when a observered property changes. Observered
+ * properties are the ones that will be persisted between request cycles.
+ * Unobserved properties are reconstructed.
*/
private ChangeObserver _changeObserver;
@@ -57,8 +58,8 @@
private IEngine _engine;
/**
- * The visit object, if any, for the application. Set inside {@link #attach(IEngine)}and
- * cleared by {@link #detach()}.
+ * The visit object, if any, for the application. Set inside
+ * {@link #attach(IEngine)}and cleared by {@link #detach()}.
*/
private Object _visit;
@@ -78,7 +79,8 @@
private IRequestCycle _requestCycle;
/**
- * The locale of the page, initially determined from the {@link IEngine engine}.
+ * The locale of the page, initially determined from the
+ * {@link IEngine engine}.
*/
private Locale _locale;
@@ -95,16 +97,16 @@
private EventListenerList _listenerList;
/**
- * The output encoding to be used when rendering this page. This value is cached from the
- * engine.
+ * The output encoding to be used when rendering this page. This value is
+ * cached from the engine.
*
* @since 3.0
*/
private String _outputEncoding;
/**
- * Standard constructor; invokes {@link #initialize()}to configure initial values for
- * properties of the page.
+ * Standard constructor; invokes {@link #initialize()}to configure initial
+ * values for properties of the page.
*
* @since 2.2
*/
@@ -118,12 +120,14 @@
* Prepares the page to be returned to the pool.
* <ul>
* <li>Clears the changeObserved property
- * <li>Invokes {@link PageDetachListener#pageDetached(PageEvent)}on all listeners
+ * <li>Invokes {@link PageDetachListener#pageDetached(PageEvent)}on all
+ * listeners
* <li>Invokes {@link #initialize()}to clear/reset any properties
* <li>Clears the engine, visit and requestCycle properties
* </ul>
* <p>
- * Subclasses may override this method, but must invoke this implementation (usually, last).
+ * Subclasses may override this method, but must invoke this implementation
+ * (usually, last).
*
* @see PageDetachListener
*/
@@ -147,8 +151,9 @@
}
/**
- * Method invoked from the constructor, and from {@link #detach()}to (re-)initialize properties
- * of the page. This is most useful when properties have non-null initial values.
+ * Method invoked from the constructor, and from {@link #detach()}to
+ * (re-)initialize properties of the page. This is most useful when
+ * properties have non-null initial values.
* <p>
* Subclasses may override this implementation (which is empty).
*
@@ -192,8 +197,8 @@
}
/**
- * Returns the locale for the page, which may be null if the locale is not known (null
- * corresponds to the "default locale").
+ * Returns the locale for the page, which may be null if the locale is not
+ * known (null corresponds to the "default locale").
*/
public Locale getLocale()
@@ -217,15 +222,13 @@
String[] elements;
int i;
- if (path == null)
- return this;
+ if (path == null) return this;
splitter = new StringSplitter('.');
current = this;
elements = splitter.splitToArray(path);
- for (i = 0; i < elements.length; i++)
- {
+ for(i = 0; i < elements.length; i++) {
current = current.getComponent(elements[i]);
}
@@ -234,16 +237,18 @@
}
/**
- * Called by the {@link IEngine engine}to attach the page to itself. Does <em>not</em> change
- * the locale, but since a page is selected from the
- * {@link org.apache.tapestry.engine.IPageSource}pool based on its locale matching the engine's
- * locale, they should match anyway.
+ * Called by the {@link IEngine engine}to attach the page to itself. Does
+ * <em>not</em> change the locale, but since a page is selected from the
+ * {@link org.apache.tapestry.engine.IPageSource}pool based on its locale
+ * matching the engine's locale, they should match anyway.
*/
public void attach(IEngine engine, IRequestCycle cycle)
{
if (_engine != null)
- LOG.error(this + " attach(" + engine + "), but engine = " + _engine);
+ LOG
+ .error(this + " attach(" + engine + "), but engine = "
+ + _engine);
_engine = engine;
_requestCycle = cycle;
@@ -252,30 +257,28 @@
}
/**
+ * Renders the page, following a series of steps.
* <ul>
* <li>Invokes {@link PageBeginRenderListener#pageBeginRender(PageEvent)}
* <li>Invokes {@link #beginResponse(IMarkupWriter, IRequestCycle)}
* <li>Invokes {@link IRequestCycle#commitPageChanges()}(if not rewinding)
* <li>Invokes {@link #render(IMarkupWriter, IRequestCycle)}
- * <li>Invokes {@link PageEndRenderListener#pageEndRender(PageEvent)}(this occurs even if a
- * previous step throws an exception)
+ * <li>Invokes {@link PageEndRenderListener#pageEndRender(PageEvent)}(this
+ * occurs even if a previous step throws an exception)
+ * </ul>
*/
public void renderPage(IMarkupWriter writer, IRequestCycle cycle)
{
- try
- {
+ try {
firePageBeginRender();
beginResponse(writer, cycle);
- if (!cycle.isRewinding())
- cycle.commitPageChanges();
+ if (!cycle.isRewinding()) cycle.commitPageChanges();
render(writer, cycle);
- }
- finally
- {
+ } finally {
firePageEndRender();
}
}
@@ -323,15 +326,15 @@
}
/**
- * Returns the visit object obtained from the engine via {@link IEngine#getVisit(IRequestCycle)}.
+ * Returns the visit object obtained from the engine via
+ * {@link IEngine#getVisit(IRequestCycle)}.
*
* @deprecated
*/
public Object getVisit()
{
- if (_visit == null)
- _visit = _engine.getVisit(_requestCycle);
+ if (_visit == null) _visit = _engine.getVisit(_requestCycle);
return _visit;
}
@@ -355,8 +358,7 @@
private void addListener(Class listenerClass, EventListener listener)
{
- if (_listenerList == null)
- _listenerList = new EventListenerList();
+ if (_listenerList == null) _listenerList = new EventListenerList();
_listenerList.add(listenerClass, listener);
}
@@ -408,20 +410,16 @@
protected void firePageAttached()
{
- if (_listenerList == null)
- return;
+ if (_listenerList == null) return;
PageEvent event = null;
Object[] listeners = _listenerList.getListenerList();
- for (int i = 0; i < listeners.length; i += 2)
- {
- if (listeners[i] == PageAttachListener.class)
- {
- PageAttachListener l = (PageAttachListener) listeners[i + 1];
+ for(int i = 0; i < listeners.length; i += 2) {
+ if (listeners[i] == PageAttachListener.class) {
+ PageAttachListener l = (PageAttachListener)listeners[i + 1];
- if (event == null)
- event = new PageEvent(this, _requestCycle);
+ if (event == null) event = new PageEvent(this, _requestCycle);
l.pageAttached(event);
}
@@ -434,20 +432,16 @@
protected void firePageDetached()
{
- if (_listenerList == null)
- return;
+ if (_listenerList == null) return;
PageEvent event = null;
Object[] listeners = _listenerList.getListenerList();
- for (int i = 0; i < listeners.length; i += 2)
- {
- if (listeners[i] == PageDetachListener.class)
- {
- PageDetachListener l = (PageDetachListener) listeners[i + 1];
+ for(int i = 0; i < listeners.length; i += 2) {
+ if (listeners[i] == PageDetachListener.class) {
+ PageDetachListener l = (PageDetachListener)listeners[i + 1];
- if (event == null)
- event = new PageEvent(this, _requestCycle);
+ if (event == null) event = new PageEvent(this, _requestCycle);
l.pageDetached(event);
}
@@ -460,20 +454,16 @@
protected void firePageBeginRender()
{
- if (_listenerList == null)
- return;
+ if (_listenerList == null) return;
PageEvent event = null;
Object[] listeners = _listenerList.getListenerList();
- for (int i = 0; i < listeners.length; i += 2)
- {
- if (listeners[i] == PageBeginRenderListener.class)
- {
- PageBeginRenderListener l = (PageBeginRenderListener) listeners[i + 1];
+ for(int i = 0; i < listeners.length; i += 2) {
+ if (listeners[i] == PageBeginRenderListener.class) {
+ PageBeginRenderListener l = (PageBeginRenderListener)listeners[i + 1];
- if (event == null)
- event = new PageEvent(this, _requestCycle);
+ if (event == null) event = new PageEvent(this, _requestCycle);
l.pageBeginRender(event);
}
@@ -486,20 +476,16 @@
protected void firePageEndRender()
{
- if (_listenerList == null)
- return;
+ if (_listenerList == null) return;
PageEvent event = null;
Object[] listeners = _listenerList.getListenerList();
- for (int i = 0; i < listeners.length; i += 2)
- {
- if (listeners[i] == PageEndRenderListener.class)
- {
- PageEndRenderListener l = (PageEndRenderListener) listeners[i + 1];
+ for(int i = 0; i < listeners.length; i += 2) {
+ if (listeners[i] == PageEndRenderListener.class) {
+ PageEndRenderListener l = (PageEndRenderListener)listeners[i + 1];
- if (event == null)
- event = new PageEvent(this, _requestCycle);
+ if (event == null) event = new PageEvent(this, _requestCycle);
l.pageEndRender(event);
}
@@ -567,20 +553,16 @@
protected void firePageValidate()
{
- if (_listenerList == null)
- return;
+ if (_listenerList == null) return;
PageEvent event = null;
Object[] listeners = _listenerList.getListenerList();
- for (int i = 0; i < listeners.length; i += 2)
- {
- if (listeners[i] == PageValidateListener.class)
- {
- PageValidateListener l = (PageValidateListener) listeners[i + 1];
+ for(int i = 0; i < listeners.length; i += 2) {
+ if (listeners[i] == PageValidateListener.class) {
+ PageValidateListener l = (PageValidateListener)listeners[i + 1];
- if (event == null)
- event = new PageEvent(this, _requestCycle);
+ if (event == null) event = new PageEvent(this, _requestCycle);
l.pageValidate(event);
}
@@ -588,8 +570,8 @@
}
/**
- * Returns the output encoding to be used when rendering this page. This value is usually cached
- * from the Engine.
+ * Returns the output encoding to be used when rendering this page. This
+ * value is usually cached from the Engine.
*
* @since 3.0
*/
@@ -600,4 +582,4 @@
return _outputEncoding;
}
-}
\ No newline at end of file
+}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ApplicationServlet.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ApplicationServlet.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ApplicationServlet.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ApplicationServlet.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -40,11 +40,12 @@
import org.apache.tapestry.util.exception.ExceptionAnalyzer;
/**
- * Links a servlet container with a Tapestry application. The servlet init parameter
- * <code>org.apache.tapestry.application-specification</code> should be set to the complete
- * resource path (within the classpath) to the application specification, i.e.,
- * <code>/com/foo/bar/MyApp.application</code>. As of release 4.0, this servlet will also create
- * a HiveMind Registry and manage it.
+ * Links a servlet container with a Tapestry application. The servlet init
+ * parameter <code>org.apache.tapestry.application-specification</code> should
+ * be set to the complete resource path (within the classpath) to the
+ * application specification, i.e., <code>/com/foo/bar/MyApp.application</code>.
+ * As of release 4.0, this servlet will also create a HiveMind Registry and
+ * manage it.
*
* @author Howard Lewis Ship
* @see org.apache.tapestry.services.ApplicationInitializer
@@ -53,31 +54,39 @@
public class ApplicationServlet extends HttpServlet
{
- private static final long serialVersionUID = -8046042689991538059L;
+
+ private static final Log LOG = LogFactory.getLog(ApplicationServlet.class);
/**
- * Prefix used to store the HiveMind Registry into the ServletContext. This string is suffixed
- * with the servlet name (in case multiple Tapestry applications are executing within a single
- * web application).
+ * Prefix used to store the HiveMind Registry into the ServletContext. This
+ * string is suffixed with the servlet name (in case multiple Tapestry
+ * applications are executing within a single web application).
*
* @since 4.0
*/
private static final String REGISTRY_KEY_PREFIX = "org.apache.tapestry.Registry:";
- private static final Log LOG = LogFactory.getLog(ApplicationServlet.class);
+ private static final long serialVersionUID = -8046042689991538059L;
/**
- * Invokes {@link #doService(HttpServletRequest, HttpServletResponse)}.
+ * @since 4.0
+ */
+
+ private Registry _registry;
+
+ /**
+ * The key used to store the registry into the ServletContext.
*
- * @since 1.0.6
+ * @since 4.0
*/
- public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException,
- ServletException
- {
- doService(request, response);
- }
+ private String _registryKey;
+
+ /**
+ * @since 4.0
+ */
+ private ServletRequestServicer _requestServicer;
/**
* @since 2.3
@@ -86,35 +95,128 @@
private ClassResolver _resolver;
/**
- * The key used to store the registry into the ServletContext.
+ * Looks for a file in the servlet context; if it exists, it is expected to
+ * be a HiveMind module descriptor, and is added to the builder.
*
* @since 4.0
*/
- private String _registryKey;
+ protected void addModuleIfExists(RegistryBuilder builder, ServletContext context, String path)
+ {
+ Resource r = new ContextResource(context, path);
+
+ if (r.getResourceURL() == null) return;
+
+ builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(_resolver, r));
+ }
/**
+ * Invoked by {@link #constructRegistry(ServletConfig)} to create and return
+ * an {@link ErrorHandler} instance to be used when constructing the
+ * Registry (and then to handle any runtime exceptions). This implementation
+ * returns a new instance of
+ * {@link org.apache.hivemind.impl.StrictErrorHandler}.
+ *
* @since 4.0
*/
+ protected ErrorHandler constructErrorHandler(ServletConfig config)
+ {
+ return new StrictErrorHandler();
+ }
- private Registry _registry;
+ /**
+ * Invoked from {@link #init(ServletConfig)}to construct the Registry to be
+ * used by the application.
+ * <p>
+ * This looks in the standard places (on the classpath), but also in the
+ * WEB-INF/name and WEB-INF folders (where name is the name of the servlet).
+ *
+ * @since 4.0
+ */
+ protected Registry constructRegistry(ServletConfig config)
+ {
+ ErrorHandler errorHandler = constructErrorHandler(config);
+
+ RegistryBuilder builder = new RegistryBuilder(errorHandler);
+
+ builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(_resolver));
+
+ String name = config.getServletName();
+ ServletContext context = config.getServletContext();
+
+ addModuleIfExists(builder, context, "/WEB-INF/" + name + "/hivemodule.xml");
+ addModuleIfExists(builder, context, "/WEB-INF/hivemodule.xml");
+
+ return builder.constructRegistry(Locale.getDefault());
+ }
/**
+ * Invoked from {@link #init(ServletConfig)}to create a resource resolver
+ * for the servlet (which will utlimately be shared and used through the
+ * application).
+ * <p>
+ * This implementation constructs a {@link DefaultResourceResolver},
+ * subclasses may provide a different implementation.
+ *
+ * @see #getResourceResolver()
+ * @since 2.3
+ */
+
+ protected ClassResolver createClassResolver()
+ {
+ return new DefaultClassResolver();
+ }
+
+ /**
+ * Shuts down the registry (if it exists).
+ *
* @since 4.0
*/
- private ServletRequestServicer _requestServicer;
+ public void destroy()
+ {
+ getServletContext().removeAttribute(_registryKey);
+
+ if (_registry != null)
+ {
+ _registry.shutdown();
+ _registry = null;
+ }
+ }
+
+ /**
+ * Invokes {@link #doService(HttpServletRequest, HttpServletResponse)}.
+ *
+ * @since 1.0.6
+ */
+
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws IOException, ServletException
+ {
+ doService(request, response);
+ }
+
+ /**
+ * Invokes {@link #doService(HttpServletRequest, HttpServletResponse)}.
+ */
+
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws IOException, ServletException
+ {
+ doService(request, response);
+ }
/**
* Handles the GET and POST requests. Performs the following:
* <ul>
* <li>Construct a {@link RequestContext}
- * <li>Invoke {@link #getEngine(RequestContext)}to get or create the {@link IEngine}
+ * <li>Invoke {@link #getEngine(RequestContext)}to get or create the
+ * {@link IEngine}
* <li>Invoke {@link IEngine#service(RequestContext)}on the application
* </ul>
*/
protected void doService(HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException
+ throws IOException, ServletException
{
try
{
@@ -148,35 +250,17 @@
}
}
- protected void show(Exception ex)
- {
- System.err.println("\n\n**********************************************************\n\n");
-
- new ExceptionAnalyzer().reportException(ex, System.err);
-
- System.err.println("\n**********************************************************\n");
-
- }
-
- /**
- * Invokes {@link #doService(HttpServletRequest, HttpServletResponse)}.
- */
-
- public void doPost(HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException
- {
- doService(request, response);
- }
-
/**
- * Reads the application specification when the servlet is first initialized. All
- * {@link IEngine engine instances}will have access to the specification via the servlet.
+ * Reads the application specification when the servlet is first
+ * initialized. All {@link IEngine engine instances}will have access to the
+ * specification via the servlet.
*
* @see #constructApplicationSpecification()
* @see #createResourceResolver()
*/
- public void init(ServletConfig config) throws ServletException
+ public void init(ServletConfig config)
+ throws ServletException
{
String name = config.getServletName();
@@ -212,112 +296,32 @@
}
/**
- * Invoked from {@link #init(ServletConfig)}to create a resource resolver for the servlet
- * (which will utlimately be shared and used through the application).
- * <p>
- * This implementation constructs a {@link DefaultResourceResolver}, subclasses may provide a
- * different implementation.
- *
- * @see #getResourceResolver()
- * @since 2.3
- */
-
- protected ClassResolver createClassResolver()
- {
- return new DefaultClassResolver();
- }
-
- /**
- * Invoked from {@link #init(ServletConfig)}to construct the Registry to be used by the
- * application.
- * <p>
- * This looks in the standard places (on the classpath), but also in the WEB-INF/name and
- * WEB-INF folders (where name is the name of the servlet).
- *
- * @since 4.0
- */
- protected Registry constructRegistry(ServletConfig config)
- {
- ErrorHandler errorHandler = constructErrorHandler(config);
-
- RegistryBuilder builder = new RegistryBuilder(errorHandler);
-
- builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(_resolver));
-
- String name = config.getServletName();
- ServletContext context = config.getServletContext();
-
- addModuleIfExists(builder, context, "/WEB-INF/" + name + "/hivemodule.xml");
- addModuleIfExists(builder, context, "/WEB-INF/hivemodule.xml");
-
- return builder.constructRegistry(Locale.getDefault());
- }
-
- /**
- * Invoked by {@link #constructRegistry(ServletConfig)} to create and return an
- * {@link ErrorHandler} instance to be used when constructing the Registry (and then to handle
- * any runtime exceptions). This implementation returns a new instance of
- * {@link org.apache.hivemind.impl.StrictErrorHandler}.
- *
- * @since 4.0
- */
- protected ErrorHandler constructErrorHandler(ServletConfig config)
- {
- return new StrictErrorHandler();
- }
-
- /**
- * Looks for a file in the servlet context; if it exists, it is expected to be a HiveMind module
- * descriptor, and is added to the builder.
- *
- * @since 4.0
- */
-
- protected void addModuleIfExists(RegistryBuilder builder, ServletContext context, String path)
- {
- Resource r = new ContextResource(context, path);
-
- if (r.getResourceURL() == null)
- return;
-
- builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(_resolver, r));
- }
-
- /**
- * Invoked from {@link #init(ServletConfig)}, after the registry has been constructed, to
- * bootstrap the application via the <code>tapestry.MasterApplicationInitializer</code>
- * service.
+ * Invoked from {@link #init(ServletConfig)}, after the registry has been
+ * constructed, to bootstrap the application via the
+ * <code>tapestry.MasterApplicationInitializer</code> service.
*
* @since 4.0
*/
protected void initializeApplication()
{
- ApplicationInitializer ai = (ApplicationInitializer) _registry.getService(
- "tapestry.init.MasterInitializer",
+ ApplicationInitializer ai = (ApplicationInitializer)_registry.getService("tapestry.init.MasterInitializer",
ApplicationInitializer.class);
ai.initialize(this);
_registry.cleanupThread();
- _requestServicer = (ServletRequestServicer) _registry.getService(
- "tapestry.request.ServletRequestServicer",
+ _requestServicer = (ServletRequestServicer)_registry.getService("tapestry.request.ServletRequestServicer",
ServletRequestServicer.class);
}
- /**
- * Shuts down the registry (if it exists).
- *
- * @since 4.0
- */
- public void destroy()
+ protected void show(Exception ex)
{
- getServletContext().removeAttribute(_registryKey);
+ System.err.println("\n\n**********************************************************\n\n");
+
+ new ExceptionAnalyzer().reportException(ex, System.err);
+
+ System.err.println("\n**********************************************************\n");
- if (_registry != null)
- {
- _registry.shutdown();
- _registry = null;
- }
}
-}
\ No newline at end of file
+}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/BindingException.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/BindingException.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/BindingException.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/BindingException.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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,18 +19,17 @@
import org.apache.hivemind.Location;
/**
- * A general exception describing an {@link IBinding}
- * and an {@link IComponent}.
- *
- * @author Howard Lewis Ship
- *
- **/
+ * A general exception describing an {@link IBinding} and an {@link IComponent}.
+ *
+ * @author Howard Lewis Ship
+ */
public class BindingException extends ApplicationRuntimeException
{
+
private static final long serialVersionUID = 1336659143140967861L;
-
- private transient IBinding _binding;
+
+ private transient IBinding _binding;
public BindingException(String message, IBinding binding)
{
@@ -42,19 +41,9 @@
this(message, null, null, binding, rootCause);
}
-
- public BindingException(
- String message,
- Object component,
- Location location,
- IBinding binding,
- Throwable rootCause)
+ public BindingException(String message, Object component, Location location, IBinding binding, Throwable rootCause)
{
- super(
- message,
- component,
- HiveMind.findLocation(new Object[] { location, binding, component }),
- rootCause);
+ super(message, component, HiveMind.findLocation(new Object[] { location, binding, component }), rootCause);
_binding = binding;
}
@@ -63,4 +52,4 @@
{
return _binding;
}
-}
\ No newline at end of file
+}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/Constants.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/Constants.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/Constants.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/Constants.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -15,16 +15,18 @@
package org.apache.tapestry;
/**
- * Constant values used inside Tapestry.
- *
+ * Constant values used inside Tapestry.
+ *
* @author Howard Lewis Ship
* @since 4.0
*/
public final class Constants
{
- /**
- * Key used to store and locate an {@link org.apache.tapestry.services.Infrastructure}
- * service instance as a request attribute.
- */
- public static final String INFRASTRUCTURE_KEY = "org.apache.tapestry.Infrastructure";
+
+ /**
+ * Key used to store and locate an
+ * {@link org.apache.tapestry.services.Infrastructure} service instance as a
+ * request attribute.
+ */
+ public static final String INFRASTRUCTURE_KEY = "org.apache.tapestry.Infrastructure";
}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IBeanProvider.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IBeanProvider.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IBeanProvider.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IBeanProvider.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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,65 +19,60 @@
import org.apache.hivemind.ClassResolver;
/**
- * An object that provides a component with access to helper beans.
- * Helper beans are JavaBeans associated with a page or component
- * that are used to extend the functionality of the component via
- * aggregation.
- *
- * @author Howard Lewis Ship
- * @since 1.0.4
- **/
-
+ * An object that provides a component with access to helper beans. Helper beans
+ * are JavaBeans associated with a page or component that are used to extend the
+ * functionality of the component via aggregation.
+ *
+ * @author Howard Lewis Ship
+ * @since 1.0.4
+ */
public interface IBeanProvider
{
- /**
- * Returns the JavaBean with the specified name. The bean is created as needed.
- *
- * @throws ApplicationRuntimeException if no such bean is available.
- *
- **/
-
- public Object getBean(String name);
-
- /**
- * Returns the {@link IComponent} (which may be a
- * {@link org.apache.tapestry.IPage}) for which
- * this bean provider is providing beans.
- *
- * @since 1.0.5
- **/
-
- public IComponent getComponent();
-
- /**
- * Returns a collection of the names of any beans which may
- * be provided.
- *
- * @since 1.0.6
- * @see org.apache.tapestry.spec.IComponentSpecification#getBeanNames()
- *
- **/
-
- public Collection getBeanNames();
-
+
+ /**
+ * Returns the JavaBean with the specified name. The bean is created as
+ * needed.
+ *
+ * @throws ApplicationRuntimeException
+ * if no such bean is available.
+ */
+
+ public Object getBean(String name);
+
+ /**
+ * Returns the {@link IComponent} (which may be a
+ * {@link org.apache.tapestry.IPage}) for which this bean provider is
+ * providing beans.
+ *
+ * @since 1.0.5
+ */
+
+ public IComponent getComponent();
+
/**
- * Returns true if the provider can provide the named bean.
+ * Returns a collection of the names of any beans which may be provided.
*
- * @since 2.2
+ * @since 1.0.6
+ * @see org.apache.tapestry.spec.IComponentSpecification#getBeanNames()
+ */
+
+ public Collection getBeanNames();
+
+ /**
+ * Returns true if the provider can provide the named bean.
*
- **/
-
+ * @since 2.2
+ */
+
public boolean canProvideBean(String name);
-
- /**
- * Returns a resource resolver.
- *
- * @since 1.0.8
- *
- **/
-
- public ClassResolver getClassResolver();
-
-}
+ /**
+ * Returns a resource resolver.
+ *
+ * @since 1.0.8
+ */
+
+ public ClassResolver getClassResolver();
+
+}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/PageNotFoundException.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/PageNotFoundException.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/PageNotFoundException.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/PageNotFoundException.java Thu Jan 12 09:12:21 2006
@@ -17,18 +17,19 @@
import org.apache.hivemind.ApplicationRuntimeException;
/**
- * Subclass of {@link org.apache.hivemind.ApplicationRuntimeException} thrown when a requested
- * page does not exist.
+ * Subclass of {@link org.apache.hivemind.ApplicationRuntimeException} thrown
+ * when a requested page does not exist.
*
* @author Howard M. Lewis Ship
* @since 4.0
*/
public class PageNotFoundException extends ApplicationRuntimeException
{
+
private static final long serialVersionUID = -4776430599632429708L;
- public PageNotFoundException(String message)
+ public PageNotFoundException(String message)
{
super(message);
}
-}
\ No newline at end of file
+}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/PageRedirectException.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/PageRedirectException.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/PageRedirectException.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/PageRedirectException.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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,18 +17,20 @@
import org.apache.hivemind.ApplicationRuntimeException;
/**
- * Exception thrown by a {@link IComponent component} or {@link org.apache.tapestry.engine.IEngineService}
- * that wishes to force the application to a particular page. This is often used
- * to protect a sensitive page until the user is authenticated.
- *
- * @author Howard Lewis Ship
- **/
+ * Exception thrown by a {@link IComponent component} or
+ * {@link org.apache.tapestry.engine.IEngineService} that wishes to force the
+ * application to a particular page. This is often used to protect a sensitive
+ * page until the user is authenticated.
+ *
+ * @author Howard Lewis Ship
+ */
public class PageRedirectException extends ApplicationRuntimeException
{
+
private static final long serialVersionUID = -7693744317997065965L;
-
- private String _targetPageName;
+
+ private final String _targetPageName;
public PageRedirectException(String targetPageName)
{
@@ -40,11 +42,7 @@
this(page.getPageName());
}
- public PageRedirectException(
- String message,
- Object component,
- Throwable rootCause,
- String targetPageName)
+ public PageRedirectException(String message, Object component, Throwable rootCause, String targetPageName)
{
super(message, component, null, rootCause);
@@ -55,4 +53,4 @@
{
return _targetPageName;
}
-}
\ No newline at end of file
+}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RedirectException.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RedirectException.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RedirectException.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RedirectException.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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,46 +17,45 @@
import org.apache.hivemind.ApplicationRuntimeException;
/**
- * Exception thrown to force a redirection to an arbitrary location.
- * This is used when, after processing a request (such as a form
- * submission or a link being clicked), it is desirable to go
- * to some arbitrary new location.
- *
- * @author Howard Lewis Ship
- * @since 1.0.6
- *
- **/
+ * Exception thrown to force a redirection to an arbitrary location. This is
+ * used when, after processing a request (such as a form submission or a link
+ * being clicked), it is desirable to go to some arbitrary new location.
+ *
+ * @author Howard Lewis Ship
+ * @since 1.0.6
+ */
public class RedirectException extends ApplicationRuntimeException
{
- private static final long serialVersionUID = -9215837473156146010L;
-
- private String _redirectLocation;
-
- public RedirectException(String redirectLocation)
- {
- this(null, redirectLocation);
- }
-
- /**
- * @param message A message describing why the redirection is taking place.
- * @param redirectLocation The location to redirect to, may be a relative path (relative
- * to the {@link javax.servlet.ServletContext}).
- *
- * @see javax.servlet.http.HttpServletResponse#sendRedirect(String)
- * @see javax.servlet.http.HttpServletResponse#encodeRedirectURL(String)
- *
- **/
-
- public RedirectException(String message, String redirectLocation)
- {
- super(message);
-
- _redirectLocation = redirectLocation;
- }
-
- public String getRedirectLocation()
- {
- return _redirectLocation;
- }
-}
\ No newline at end of file
+
+ private static final long serialVersionUID = -9215837473156146010L;
+
+ private String _redirectLocation;
+
+ public RedirectException(String redirectLocation)
+ {
+ this(null, redirectLocation);
+ }
+
+ /**
+ * @param message
+ * A message describing why the redirection is taking place.
+ * @param redirectLocation
+ * The location to redirect to, may be a relative path (relative
+ * to the {@link javax.servlet.ServletContext}).
+ * @see javax.servlet.http.HttpServletResponse#sendRedirect(String)
+ * @see javax.servlet.http.HttpServletResponse#encodeRedirectURL(String)
+ */
+
+ public RedirectException(String message, String redirectLocation)
+ {
+ super(message);
+
+ _redirectLocation = redirectLocation;
+ }
+
+ public String getRedirectLocation()
+ {
+ return _redirectLocation;
+ }
+}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RenderRewoundException.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RenderRewoundException.java?rev=368410&r1=368409&r2=368410&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RenderRewoundException.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RenderRewoundException.java Thu Jan 12 09:12:21 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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,19 +17,19 @@
import org.apache.hivemind.ApplicationRuntimeException;
/**
- * A special subclass of {@link ApplicationRuntimeException} that can be thrown
- * when a component has determined that the state of the page has been
- * rewound.
- *
+ * A special subclass of {@link ApplicationRuntimeException} that can be thrown
+ * when a component has determined that the state of the page has been rewound.
+ *
* @author Howard Lewis Ship
- **/
+ */
public class RenderRewoundException extends ApplicationRuntimeException
{
+
private static final long serialVersionUID = -4212602864703507206L;
- public RenderRewoundException(Object component)
+ public RenderRewoundException(Object component)
{
super(null, component, null, null);
}
-}
\ 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