01: /*
02: * Copyright 2004-2006 Fouad HAMDI.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.csvbeans.specs;
17:
18: import java.util.Collection;
19: import java.util.List;
20:
21: import org.csvbeans.LineSet;
22:
23: /**
24: * Representation of the definitions of a bean.
25: * @author Fouad Hamdi
26: * @since 0.7
27: *
28: */
29: public interface BeanSpecification extends FieldSpecification {
30:
31: /**
32: * Return the fields descriptions of the bean description: they are a mix of
33: * <code>IField</code> objects.
34: *
35: * @return Return the fields descriptions list.
36: */
37: public List getFields();
38:
39: /**
40: * Return all the Field specifications with the underlying ones.
41: */
42: public List getAllFields();
43:
44: /**
45: * Return the class name of the specified bean.
46: *
47: * @return the class name of the bean.
48: */
49: public String getClassName();
50:
51: /**
52: * @return Returns the constants.
53: */
54: public List getConstants();
55:
56: /**
57: * Allow to know if constants are associated with the bean.
58: */
59: public boolean hasConstants();
60:
61: /**
62: * Build an empty line set that can be filled to defined the field values
63: * associated with the bean.
64: */
65: public LineSet formatLineSet();
66:
67: /**
68: * Return the child matching the specified tag.
69: */
70: public ChildSpecification getChild(String tag);
71:
72: /**
73: * Allow to know if the record has children.
74: *
75: * @return <code>true</code> if the record has children.
76: */
77: public boolean hasChildren();
78:
79: /**
80: * Return the records that are children of the current record.
81: */
82: public Collection getChildren();
83:
84: }
|