/* * Copyright 2004 Niall Pemberton * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package lib.framework.util; import org.apache.commons.beanutils.DynaBean; import org.apache.struts.validator.LazyValidatorForm; /** *

Lazy ActionForm based on the NestedLazyBean * implementation.

* *

NestedLazyBean overrides the default indexed type from being * a java.util.ArrayList to an array of itself.

* *

Combined with the power of the Struts Nested tags, * this implementation can nest ad infinitum.

* * @author Niall Pemberton */ public class NestedLazyForm extends LazyValidatorForm { /** * Constructor which installs a (@link NestedLazyBean) as the DynaBean * backing this Lazy ActionForm. */ public NestedLazyForm() { super(new NestedLazyBean()); } /** * Override the default indexed bean property to be a NestedLazyBean. * This only affects List type indexed properties. * * @return a new NestedLazyBean. */ protected DynaBean newIndexedBean(String name) { return new NestedLazyBean(); } }