KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cayenne > reflect > Property


1 /*****************************************************************
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  ****************************************************************/

19
20 package org.apache.cayenne.reflect;
21
22 /**
23  * Defines bean property API used by Cayenne to access object data, do faulting and graph
24  * maintenance tasks.
25  *
26  * @since 1.2
27  * @author Andrus Adamchik
28  */

29 public interface Property {
30
31     /**
32      * Returns property name.
33      */

34     String JavaDoc getName();
35
36     /**
37      * Returns a property value of an object without disturbing the object fault status.
38      */

39     Object JavaDoc readPropertyDirectly(Object JavaDoc object) throws PropertyException;
40
41     /**
42      * Returns a property value, inflating unresolved object if need.
43      */

44     Object JavaDoc readProperty(Object JavaDoc object) throws PropertyException;
45
46     /**
47      * Sets a property value of an object without disturbing the object fault status. Old
48      * value of the property is specified as a hint and can be ignored by the property
49      * implementor.
50      */

51     void writePropertyDirectly(Object JavaDoc object, Object JavaDoc oldValue, Object JavaDoc newValue)
52             throws PropertyException;
53
54     /**
55      * Sets a property value, inflating unresolved object if need. Old value of the
56      * property is specified as a hint and can be ignored by the property implementor.
57      */

58     void writeProperty(Object JavaDoc object, Object JavaDoc oldValue, Object JavaDoc newValue)
59             throws PropertyException;
60
61     /**
62      * A visitor accept method.
63      *
64      * @return a status returned by the corresponding callback method of the visitor. It
65      * serves as an indication of whether peer properties processing is still
66      * needed.
67      */

68     boolean visit(PropertyVisitor visitor);
69
70     /**
71      * If a property is implemented as a ValueHolder, this operation would create an
72      * unfaulted value holder and inject it into the object, if an object doesn't have it
73      * set yet.
74      */

75     void injectValueHolder(Object JavaDoc object) throws PropertyException;
76 }
77
Popular Tags