001 /*
002 * Copyright 2002-2004 The Apache Software Foundation
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.apache.commons.clazz;
017
018 /**
019 * Describes a Property of instances of a Clazz.
020 *
021 * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
022 * @author <a href="mailto:scolebourne@apache.org">Stephen Colebourne</a>
023 * @version $Id: ClazzProperty.java 155436 2005-02-26 13:17:48Z dirkv $
024 */
025 public interface ClazzProperty extends ClazzFeature {
026 /**
027 * Returns the name of the property.
028 *
029 * @return String
030 */
031 String getName();
032
033 /**
034 * Returns the property type.
035 */
036 Clazz getClazz();
037
038 /**
039 * Returns true if the property is a collection.
040 */
041 boolean isCollection();
042
043 /**
044 * Returns true if the property is a map.
045 */
046 boolean isMap();
047
048 /**
049 * Gets the type of the item if the property <code>isCollection()</code> or
050 * <code>isMap()</code>.
051 *
052 * @return the type of the item
053 */
054 Clazz getContentClazz();
055
056 /**
057 * Gets the type of the key if the property <code>isMap()</code>.
058 *
059 * @return the type of the key
060 */
061 Clazz getKeyClazz();
062
063 /**
064 * @return true if the property can not be changed
065 */
066 boolean isReadOnly();
067
068 /**
069 * @todo
070 */
071 Object get(Object instance);
072
073 /**
074 * @todo
075 */
076 void set(Object instance, Object value);
077 }