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

net.fortuna.ical4j.model.ParameterFactoryWrapper.groovy Maven / Gradle / Ivy

There is a newer version: 4.0.8
Show newest version
package net.fortuna.ical4j.model

import net.fortuna.ical4j.model.ParameterFactory

class ParameterFactoryWrapper extends AbstractFactory {

    Class parameterClass

    ParameterFactory factory

    ParameterFactoryWrapper(Class paramClass, ParameterFactory factory) {
        this.parameterClass = paramClass
        this.factory = factory
    }

    @Override
    Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException {
        if (FactoryBuilderSupport.checkValueIsTypeNotString(value, name, parameterClass)) {
            return value
        }
        return factory.createParameter((String) value)
    }

    boolean isLeaf() {
        return true
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy