/*
 * $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 RedirectDeclaration implements ResponseDeclaration {

    private FeatureDeclaration featureDeclaration;
    private RedirectResponse response;

    // JiBX
    private String name;
    private String uri;

    public RedirectDeclaration() {
    }


    public String getName() {
        return name;
    }

    public String getUri() {
        return uri;
    }

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

    public RedirectResponse getResponse() {
        return response;
    }

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

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

        response = new RedirectResponse(this);
    }

    public void validate() {}

}
