Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package org.cdlflex.ui.model;
A read-only Model that converts the object of the given property model into something else (e.g. extract a value).

<T> The type of the property model
<C> The target type of the conversion
public abstract class PropertyConvertingModel<T, C> extends AbstractReadOnlyModel<C> {

The PropertyModel being converted
    private PropertyModel<T> propertyModel;

Construct with a wrapped (IModel) or unwrapped (non-IModel) object and a property expression that works on the given model.

modelObject The model object, which may or may not implement IModel
expression the expression accessing the property
    public PropertyConvertingModel(Object modelObjectString expression) {
        this. = new PropertyModel<>(modelObjectexpression);
    public C getObject() {
        return convert(.getObject());

Converts the extracted property object into something else.

object the object to be transformed
the transformed object
    protected abstract C convert(T object);

Returns the underlying property model.

the property model
    protected PropertyModel<T> getPropertyModel() {
        return ;
New to GrepCode? Check out our FAQ X