/*
 * $Id: InputResourceConfig.java 220 2007-07-16 10:32:15Z sugimotokenichi $
 * Copyright (C) 2004-2006 SUGIMOTO Ken-ichi
 * 作成日: 2006/04/12
 */
package feat2.config;

import feat2.FeatErrors;

/**
 * リソースからの入力の設定。
 * @author SUGIMOTO Ken-ichi
 */
public class InputResourceConfig extends InputConfigBase {

    private String ref;

    public String getRef() {
        return ref;
    }
    public void setRef(String resourceName) {
        this.ref = resourceName;
    }

    // Configのメソッド -------------------------------------------------------

    public String getElementName() {
        return "input-resource";
    }

    public boolean validate(FeatErrors errs) {

        boolean ret = super.validate(errs);

        if ( ref == null && getPropertyName() != null )
            ref = getPropertyName().getValue();

        return ret;
    }

}
