All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.tools4j.groovytables.ReflectionConstructionMethodPrecursor.groovy Maven / Gradle / Ivy

Go to download

A groovy API which allows you to create lists of objects using a table like grammar.

There is a newer version: 1.6
Show newest version
package org.tools4j.groovytables

import groovy.transform.ToString

/**
 * User: ben
 * Date: 14/03/2016
 * Time: 5:45 PM
 */
@ToString
class ReflectionConstructionMethodPrecursor implements ConstructionMethodPrecursor{
    final Suitability suitability;
    final Object[] rawArgs;
    final ReflectionConstructionMethod constructionMethod
    final List> fieldSetPrecursors

    final static NOT_SUITABLE = new ReflectionConstructionMethodPrecursor(Suitability.NOT_SUITABLE, null, null, null);

    ReflectionConstructionMethodPrecursor(final Suitability suitability, final Object[] rawArgs, final ReflectionConstructionMethod constructionMethod, List fieldSetPrecursors) {
        this.suitability = suitability
        this.rawArgs = rawArgs
        this.constructionMethod = constructionMethod
        this.fieldSetPrecursors = fieldSetPrecursors
    }

    TypeCoercionResult executeConstructionMethod() {
        return new TypeCoercionResult(constructionMethod.construct(fieldSetPrecursors), suitability, constructionMethod);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy