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

com.feilong.lib.digester3.binder.PathCallParamBuilder Maven / Gradle / Ivy

Go to download

feilong is a suite of core and expanded libraries that include utility classes, http, excel,cvs, io classes, and much much more.

There is a newer version: 4.0.8
Show newest version
package com.feilong.lib.digester3.binder;

import com.feilong.lib.digester3.PathCallParamRule;

/**
 * Builder chained when invoking {@link LinkedRuleBuilder#callParamPath()}.
 *
 * @since 3.0
 */
public final class PathCallParamBuilder extends AbstractBackToLinkedRuleBuilder{

    private int paramIndex = 0;

    PathCallParamBuilder(String keyPattern, String namespaceURI, RulesBinder mainBinder, LinkedRuleBuilder mainBuilder){
        super(keyPattern, namespaceURI, mainBinder, mainBuilder);
    }

    /**
     * Sets the zero-relative parameter number.
     *
     * @param paramIndex
     *            The zero-relative parameter number
     * @return this builder instance
     */
    public PathCallParamBuilder ofIndex(int paramIndex){
        if (paramIndex < 0){
            reportError("callParamPath().ofIndex( int )", "negative index argument not allowed");
        }

        this.paramIndex = paramIndex;
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected PathCallParamRule createRule(){
        return new PathCallParamRule(paramIndex);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy