/*
 * $Revision: 1.3 $ $Date: 2005/04/17 16:43:03 $
 * Copyright (C) 2004-2005 SUGIMOTO Ken-ichi
 * 作成日: 2004/11/20
 */
package feat.v1.config;

import org.jibx.runtime.IUnmarshallingContext;

import feat.v1.InitializationException;

public class ForwardDeclaration implements ResponseDeclaration {

    private FeatureDeclaration featureDeclaration;
    private ForwardResponse response;

    // JiBX
    private String name;
    private String path;

    public ForwardDeclaration() {
    }

    public String getName() {
        return name;
    }

    public String getPath() {
        return path;
    }

    public FeatureDeclaration getFeatureDeclaration() {
        return featureDeclaration;
    }
    /*public void setFeatureDeclaration(FeatureDeclaration featureDeclaration) {
        this.featureDeclaration = featureDeclaration;
    }*/

    public ForwardResponse getResponse() {
        return response;
    }

    public void postset(IUnmarshallingContext uctx) {
        featureDeclaration = (FeatureDeclaration)uctx.getStackObject(1);
    }

    public void init() throws InitializationException {
        if ( path == null || path.length() == 0 )
            throw new InitializationException("pathが指定されていない");

        response = new ForwardResponse(this);
    }

    public void validate() {}

}
