You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2008/05/07 03:00:09 UTC
svn commit: r653960 [1/3] - in /tapestry/tapestry5/trunk:
tapestry-core/src/main/java/org/apache/tapestry/
tapestry-core/src/main/java/org/apache/tapestry/corelib/base/
tapestry-core/src/main/java/org/apache/tapestry/corelib/components/
tapestry-core/s...
Author: hlship
Date: Tue May 6 18:00:03 2008
New Revision: 653960
URL: http://svn.apache.org/viewvc?rev=653960&view=rev
Log:
TAPESTRY-2409: Service method advice fails when a parameter or return value type is an array
Added:
tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry/ioc/internal/services/ArraysSubject.java
tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry/ioc/internal/services/ArraysSubjectImpl.java
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/BlockNotFoundException.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ContentType.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/TapestryFilter.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ValidationTrackerImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractComponentEventLink.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractLink.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractPropertyOutput.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/ActionLink.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Any.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanDisplay.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditor.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/DateField.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Delegate.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Errors.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/EventLink.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/ExceptionDisplay.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Form.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/FormFragment.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/FormInjector.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Grid.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/GridColumns.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/GridPager.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/GridRows.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/If.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Label.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Loop.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Output.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/OutputRaw.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/PageLink.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Palette.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/PropertyEditor.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Radio.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/RadioGroup.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/RenderObject.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Select.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Submit.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/SubmitNotifier.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/TextArea.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/TextOutput.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Unless.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Zone.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/MethodAdviceDemo.java
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/AspectInterceptorBuilderImpl.java
tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry/ioc/internal/services/AspectInterceptorBuilderImplTest.java
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/BlockNotFoundException.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/BlockNotFoundException.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/BlockNotFoundException.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/BlockNotFoundException.java Tue May 6 18:00:03 2008
@@ -24,17 +24,17 @@
{
private static final long serialVersionUID = 81221040659940576L;
- private final Location _location;
+ private final Location location;
public BlockNotFoundException(String message, Location location)
{
super(message);
- _location = location;
+ this.location = location;
}
public Location getLocation()
{
- return _location;
+ return location;
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ContentType.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ContentType.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ContentType.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ContentType.java Tue May 6 18:00:03 2008
@@ -14,7 +14,7 @@
package org.apache.tapestry;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newCaseInsensitiveMap;
+import org.apache.tapestry.ioc.internal.util.CollectionFactory;
import org.apache.tapestry.ioc.internal.util.Defense;
import org.apache.tapestry.ioc.internal.util.InternalUtils;
@@ -29,11 +29,11 @@
*/
public final class ContentType
{
- private String _baseType = "";
+ private String baseType = "";
- private String _subType = "";
+ private String subType = "";
- private final Map<String, String> _parameters = newCaseInsensitiveMap();
+ private final Map<String, String> _parameters = CollectionFactory.newCaseInsensitiveMap();
/**
* Creates a new empty content type.
@@ -49,7 +49,6 @@
*/
public ContentType(String contentType)
{
- this();
parse(contentType);
}
@@ -66,7 +65,7 @@
ContentType ct = (ContentType) o;
- return _baseType.equals(ct._baseType) && _subType.equals(ct._subType) && _parameters.equals(ct._parameters);
+ return baseType.equals(ct.baseType) && subType.equals(ct.subType) && _parameters.equals(ct._parameters);
}
/**
@@ -74,7 +73,7 @@
*/
public String getBaseType()
{
- return _baseType;
+ return baseType;
}
/**
@@ -84,7 +83,7 @@
{
Defense.notNull(baseType, "baseType");
- _baseType = baseType;
+ this.baseType = baseType;
}
/**
@@ -92,7 +91,7 @@
*/
public String getSubType()
{
- return _subType;
+ return subType;
}
/**
@@ -102,7 +101,7 @@
{
Defense.notNull(subType, "subType");
- _subType = subType;
+ this.subType = subType;
}
/**
@@ -110,7 +109,7 @@
*/
public String getMimeType()
{
- return _baseType + "/" + _subType;
+ return baseType + "/" + subType;
}
/**
@@ -152,8 +151,8 @@
*/
public void parse(String contentType)
{
- _baseType = "";
- _subType = "";
+ baseType = "";
+ subType = "";
_parameters.clear();
StringTokenizer tokens = new StringTokenizer(contentType, ";");
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/TapestryFilter.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/TapestryFilter.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/TapestryFilter.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/TapestryFilter.java Tue May 6 18:00:03 2008
@@ -47,13 +47,13 @@
*/
public class TapestryFilter implements Filter
{
- private final Logger _logger = LoggerFactory.getLogger(TapestryFilter.class);
+ private final Logger logger = LoggerFactory.getLogger(TapestryFilter.class);
- private FilterConfig _config;
+ private FilterConfig config;
- private Registry _registry;
+ private Registry registry;
- private HttpServletRequestHandler _handler;
+ private HttpServletRequestHandler handler;
/**
* Initializes the filter using the {@link TapestryAppInitializer}. The application name is the capitalization of
@@ -61,11 +61,11 @@
*/
public final void init(FilterConfig filterConfig) throws ServletException
{
- _config = filterConfig;
+ config = filterConfig;
- ServletContext context = _config.getServletContext();
+ ServletContext context = config.getServletContext();
- String filterName = _config.getFilterName();
+ String filterName = config.getFilterName();
SymbolProvider provider = new ServletContextSymbolProvider(context);
@@ -73,22 +73,22 @@
appInitializer.addModules(provideExtraModuleDefs(context));
- _registry = appInitializer.getRegistry();
+ registry = appInitializer.getRegistry();
long start = appInitializer.getStartTime();
long toRegistry = appInitializer.getRegistryCreatedTime();
- ServletApplicationInitializer ai = _registry.getService("ServletApplicationInitializer",
- ServletApplicationInitializer.class);
+ ServletApplicationInitializer ai = registry.getService("ServletApplicationInitializer",
+ ServletApplicationInitializer.class);
ai.initializeApplication(filterConfig.getServletContext());
- _registry.performRegistryStartup();
+ registry.performRegistryStartup();
- _handler = _registry.getService("HttpServletRequestHandler", HttpServletRequestHandler.class);
+ handler = registry.getService("HttpServletRequestHandler", HttpServletRequestHandler.class);
- init(_registry);
+ init(registry);
long toFinish = System.currentTimeMillis();
@@ -100,7 +100,7 @@
int unrealized = 0;
- ServiceActivityScoreboard scoreboard = _registry
+ ServiceActivityScoreboard scoreboard = registry
.getService(ServiceActivityScoreboard.class);
List<ServiceActivity> serviceActivity = scoreboard.getServiceActivity();
@@ -131,12 +131,12 @@
f.format("\n%4.2f%% unrealized services (%d/%d)\n", 100. * unrealized / serviceActivity.size(), unrealized,
serviceActivity.size());
- _logger.info(buffer.toString());
+ logger.info(buffer.toString());
}
protected final FilterConfig getFilterConfig()
{
- return _config;
+ return config;
}
/**
@@ -165,13 +165,13 @@
{
try
{
- boolean handled = _handler.service((HttpServletRequest) request, (HttpServletResponse) response);
+ boolean handled = handler.service((HttpServletRequest) request, (HttpServletResponse) response);
if (!handled) chain.doFilter(request, response);
}
finally
{
- _registry.cleanupThread();
+ registry.cleanupThread();
}
}
@@ -180,13 +180,13 @@
*/
public final void destroy()
{
- destroy(_registry);
+ destroy(registry);
- _registry.shutdown();
+ registry.shutdown();
- _registry = null;
- _config = null;
- _handler = null;
+ registry = null;
+ config = null;
+ handler = null;
}
/**
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ValidationTrackerImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ValidationTrackerImpl.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ValidationTrackerImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ValidationTrackerImpl.java Tue May 6 18:00:03 2008
@@ -33,64 +33,38 @@
{
private static final long serialVersionUID = -3653306147088451811L;
- private final String _fieldName;
+ private final String fieldName;
- private String _input;
+ private String input;
- private String _errorMessage;
+ private String errorMessage;
FieldTracker(String fieldName)
{
- _fieldName = fieldName;
+ this.fieldName = fieldName;
}
-
- public String getFieldName()
- {
- return _fieldName;
- }
-
- public void setErrorMessage(String errorMessage)
- {
- _errorMessage = errorMessage;
- }
-
- public String getErrorMessage()
- {
- return _errorMessage;
- }
-
- public String getInput()
- {
- return _input;
- }
-
- public void setInput(String input)
- {
- _input = input;
- }
-
}
- private List<String> _extraErrors;
+ private List<String> extraErrors;
- private List<FieldTracker> _fieldTrackers;
+ private List<FieldTracker> fieldTrackers;
// Rebuilt on-demand
- private transient Map<String, FieldTracker> _fieldToTracker;
+ private transient Map<String, FieldTracker> fieldToTracker;
private void refreshFieldToTracker()
{
- if (_fieldToTracker != null)
+ if (fieldToTracker != null)
return;
- if (_fieldTrackers == null)
+ if (fieldTrackers == null)
return;
- _fieldToTracker = CollectionFactory.newMap();
+ fieldToTracker = CollectionFactory.newMap();
- for (FieldTracker ft : _fieldTrackers)
- _fieldToTracker.put(ft.getFieldName(), ft);
+ for (FieldTracker ft : fieldTrackers)
+ fieldToTracker.put(ft.fieldName, ft);
}
private FieldTracker get(Field field)
@@ -99,7 +73,7 @@
refreshFieldToTracker();
- FieldTracker result = InternalUtils.get(_fieldToTracker, key);
+ FieldTracker result = InternalUtils.get(fieldToTracker, key);
if (result == null)
result = new FieldTracker(key);
@@ -109,44 +83,44 @@
private void store(FieldTracker fieldTracker)
{
- if (_fieldTrackers == null)
- _fieldTrackers = CollectionFactory.newList();
+ if (fieldTrackers == null)
+ fieldTrackers = CollectionFactory.newList();
refreshFieldToTracker();
- String key = fieldTracker.getFieldName();
+ String key = fieldTracker.fieldName;
- if (!_fieldToTracker.containsKey(key))
+ if (!fieldToTracker.containsKey(key))
{
- _fieldTrackers.add(fieldTracker);
- _fieldToTracker.put(key, fieldTracker);
+ fieldTrackers.add(fieldTracker);
+ fieldToTracker.put(key, fieldTracker);
}
}
public void clear()
{
- _extraErrors = null;
- _fieldTrackers = null;
- _fieldToTracker = null;
+ extraErrors = null;
+ fieldTrackers = null;
+ fieldToTracker = null;
}
public String getError(Field field)
{
- return get(field).getErrorMessage();
+ return get(field).errorMessage;
}
public List<String> getErrors()
{
List<String> result = CollectionFactory.newList();
- if (_extraErrors != null)
- result.addAll(_extraErrors);
+ if (extraErrors != null)
+ result.addAll(extraErrors);
- if (_fieldTrackers != null)
+ if (fieldTrackers != null)
{
- for (FieldTracker ft : _fieldTrackers)
+ for (FieldTracker ft : fieldTrackers)
{
- String errorMessage = ft.getErrorMessage();
+ String errorMessage = ft.errorMessage;
if (errorMessage != null)
result.add(errorMessage);
@@ -163,36 +137,36 @@
public String getInput(Field field)
{
- return get(field).getInput();
+ return get(field).input;
}
public boolean inError(Field field)
{
- return InternalUtils.isNonBlank(get(field).getErrorMessage());
+ return InternalUtils.isNonBlank(get(field).errorMessage);
}
public void recordError(Field field, String errorMessage)
{
FieldTracker ft = get(field);
- ft.setErrorMessage(errorMessage);
+ ft.errorMessage = errorMessage;
store(ft);
}
public void recordError(String errorMessage)
{
- if (_extraErrors == null)
- _extraErrors = CollectionFactory.newList();
+ if (extraErrors == null)
+ extraErrors = CollectionFactory.newList();
- _extraErrors.add(errorMessage);
+ extraErrors.add(errorMessage);
}
public void recordInput(Field field, String input)
{
FieldTracker ft = get(field);
- ft.setInput(input);
+ ft.input = input;
store(ft);
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractComponentEventLink.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractComponentEventLink.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractComponentEventLink.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractComponentEventLink.java Tue May 6 18:00:03 2008
@@ -35,28 +35,28 @@
* methods.
*/
@Parameter
- private List<?> _context;
+ private List<?> context;
/**
* Binding the zone parameter turns the link into a an Ajax control that causes the related zone to be updated.
*/
@Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
- private String _zone;
+ private String zone;
@Environmental
- private ClientBehaviorSupport _clientBehaviorSupport;
+ private ClientBehaviorSupport clientBehaviorSupport;
void beginRender(MarkupWriter writer)
{
if (isDisabled()) return;
- Object[] contextArray = _context == null ? new Object[0] : _context.toArray();
+ Object[] contextArray = context == null ? new Object[0] : context.toArray();
Link link = createLink(contextArray);
writeLink(writer, link);
- if (_zone != null) _clientBehaviorSupport.linkZone(getClientId(), _zone);
+ if (zone != null) clientBehaviorSupport.linkZone(getClientId(), zone);
}
/**
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java Tue May 6 18:00:03 2008
@@ -37,22 +37,22 @@
* id, first by looking for a message key named "id-label" (substituting the component's actual id), then by
* converting the actual id to a presentable string (for example, "userId" to "User Id").
*/
- @Parameter(defaultPrefix = "literal")
- private String _label;
+ @Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
+ private String label;
/**
* If true, then the field will render out with a disabled attribute (to turn off client-side behavior). Further, a
* disabled field ignores any value in the request when the form is submitted.
*/
@Parameter("false")
- private boolean _disabled;
+ private boolean disabled;
@SuppressWarnings("unused")
@Mixin
- private DiscardBody _discardBody;
+ private DiscardBody discardBody;
@Environmental
- private ValidationDecorator _decorator;
+ private ValidationDecorator decorator;
protected static final FieldValidator NOOP_VALIDATOR = new FieldValidator()
{
@@ -109,32 +109,32 @@
* {@link #getClientId() clientId property}.
*/
@Parameter(value = "prop:componentResources.id", defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
- private String _clientId;
+ private String clientId;
- private String _assignedClientId;
+ private String assignedClientId;
- private String _controlName;
+ private String controlName;
@Environmental
- private FormSupport _formSupport;
+ private FormSupport formSupport;
@Environmental
- private PageRenderSupport _pageRenderSupport;
+ private PageRenderSupport pageRenderSupport;
@Inject
- private ComponentResources _resources;
+ private ComponentResources resources;
@Inject
- private ComponentDefaultProvider _defaultProvider;
+ private ComponentDefaultProvider defaultProvider;
final String defaultLabel()
{
- return _defaultProvider.defaultLabel(_resources);
+ return defaultProvider.defaultLabel(resources);
}
public final String getLabel()
{
- return _label;
+ return label;
}
@SetupRender
@@ -143,32 +143,32 @@
// By default, use the component id as the (base) client id. If the clientid
// parameter is bound, then that is the value to use.
- String id = _clientId;
+ String id = clientId;
- // Often, these controlName and _clientId will end up as the same value. There are many
+ // Often, these controlName and clientId will end up as the same value. There are many
// exceptions, including a form that renders inside a loop, or a form inside a component
// that is used multiple times.
- _assignedClientId = _pageRenderSupport.allocateClientId(id);
- String controlName = _formSupport.allocateControlName(id);
+ assignedClientId = pageRenderSupport.allocateClientId(id);
+ String controlName = formSupport.allocateControlName(id);
- _formSupport.storeAndExecute(this, new SetupAction(controlName));
- _formSupport.store(this, PROCESS_SUBMISSION_ACTION);
+ formSupport.storeAndExecute(this, new SetupAction(controlName));
+ formSupport.store(this, PROCESS_SUBMISSION_ACTION);
}
public final String getClientId()
{
- return _assignedClientId;
+ return assignedClientId;
}
public final String getControlName()
{
- return _controlName;
+ return controlName;
}
public final boolean isDisabled()
{
- return _disabled;
+ return disabled;
}
/**
@@ -176,12 +176,12 @@
*/
private void setupControlName(String controlName)
{
- _controlName = controlName;
+ this.controlName = controlName;
}
private void processSubmission()
{
- if (!_disabled) processSubmission(_controlName);
+ if (!disabled) processSubmission(controlName);
}
/**
@@ -191,7 +191,7 @@
*/
protected final Binding createDefaultParameterBinding(String parameterName)
{
- return _defaultProvider.defaultBinding(parameterName, _resources);
+ return defaultProvider.defaultBinding(parameterName, resources);
}
/**
@@ -209,7 +209,7 @@
@BeginRender
final void beforeDecorator()
{
- _decorator.beforeField(this);
+ decorator.beforeField(this);
}
/**
@@ -218,7 +218,7 @@
@AfterRender
final void afterDecorator()
{
- _decorator.afterField(this);
+ decorator.afterField(this);
}
/**
@@ -227,17 +227,17 @@
*/
protected final void decorateInsideField()
{
- _decorator.insideField(this);
+ decorator.insideField(this);
}
protected final void setDecorator(ValidationDecorator decorator)
{
- _decorator = decorator;
+ this.decorator = decorator;
}
protected final void setFormSupport(FormSupport formSupport)
{
- _formSupport = formSupport;
+ this.formSupport = formSupport;
}
/**
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractLink.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractLink.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractLink.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractLink.java Tue May 6 18:00:03 2008
@@ -30,48 +30,48 @@
public abstract class AbstractLink implements ClientElement
{
@Inject
- private ComponentInvocationMap _componentInvocationMap;
+ private ComponentInvocationMap componentInvocationMap;
/**
* An anchor value to append to the generated URL (the hash separator will be added automatically).
*/
@Parameter(defaultPrefix = LITERAL_BINDING_PREFIX)
- private String _anchor;
+ private String anchor;
/**
* If true, then then no link element is rendered (and no informal parameters as well). The body is, however, still
* rendered.
*/
@Parameter("false")
- private boolean _disabled;
+ private boolean disabled;
@Inject
- private ComponentResources _resources;
+ private ComponentResources resources;
@Inject
- private PageRenderSupport _pageRenderSupport;
+ private PageRenderSupport pageRenderSupport;
- private Link _link;
+ private Link link;
- private Element _element;
+ private Element element;
- private String _clientId;
+ private String clientId;
private String buildHref(Link link)
{
String href = link.toURI();
- if (_anchor == null) return href;
+ if (anchor == null) return href;
- return href + "#" + _anchor;
+ return href + "#" + anchor;
}
@SetupRender
void resetElementAndClientId()
{
- _element = null;
- _clientId = null;
+ element = null;
+ clientId = null;
}
/**
@@ -85,15 +85,15 @@
*/
protected final void writeLink(MarkupWriter writer, Link link, Object... namesAndValues)
{
- _element = writer.element("a", "href", buildHref(link));
+ element = writer.element("a", "href", buildHref(link));
writer.attributes(namesAndValues);
- _resources.renderInformalParameters(writer);
+ resources.renderInformalParameters(writer);
- _componentInvocationMap.store(_element, link);
+ componentInvocationMap.store(element, link);
- _link = link;
+ this.link = link;
}
/**
@@ -105,7 +105,7 @@
*/
public Link getLink()
{
- return _link;
+ return link;
}
/**
@@ -114,19 +114,19 @@
*/
public final String getClientId()
{
- if (_clientId == null)
+ if (clientId == null)
{
- if (_element == null)
+ if (element == null)
throw new IllegalStateException(
String.format("Client id for %s is not available as it did not render yet (or was disabled).",
- _resources.getCompleteId()));
+ resources.getCompleteId()));
- _clientId = _pageRenderSupport.allocateClientId(_resources);
+ clientId = pageRenderSupport.allocateClientId(resources);
- _element.forceAttributes("id", _clientId);
+ element.forceAttributes("id", clientId);
}
- return _clientId;
+ return clientId;
}
/**
@@ -135,7 +135,7 @@
*/
public boolean isDisabled()
{
- return _disabled;
+ return disabled;
}
/**
@@ -143,8 +143,8 @@
*/
final void inject(String anchor, ComponentInvocationMap map, ComponentResources resources)
{
- _anchor = anchor;
- _componentInvocationMap = map;
- _resources = resources;
+ this.anchor = anchor;
+ componentInvocationMap = map;
+ this.resources = resources;
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractPropertyOutput.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractPropertyOutput.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractPropertyOutput.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractPropertyOutput.java Tue May 6 18:00:03 2008
@@ -43,33 +43,33 @@
* Model for property displayed by the cell.
*/
@Parameter(required = true)
- private PropertyModel _model;
+ private PropertyModel model;
/**
* Resources used to search for block parameter overrides (this is normally the enclosing Grid component's
* resources).
*/
@Parameter(required = true)
- private ComponentResources _overrides;
+ private ComponentResources overrides;
/**
* Identifies the object being rendered. The component will extract a property from the object and render its value
- * (or delegate to a {@link Block} that will do so).
+ * (or delegate to a {@link org.apache.tapestry.Block} that will do so).
*/
@Parameter(required = true)
- private Object _object;
+ private Object object;
@Inject
- private BeanBlockSource _beanBlockSource;
+ private BeanBlockSource beanBlockSource;
@Inject
- private Environment _environment;
+ private Environment environment;
- private boolean _mustPopEnvironment;
+ private boolean mustPopEnvironment;
protected PropertyModel getPropertyModel()
{
- return _model;
+ return model;
}
/**
@@ -78,13 +78,13 @@
*/
protected Object renderPropertyValue(MarkupWriter writer, String overrideBlockId)
{
- Block override = _overrides.getBlockParameter(overrideBlockId);
+ Block override = overrides.getBlockParameter(overrideBlockId);
if (override != null) return override;
- String datatype = _model.getDataType();
+ String datatype = model.getDataType();
- if (_beanBlockSource.hasDisplayBlock(datatype))
+ if (beanBlockSource.hasDisplayBlock(datatype))
{
PropertyOutputContext context = new PropertyOutputContext()
{
@@ -100,19 +100,19 @@
public String getPropertyId()
{
- return _model.getId();
+ return model.getId();
}
public String getPropertyName()
{
- return _model.getPropertyName();
+ return model.getPropertyName();
}
};
- _environment.push(PropertyOutputContext.class, context);
- _mustPopEnvironment = true;
+ environment.push(PropertyOutputContext.class, context);
+ mustPopEnvironment = true;
- return _beanBlockSource.getDisplayBlock(datatype);
+ return beanBlockSource.getDisplayBlock(datatype);
}
Object value = readPropertyForObject();
@@ -132,21 +132,21 @@
Object readPropertyForObject()
{
- PropertyConduit conduit = _model.getConduit();
+ PropertyConduit conduit = model.getConduit();
try
{
- return conduit == null ? null : conduit.get(_object);
+ return conduit == null ? null : conduit.get(object);
}
catch (final NullPointerException ex)
{
- throw new NullPointerException(BaseMessages.nullValueInPath(_model.getPropertyName()));
+ throw new NullPointerException(BaseMessages.nullValueInPath(model.getPropertyName()));
}
}
private Messages getOverrideMessages()
{
- return _overrides.getContainerMessages();
+ return overrides.getContainerMessages();
}
/**
@@ -159,17 +159,17 @@
void afterRender()
{
- if (_mustPopEnvironment)
+ if (mustPopEnvironment)
{
- _environment.pop(PropertyOutputContext.class);
- _mustPopEnvironment = false;
+ environment.pop(PropertyOutputContext.class);
+ mustPopEnvironment = false;
}
}
// Used for testing.
void inject(final PropertyModel model, final Object object)
{
- _model = model;
- _object = object;
+ this.model = model;
+ this.object = object;
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java Tue May 6 18:00:03 2008
@@ -52,14 +52,14 @@
* the unbound value parameter.
*/
@Parameter(required = true, principal = true)
- private Object _value;
+ private Object value;
/**
* The object which will perform translation between server-side and client-side representations. If not specified,
* a value will usually be generated based on the type of the value parameter.
*/
@Parameter(required = true)
- private Translator<Object> _translate;
+ private Translator<Object> translate;
/**
* The object that will perform input validation (which occurs after translation). The translate binding prefix is
@@ -67,7 +67,7 @@
*/
@Parameter(defaultPrefix = TapestryConstants.VALIDATE_BINDING_PREFIX)
@SuppressWarnings("unchecked")
- private FieldValidator<Object> _validate;
+ private FieldValidator<Object> validate;
/**
* Provider of annotations used for some defaults. Annotation are usually provided in terms of the value parameter
@@ -76,7 +76,7 @@
* @see org.apache.tapestry.beaneditor.Width
*/
@Parameter
- private AnnotationProvider _annotationProvider;
+ private AnnotationProvider annotationProvider;
/**
* Defines how nulls on the server side, or sent from the client side, are treated. The selected strategy may
@@ -84,32 +84,32 @@
* zero, replaces nulls with the value 0.
*/
@Parameter(defaultPrefix = TapestryConstants.NULLFIELDSTRATEGY_BINDING_PREFIX, value = "default")
- private NullFieldStrategy _nulls;
+ private NullFieldStrategy nulls;
@Environmental
- private ValidationTracker _tracker;
+ private ValidationTracker tracker;
@Inject
- private FieldValidatorDefaultSource _fieldValidatorDefaultSource;
+ private FieldValidatorDefaultSource fieldValidatorDefaultSource;
@Inject
- private ComponentResources _resources;
+ private ComponentResources resources;
@Inject
- private Locale _locale;
+ private Locale locale;
@Inject
- private Request _request;
+ private Request request;
@Inject
- private FieldValidationSupport _fieldValidationSupport;
+ private FieldValidationSupport fieldValidationSupport;
@SuppressWarnings("unused")
@Mixin
- private RenderDisabled _renderDisabled;
+ private RenderDisabled renderDisabled;
@Inject
- private ComponentDefaultProvider _defaultProvider;
+ private ComponentDefaultProvider defaultProvider;
/**
* Computes a default value for the "translate" parameter using {@link org.apache.tapestry.services.ComponentDefaultProvider#defaultTranslator(String,
@@ -117,7 +117,7 @@
*/
final Translator defaultTranslate()
{
- return _defaultProvider.defaultTranslator("value", _resources);
+ return defaultProvider.defaultTranslator("value", resources);
}
final AnnotationProvider defaultAnnotationProvider()
@@ -126,7 +126,7 @@
{
public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
{
- return _resources.getParameterAnnotation("value", annotationClass);
+ return resources.getParameterAnnotation("value", annotationClass);
}
};
}
@@ -136,13 +136,13 @@
*/
final FieldValidator defaultValidate()
{
- Class type = _resources.getBoundType("value");
+ Class type = resources.getBoundType("value");
if (type == null) return NOOP_VALIDATOR;
- return _fieldValidatorDefaultSource.createDefaultValidator(this, _resources.getId(),
- _resources.getContainerMessages(), _locale, type,
- _resources.getAnnotationProvider("value"));
+ return fieldValidatorDefaultSource.createDefaultValidator(this, resources.getId(),
+ resources.getContainerMessages(), locale, type,
+ resources.getAnnotationProvider("value"));
}
/**
@@ -158,7 +158,7 @@
@BeginRender
final void begin(MarkupWriter writer)
{
- String value = _tracker.getInput(this);
+ String value = tracker.getInput(this);
// If this is a response to a form submission, and the user provided a value.
// then send that exact value back at them.
@@ -169,14 +169,14 @@
// Then let the translator and or various triggered events get it into
// a format ready to be sent to the client.
- value = _fieldValidationSupport.toClient(_value, _resources, _translate, _nulls);
+ value = fieldValidationSupport.toClient(this.value, resources, translate, nulls);
}
writeFieldTag(writer, value);
- _validate.render(writer);
+ validate.render(writer);
- _resources.renderInformalParameters(writer);
+ resources.renderInformalParameters(writer);
decorateInsideField();
}
@@ -198,28 +198,28 @@
@Override
protected final void processSubmission(String elementName)
{
- String rawValue = _request.getParameter(elementName);
+ String rawValue = request.getParameter(elementName);
- _tracker.recordInput(this, rawValue);
+ tracker.recordInput(this, rawValue);
try
{
- Object translated = _fieldValidationSupport.parseClient(rawValue, _resources, _translate, _nulls);
+ Object translated = fieldValidationSupport.parseClient(rawValue, resources, translate, nulls);
- _fieldValidationSupport.validate(translated, _resources, _validate);
+ fieldValidationSupport.validate(translated, resources, validate);
- _value = translated;
+ value = translated;
}
catch (ValidationException ex)
{
- _tracker.recordError(this, ex.getMessage());
+ tracker.recordError(this, ex.getMessage());
}
}
@Override
public boolean isRequired()
{
- return _validate.isRequired();
+ return validate.isRequired();
}
/**
@@ -230,7 +230,7 @@
*/
protected final String getWidth()
{
- Width width = _annotationProvider.getAnnotation(Width.class);
+ Width width = annotationProvider.getAnnotation(Width.class);
if (width == null) return null;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/ActionLink.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/ActionLink.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/ActionLink.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/ActionLink.java Tue May 6 18:00:03 2008
@@ -26,11 +26,11 @@
public class ActionLink extends AbstractComponentEventLink
{
@Inject
- private ComponentResources _resources;
+ private ComponentResources resources;
protected Link createLink(Object[] contextArray)
{
- return _resources.createActionLink(ACTION_EVENT, false, contextArray);
+ return resources.createActionLink(ACTION_EVENT, false, contextArray);
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Any.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Any.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Any.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Any.java Tue May 6 18:00:03 2008
@@ -28,21 +28,21 @@
public class Any
{
@Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
- private String _element;
+ private String element;
@Inject
- private ComponentResources _resources;
+ private ComponentResources resources;
String defaultElement()
{
- return _resources.getElementName("div");
+ return resources.getElementName("div");
}
void beginRender(MarkupWriter writer)
{
- writer.element(_element);
+ writer.element(element);
- _resources.renderInformalParameters(writer);
+ resources.renderInformalParameters(writer);
}
void afterRender(MarkupWriter writer)
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanDisplay.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanDisplay.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanDisplay.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanDisplay.java Tue May 6 18:00:03 2008
@@ -45,14 +45,14 @@
*/
@Parameter(required = true)
@Property(write = false)
- private Object _object;
+ private Object object;
/**
* If true, then <span> tags around each output property will be omitted. If false, then a span tag (to
* identify the id of each property as the CSS class attribute) will be included.
*/
@Parameter(value = "false")
- private boolean _lean;
+ private boolean lean;
/**
* The model that identifies the parameters to be displayed, their order, and every other aspect. If not specified,
@@ -60,7 +60,7 @@
*/
@Parameter
@Property(write = false)
- private BeanModel _model;
+ private BeanModel model;
/**
* A comma-separated list of property names to be retained from the {@link org.apache.tapestry.beaneditor.BeanModel}.
@@ -69,14 +69,14 @@
*/
@SuppressWarnings("unused")
@Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
- private String _include;
+ private String include;
/**
* A comma-separated list of property names to be removed from the {@link BeanModel}. The names are
* case-insensitive.
*/
@Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
- private String _exclude;
+ private String exclude;
/**
* A comma-separated list of property names indicating the order in which the properties should be presented. The
@@ -84,7 +84,7 @@
* order.
*/
@Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
- private String _reorder;
+ private String reorder;
/**
* Where to search for local overrides of property display blocks as block parameters. Further, the container of the
@@ -94,34 +94,34 @@
*/
@Parameter(value = "componentResources")
@Property(write = false)
- private ComponentResources _overrides;
+ private ComponentResources overrides;
@Inject
- private ComponentDefaultProvider _defaultProvider;
+ private ComponentDefaultProvider defaultProvider;
@Inject
- private ComponentResources _resources;
+ private ComponentResources resources;
@Inject
- private BeanModelSource _modelSource;
+ private BeanModelSource modelSource;
@Property
- private String _propertyName;
+ private String propertyName;
/**
* Defaults the object parameter to a property of the container matching the BeanEditForm's id.
*/
Binding defaultObject()
{
- return _defaultProvider.defaultBinding("object", _resources);
+ return defaultProvider.defaultBinding("object", resources);
}
void setupRender()
{
- if (_model == null) _model = _modelSource.create(_object.getClass(), false, _overrides
+ if (model == null) model = modelSource.create(object.getClass(), false, overrides
.getContainerResources());
- BeanModelUtils.modify(_model, null, _include, _exclude, _reorder);
+ BeanModelUtils.modify(model, null, include, exclude, reorder);
}
/**
@@ -129,7 +129,7 @@
*/
public PropertyModel getPropertyModel()
{
- return _model.get(_propertyName);
+ return model.get(propertyName);
}
public String getLabelClass()
@@ -139,7 +139,7 @@
private String generateClassValue(String className)
{
- if (_lean) return className;
+ if (lean) return className;
return className + " " + getPropertyModel().getId();
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java Tue May 6 18:00:03 2008
@@ -15,7 +15,10 @@
package org.apache.tapestry.corelib.components;
import org.apache.tapestry.*;
-import org.apache.tapestry.annotations.*;
+import org.apache.tapestry.annotations.Component;
+import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.annotations.Property;
+import org.apache.tapestry.annotations.SupportsInformalParameters;
import org.apache.tapestry.beaneditor.BeanModel;
import org.apache.tapestry.internal.beaneditor.BeanModelUtils;
import org.apache.tapestry.ioc.annotations.Inject;
@@ -46,7 +49,7 @@
*/
@Parameter(value = "message:submit-label", defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
@Property
- private String _submitLabel;
+ private String submitLabel;
/**
* The object to be edited. This will be read when the component renders and updated when the form for the component
@@ -57,7 +60,7 @@
@SuppressWarnings("unused")
@Parameter(required = true)
@Property
- private Object _object;
+ private Object object;
/**
* A comma-separated list of property names to be retained from the {@link org.apache.tapestry.beaneditor.BeanModel}.
@@ -66,7 +69,7 @@
*/
@SuppressWarnings("unused")
@Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
- private String _include;
+ private String include;
/**
* A comma-separated list of property names to be removed from the {@link org.apache.tapestry.beaneditor.BeanModel}.
@@ -74,7 +77,7 @@
*/
@SuppressWarnings("unused")
@Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
- private String _exclude;
+ private String exclude;
/**
* A comma-separated list of property names indicating the order in which the properties should be presented. The
@@ -83,27 +86,23 @@
*/
@SuppressWarnings("unused")
@Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
- private String _reorder;
+ private String reorder;
/**
* If true, the default, then the embedded Form component will use client-side validation.
*/
- @SuppressWarnings("unused")
@Parameter
- private boolean _clientValidation = true;
+ private boolean clientValidation = true;
/**
* Binding the zone parameter will cause the form submission to be handled as an Ajax request that updates the
* indicated zone. Often a BeanEditForm will update the same zone that contains it.
*/
@Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
- private String _zone;
+ private String zone;
@Component(parameters = { "clientValidation=inherit:clientValidation", "zone=inherit:zone" })
- private Form _form;
-
- @InjectComponent
- private BeanEditor _editor;
+ private Form form;
/**
* The model that identifies the parameters to be edited, their order, and every other aspect. If not specified, a
@@ -112,38 +111,38 @@
@SuppressWarnings("unused")
@Parameter
@Property
- private BeanModel _model;
+ private BeanModel model;
@Inject
- private ComponentDefaultProvider _defaultProvider;
+ private ComponentDefaultProvider defaultProvider;
@Inject
- private ComponentResources _resources;
+ private ComponentResources resources;
@Inject
- private BeanModelSource _beanModelSource;
+ private BeanModelSource beanModelSource;
/**
* Defaults the object parameter to a property of the container matching the BeanEditForm's id.
*/
Binding defaultObject()
{
- return _defaultProvider.defaultBinding("object", _resources);
+ return defaultProvider.defaultBinding("object", resources);
}
void onPrepareFromForm()
{
- _resources.triggerEvent(Form.PREPARE, null, null);
+ resources.triggerEvent(Form.PREPARE, null, null);
- if (_model == null)
+ if (model == null)
{
- Class beanType = _resources.getBoundType("object");
+ Class beanType = resources.getBoundType("object");
- _model = _beanModelSource.create(beanType, true, _resources.getContainerResources());
+ model = beanModelSource.create(beanType, true, resources.getContainerResources());
}
- BeanModelUtils.modify(_model, null, _include, _exclude, _reorder);
+ BeanModelUtils.modify(model, null, include, exclude, reorder);
}
@@ -152,32 +151,32 @@
*/
public String getClientId()
{
- return _form.getClientId();
+ return form.getClientId();
}
public void clearErrors()
{
- _form.clearErrors();
+ form.clearErrors();
}
public boolean getHasErrors()
{
- return _form.getHasErrors();
+ return form.getHasErrors();
}
public boolean isValid()
{
- return _form.isValid();
+ return form.isValid();
}
public void recordError(Field field, String errorMessage)
{
- _form.recordError(field, errorMessage);
+ form.recordError(field, errorMessage);
}
public void recordError(String errorMessage)
{
- _form.recordError(errorMessage);
+ form.recordError(errorMessage);
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditor.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditor.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditor.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditor.java Tue May 6 18:00:03 2008
@@ -54,7 +54,7 @@
* that a non-null value is ready to be read or updated.
*/
@Parameter
- private Object _object;
+ private Object object;
/**
* A comma-separated list of property names to be retained from the {@link org.apache.tapestry.beaneditor.BeanModel}.
@@ -63,14 +63,14 @@
*/
@SuppressWarnings("unused")
@Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
- private String _include;
+ private String include;
/**
* A comma-separated list of property names to be removed from the {@link org.apache.tapestry.beaneditor.BeanModel}.
* The names are case-insensitive.
*/
@Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
- private String _exclude;
+ private String exclude;
/**
* A comma-separated list of property names indicating the order in which the properties should be presented. The
@@ -78,7 +78,7 @@
* order.
*/
@Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
- private String _reorder;
+ private String reorder;
/**
* The model that identifies the parameters to be edited, their order, and every other aspect. If not specified, a
@@ -86,7 +86,7 @@
*/
@Parameter
@Property(write = false)
- private BeanModel _model;
+ private BeanModel model;
/**
* Where to search for local overrides of property editing blocks as block parameters. Further, the container of the
@@ -96,71 +96,71 @@
*/
@Parameter(value = "componentResources")
@Property(write = false)
- private ComponentResources _overrides;
+ private ComponentResources overrides;
@Inject
- private BeanModelSource _modelSource;
+ private BeanModelSource modelSource;
@Inject
- private ComponentDefaultProvider _defaultProvider;
+ private ComponentDefaultProvider defaultProvider;
@Inject
- private ComponentResources _resources;
+ private ComponentResources resources;
@Environmental
- private FormSupport _formSupport;
+ private FormSupport formSupport;
// Value that change with each change to the current property:
@Property
- private String _propertyName;
+ private String propertyName;
/**
* Defaults the object parameter to a property of the container matching the BeanEditForm's id.
*/
Binding defaultObject()
{
- return _defaultProvider.defaultBinding("object", _resources);
+ return defaultProvider.defaultBinding("object", resources);
}
// Needed for testing as well
public Object getObject()
{
- return _object;
+ return object;
}
void setupRender()
{
- _formSupport.storeAndExecute(this, new Prepare());
+ formSupport.storeAndExecute(this, new Prepare());
}
void doPrepare()
{
- if (_model == null)
+ if (model == null)
{
- Class type = _resources.getBoundType("object");
- _model = _modelSource.create(type, true, _overrides.getContainerResources());
+ Class type = resources.getBoundType("object");
+ model = modelSource.create(type, true, overrides.getContainerResources());
}
- BeanModelUtils.modify(_model, null, _include, _exclude, _reorder);
+ BeanModelUtils.modify(model, null, include, exclude, reorder);
// The only problem here is that if the bound property is backed by a persistent field, it
// is assigned (and stored to the session, and propagated around the cluster) first,
// before values are assigned.
- if (_object == null)
+ if (object == null)
{
try
{
- _object = _model.newInstance();
+ object = model.newInstance();
}
catch (Exception ex)
{
- String message = InternalMessages.failureInstantiatingObject(_model.getBeanType(),
- _resources.getCompleteId(),
+ String message = InternalMessages.failureInstantiatingObject(model.getBeanType(),
+ resources.getCompleteId(),
ex);
- throw new TapestryException(message, _resources.getLocation(), ex);
+ throw new TapestryException(message, resources.getLocation(), ex);
}
}
@@ -169,8 +169,8 @@
// For testing
void inject(ComponentResources resources, ComponentResources overrides, BeanModelSource source)
{
- _resources = resources;
- _overrides = overrides;
- _modelSource = source;
+ this.resources = resources;
+ this.overrides = overrides;
+ modelSource = source;
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java Tue May 6 18:00:03 2008
@@ -29,25 +29,25 @@
*/
public class Checkbox extends AbstractField
{
- @Inject
- private Request _request;
-
- @SuppressWarnings("unused")
- @Mixin
- private RenderDisabled _renderDisabled;
-
/**
* The value to be read or updated. If not bound, the Checkbox will attempt to edit a property of its container
* whose name matches the component's id.
*/
@Parameter(required = true)
- private boolean _value;
+ private boolean value;
+
+ @Inject
+ private Request request;
+
+ @SuppressWarnings("unused")
+ @Mixin
+ private RenderDisabled renderDisabled;
@Inject
- private ComponentResources _resources;
+ private ComponentResources resources;
@Environmental
- private ValidationTracker _tracker;
+ private ValidationTracker tracker;
Binding defaultValue()
{
@@ -57,9 +57,9 @@
@BeginRender
void begin(MarkupWriter writer)
{
- String asSubmitted = _tracker.getInput(this);
+ String asSubmitted = tracker.getInput(this);
- boolean checked = asSubmitted != null ? Boolean.parseBoolean(asSubmitted) : _value;
+ boolean checked = asSubmitted != null ? Boolean.parseBoolean(asSubmitted) : value;
writer.element("input", "type", "checkbox",
@@ -69,7 +69,7 @@
"checked", checked ? "checked" : null);
- _resources.renderInformalParameters(writer);
+ resources.renderInformalParameters(writer);
decorateInsideField();
}
@@ -83,13 +83,13 @@
@Override
protected void processSubmission(String elementName)
{
- String postedValue = _request.getParameter(elementName);
+ String postedValue = request.getParameter(elementName);
// record as "true" or "false"
- _tracker.recordInput(this, Boolean.toString(postedValue != null));
+ tracker.recordInput(this, Boolean.toString(postedValue != null));
- _value = postedValue != null;
+ value = postedValue != null;
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/DateField.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/DateField.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/DateField.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/DateField.java Tue May 6 18:00:03 2008
@@ -46,7 +46,7 @@
* The value parameter of a DateField must be a {@link Date}.
*/
@Parameter(required = true, principal = true)
- private Date _value;
+ private Date value;
/**
* The object that will perform input validation (which occurs after translation). The translate binding prefix is
@@ -54,45 +54,45 @@
*/
@Parameter(defaultPrefix = "validate")
@SuppressWarnings("unchecked")
- private FieldValidator<Object> _validate = NOOP_VALIDATOR;
+ private FieldValidator<Object> validate = NOOP_VALIDATOR;
- @Parameter(defaultPrefix = "asset", value = "datefield.gif")
- private Asset _icon;
+ @Parameter(defaultPrefix = TapestryConstants.ASSET_BINDING_PREFIX, value = "datefield.gif")
+ private Asset icon;
@Environmental
- private PageRenderSupport _support;
+ private PageRenderSupport support;
@Environmental
- private ValidationTracker _tracker;
+ private ValidationTracker tracker;
@Inject
- private ComponentResources _resources;
+ private ComponentResources resources;
@Inject
- private Messages _messages;
+ private Messages messages;
@Inject
- private Request _request;
+ private Request request;
@Inject
- private Locale _locale;
+ private Locale locale;
@Inject
- private FieldValidatorDefaultSource _fieldValidatorDefaultSource;
+ private FieldValidatorDefaultSource fieldValidatorDefaultSource;
@Inject
- private FieldValidationSupport _fieldValidationSupport;
+ private FieldValidationSupport fieldValidationSupport;
/**
* For output, format nicely and unambiguously as four digits.
*/
- private final DateFormat _outputFormat = new SimpleDateFormat("MM/dd/yyyy");
+ private final DateFormat outputFormat = new SimpleDateFormat("MM/dd/yyyy");
/**
* When the user types a value, they may only type two digits for the year; SimpleDateFormat will do something
* reasonable. If they use the popup, it will be unambiguously 4 digits.
*/
- private final DateFormat _inputFormat = new SimpleDateFormat("MM/dd/yy");
+ private final DateFormat inputFormat = new SimpleDateFormat("MM/dd/yy");
/**
* The default value is a property of the container whose name matches the component's id. May return null if the
@@ -109,15 +109,15 @@
final FieldValidator defaultValidate()
{
- return _fieldValidatorDefaultSource.createDefaultValidator(this, _resources.getId(),
- _resources.getContainerMessages(), _locale,
- Date.class,
- _resources.getAnnotationProvider("value"));
+ return fieldValidatorDefaultSource.createDefaultValidator(this, resources.getId(),
+ resources.getContainerMessages(), locale,
+ Date.class,
+ resources.getAnnotationProvider("value"));
}
void beginRender(MarkupWriter writer)
{
- String value = _tracker.getInput(this);
+ String value = tracker.getInput(this);
if (value == null) value = formatCurrentValue();
@@ -136,9 +136,9 @@
writeDisabled(writer);
- _validate.render(writer);
+ validate.render(writer);
- _resources.renderInformalParameters(writer);
+ resources.renderInformalParameters(writer);
decorateInsideField();
@@ -152,7 +152,7 @@
"class", "t-calendar-trigger",
- "src", _icon.toClientURL(),
+ "src", icon.toClientURL(),
"alt", "[Show]");
writer.end(); // img
@@ -165,7 +165,7 @@
// TODO: consolodate DatePicker initialization across the page.
- _support.addScript("new Tapestry.DateField(%s);", setup);
+ support.addScript("new Tapestry.DateField(%s);", setup);
}
private void writeDisabled(MarkupWriter writer)
@@ -176,17 +176,17 @@
private String formatCurrentValue()
{
- if (_value == null) return "";
+ if (value == null) return "";
- return _outputFormat.format(_value);
+ return outputFormat.format(value);
}
@Override
protected void processSubmission(String elementName)
{
- String value = _request.getParameter(elementName);
+ String value = request.getParameter(elementName);
- _tracker.recordInput(this, value);
+ tracker.recordInput(this, value);
Date parsedValue = null;
@@ -194,40 +194,40 @@
{
if (InternalUtils.isNonBlank(value))
parsedValue =
- _inputFormat.parse(value);
+ inputFormat.parse(value);
}
catch (ParseException ex)
{
- _tracker.recordError(this, "Date value is not parseable.");
+ tracker.recordError(this, "Date value is not parseable.");
return;
}
try
{
- _fieldValidationSupport.validate(parsedValue, _resources, _validate);
+ fieldValidationSupport.validate(parsedValue, resources, validate);
- _value = parsedValue;
+ this.value = parsedValue;
}
catch (ValidationException ex)
{
- _tracker.recordError(this, ex.getMessage());
+ tracker.recordError(this, ex.getMessage());
}
}
void injectResources(ComponentResources resources)
{
- _resources = resources;
+ this.resources = resources;
}
void injectMessages(Messages messages)
{
- _messages = messages;
+ this.messages = messages;
}
@Override
public boolean isRequired()
{
- return _validate.isRequired();
+ return validate.isRequired();
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Delegate.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Delegate.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Delegate.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Delegate.java Tue May 6 18:00:03 2008
@@ -28,10 +28,10 @@
* instance, or a {@link Block}.
*/
@Parameter(required = true)
- private Object _to;
+ private Object to;
Object beginRender()
{
- return _to;
+ return to;
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Errors.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Errors.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Errors.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Errors.java Tue May 6 18:00:03 2008
@@ -36,35 +36,35 @@
* you may continue.".
*/
@Parameter("message:default-banner")
- private String _banner;
+ private String banner;
/**
* The CSS class for the div element rendered by the component. The default value is "t-error".
*/
- @Parameter
- private String _class = TapestryConstants.ERROR_CLASS;
+ @Parameter(name = "class")
+ private String className = TapestryConstants.ERROR_CLASS;
// Allow null so we can generate a better error message if missing
@Environmental(false)
- private ValidationTracker _tracker;
+ private ValidationTracker tracker;
@Environmental
- private FormSupport _formSupport;
+ private FormSupport formSupport;
void beginRender(MarkupWriter writer)
{
- if (_tracker == null) throw new RuntimeException(InternalMessages.encloseErrorsInForm());
+ if (tracker == null) throw new RuntimeException(InternalMessages.encloseErrorsInForm());
- if (!_tracker.getHasErrors()) return;
+ if (!tracker.getHasErrors()) return;
- writer.element("div", "class", _class);
+ writer.element("div", "class", className);
// Inner div for the banner text
writer.element("div");
- writer.write(_banner);
+ writer.write(banner);
writer.end();
- List<String> errors = _tracker.getErrors();
+ List<String> errors = tracker.getErrors();
if (!errors.isEmpty())
{
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/EventLink.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/EventLink.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/EventLink.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/EventLink.java Tue May 6 18:00:03 2008
@@ -39,20 +39,20 @@
* triggers any arbitrary event on <em>its container</em>.
*/
@Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
- private String _event;
+ private String event;
+
+ @Inject
+ private ComponentResources resources;
String defaultEvent()
{
- return _resources.getId();
+ return resources.getId();
}
- @Inject
- private ComponentResources _resources;
-
protected Link createLink(Object[] eventContext)
{
- ComponentResources containerResources = _resources.getContainerResources();
+ ComponentResources containerResources = resources.getContainerResources();
- return containerResources.createActionLink(_event, false, eventContext);
+ return containerResources.createActionLink(event, false, eventContext);
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/ExceptionDisplay.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/ExceptionDisplay.java?rev=653960&r1=653959&r2=653960&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/ExceptionDisplay.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/ExceptionDisplay.java Tue May 6 18:00:03 2008
@@ -14,8 +14,8 @@
package org.apache.tapestry.corelib.components;
-import org.apache.tapestry.annotations.Property;
import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.annotations.Property;
import org.apache.tapestry.internal.InternalConstants;
import org.apache.tapestry.ioc.annotations.Inject;
import org.apache.tapestry.ioc.annotations.Symbol;
@@ -37,49 +37,49 @@
* Exception to report.
*/
@Parameter(required = true)
- private Throwable _exception;
+ private Throwable exception;
@Inject
- private ExceptionAnalyzer _analyzer;
+ private ExceptionAnalyzer analyzer;
@Inject
@Symbol(InternalConstants.TAPESTRY_APP_PACKAGE_PARAM)
- private String _appPackage;
+ private String appPackage;
@Property
- private ExceptionInfo _info;
+ private ExceptionInfo info;
@Property
- private String _propertyName;
+ private String propertyName;
@Property
- private StackTraceElement _frame;
+ private StackTraceElement frame;
@Property
- private List<ExceptionInfo> _stack;
+ private List<ExceptionInfo> stack;
void setupRender()
{
- ExceptionAnalysis analysis = _analyzer.analyze(_exception);
+ ExceptionAnalysis analysis = analyzer.analyze(exception);
- _stack = analysis.getExceptionInfos();
+ stack = analysis.getExceptionInfos();
}
public boolean getShowPropertyList()
{
// True if either is non-empty
- return !(_info.getPropertyNames().isEmpty() && _info.getStackTrace().isEmpty());
+ return !(info.getPropertyNames().isEmpty() && info.getStackTrace().isEmpty());
}
public Object getPropertyValue()
{
- return _info.getProperty(_propertyName);
+ return info.getProperty(propertyName);
}
public String getFrameClass()
{
- if (_frame.getClassName().startsWith(_appPackage) && _frame.getLineNumber() > 0) return "t-usercode-frame";
+ if (frame.getClassName().startsWith(appPackage) && frame.getLineNumber() > 0) return "t-usercode-frame";
return null;
}