Browse Source

polish

conversation
Keith Donald 16 years ago
parent
commit
bbe4c2b611
  1. 7
      org.springframework.context/src/main/java/org/springframework/ui/binding/support/CollectionTypeDescriptor.java
  2. 5
      org.springframework.context/src/main/java/org/springframework/ui/binding/support/DefaultFieldModel.java
  3. 16
      org.springframework.context/src/main/java/org/springframework/ui/binding/support/DefaultPresentationModel.java
  4. 3
      org.springframework.context/src/main/java/org/springframework/ui/binding/support/DefaultPresentationModelFactory.java

7
org.springframework.context/src/main/java/org/springframework/ui/binding/support/CollectionTypeDescriptor.java

@ -18,6 +18,11 @@ package org.springframework.ui.binding.support; @@ -18,6 +18,11 @@ package org.springframework.ui.binding.support;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
/**
* A type descriptor for a parameterizable collection type such as a java.util.List<?>.
* @author Keith Donald
* @since 3.0
*/
public class CollectionTypeDescriptor {
private Class<?> type;
@ -38,7 +43,7 @@ public class CollectionTypeDescriptor { @@ -38,7 +43,7 @@ public class CollectionTypeDescriptor {
}
/**
* The element type.
* The parameterized collection element type.
*/
public Class<?> getElementType() {
return elementType;

5
org.springframework.context/src/main/java/org/springframework/ui/binding/support/DefaultFieldModel.java

@ -41,6 +41,11 @@ import org.springframework.ui.format.Formatter; @@ -41,6 +41,11 @@ import org.springframework.ui.format.Formatter;
import org.springframework.ui.message.MessageBuilder;
import org.springframework.ui.message.ResolvableArgument;
/**
* Default FieldModel implementation suitable for use in most environments.
* @author Keith Donald
* @since 3.0
*/
public class DefaultFieldModel implements FieldModel {
private ValueModel valueModel;

16
org.springframework.context/src/main/java/org/springframework/ui/binding/support/DefaultPresentationModel.java

@ -32,20 +32,19 @@ import org.springframework.core.convert.support.DefaultTypeConverter; @@ -32,20 +32,19 @@ import org.springframework.core.convert.support.DefaultTypeConverter;
import org.springframework.ui.binding.FieldModel;
import org.springframework.ui.binding.FieldNotFoundException;
import org.springframework.ui.binding.PresentationModel;
import org.springframework.ui.binding.binder.Binder;
import org.springframework.ui.binding.config.FieldModelConfiguration;
import org.springframework.ui.binding.config.Condition;
import org.springframework.ui.binding.config.FieldModelConfiguration;
import org.springframework.ui.format.Formatter;
import org.springframework.util.Assert;
/**
* A generic {@link Binder binder} suitable for use in most environments.
* A default PresentationModel implementation suitable for use in most environments.
* @author Keith Donald
* @since 3.0
* @see #setFormatterRegistry(FormatterRegistry)
* @see #setMessageSource(MessageSource)
* @see #setTypeConverter(TypeConverter)
* @see #bind(Map)
* @see #field(String)
*/
public class DefaultPresentationModel implements PresentationModel {
@ -103,9 +102,9 @@ public class DefaultPresentationModel implements PresentationModel { @@ -103,9 +102,9 @@ public class DefaultPresentationModel implements PresentationModel {
}
/**
* Add a a new FieldModelRule for the property at the path specified.
* @param propertyPath binding rule property path in format prop.nestedProp
* @return a builder for the binding rule
* Add a FieldModel rule at the domain object property path.
* @param propertyPath the domain object property path in format &lt;prop&gt;[.nestedProp]
* @return a builder for the field model configuration
*/
public FieldModelConfiguration field(String propertyPath) {
FieldPath path = new FieldPath(propertyPath);
@ -116,6 +115,9 @@ public class DefaultPresentationModel implements PresentationModel { @@ -116,6 +115,9 @@ public class DefaultPresentationModel implements PresentationModel {
return rule;
}
/**
* The domain-layer model this presentation model coordinates with.
*/
public Object getDomainModel() {
return domainModel;
}

3
org.springframework.context/src/main/java/org/springframework/ui/binding/support/DefaultPresentationModelFactory.java

@ -22,8 +22,9 @@ import org.springframework.ui.binding.PresentationModel; @@ -22,8 +22,9 @@ import org.springframework.ui.binding.PresentationModel;
import org.springframework.ui.binding.PresentationModelFactory;
/**
* BindingFactoryLocator implementation that uses a {@link IdentityHashMap} to map models to BindingFactories.
* Default PresentationModelFactory implementation that uses a {@link IdentityHashMap} to map domain models to PresentationModels.
* @author Keith Donald
* @since 3.0
*/
public class DefaultPresentationModelFactory implements PresentationModelFactory {

Loading…
Cancel
Save