Example usage for org.apache.commons.collections15.functors PrototypeFactory getInstance

List of usage examples for org.apache.commons.collections15.functors PrototypeFactory getInstance

Introduction

In this page you can find the example usage for org.apache.commons.collections15.functors PrototypeFactory getInstance.

Prototype

public static <T> Factory<T> getInstance(T prototype) 

Source Link

Document

Factory method that performs validation.

Usage

From source file:org.lightadmin.core.config.domain.common.AbstractFieldSetConfigurationBuilder.java

@SuppressWarnings("unchecked")
protected B withCustomControl(SimpleTag customControl) {

    assertFieldMetadataType(currentFieldMetadata, AbstractFieldMetadata.class);

    try {//from  w w  w.  j a va 2  s  .  co m
        BeanUtils.setProperty(customControl, "field", currentFieldMetadata.getUuid());
    } catch (Exception e) {
        throw new IllegalArgumentException(e);
    }

    AbstractFieldMetadata fieldMetadata = (AbstractFieldMetadata) currentFieldMetadata;
    fieldMetadata.setCustomControlFactory(PrototypeFactory.getInstance(customControl));

    return (B) this;
}