View Javadoc

1   /*
2    * Copyright 2002-2004 The Apache Software Foundation
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of 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,
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.apache.commons.clazz;
17  
18  /**
19   * Describes a Property of instances of a Clazz.
20   * 
21   * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
22   * @author <a href="mailto:scolebourne@apache.org">Stephen Colebourne</a>
23   * @version $Id: ClazzProperty.java 155436 2005-02-26 13:17:48Z dirkv $
24   */
25  public interface ClazzProperty extends ClazzFeature {
26      /**
27       * Returns the name of the property.
28       * 
29       * @return String
30       */
31      String getName();
32  
33      /**
34       * Returns the property type.
35       */
36      Clazz getClazz();
37  
38      /**
39       * Returns true if the property is a collection.
40       */
41      boolean isCollection();
42  
43      /**
44       * Returns true if the property is a map.
45       */
46      boolean isMap();
47  
48      /**
49       * Gets the type of the item if the property <code>isCollection()</code> or
50       * <code>isMap()</code>.
51       *
52       * @return the type of the item
53       */
54      Clazz getContentClazz();
55  
56      /**
57       * Gets the type of the key if the property <code>isMap()</code>.
58       *
59       * @return the type of the key
60       */
61      Clazz getKeyClazz();
62  
63      /**
64       * @return true if the property can not be changed
65       */
66      boolean isReadOnly();
67  
68      /**
69       * @todo
70       */
71      Object get(Object instance);
72  
73      /**
74       * @todo
75       */
76      void set(Object instance, Object value);
77  }