View Javadoc

1   /*
2    * Copyright 2004-2005 the original author or authors.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5    * use this file except in compliance with the License. You may obtain a copy of
6    * the License at
7    * 
8    * http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations under
14   * the License.
15   */
16  package net.sf.composite.extract;
17  
18  import java.util.List;
19  
20  
21  /***
22   * Provides an interface for reading and writing the components of a composite.
23   * 
24   * @author Matt Sgarlata
25   * @since Mar 11, 2005
26   */
27  public interface ComponentAccessor {
28  
29  	/***
30  	 * Extracts the components from a composite.
31  	 * 
32  	 * @param composite
33  	 *            the composite from which the components will be extracted
34  	 * @return the components
35  	 * @throws ComponentAccessorException
36  	 *             if the components could not be extracted for some reason
37  	 */
38  	public List getComponents(Object composite)
39  		throws ComponentAccessorException;
40  
41  	/***
42  	 * Sets the components in a composite.
43  	 * 
44  	 * @param composite
45  	 *            the composite for which the components will be set
46  	 * @param components
47  	 *            the components
48  	 * @throws ComponentAccessorException
49  	 *             if the components could not be set for some reason
50  	 */
51  	public void setComponents(Object composite, List components)
52  		throws ComponentAccessorException;
53  	
54  }