01: /*
02: * Copyright 2004 Clinton Begin
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 com.ibatis.common.beans;
17:
18: /**
19: * A Probe is an object that is used to work with beans, DOM objects, or other
20: * objects.
21: */
22: public interface Probe {
23:
24: /**
25: * Gets an Object property from another object
26: *
27: * @param object - the object
28: * @param name - the property name
29: * @return The property value (as an Object)
30: */
31: public Object getObject(Object object, String name);
32:
33: /**
34: * Sets the value of a property on an object
35: *
36: * @param object - the object to change
37: * @param name - the name of the property to set
38: * @param value - the new value to set
39: */
40: public void setObject(Object object, String name, Object value);
41:
42: /**
43: * Returns the class that the setter expects when setting a property
44: *
45: * @param object - the object to check
46: * @param name - the name of the property
47: * @return The type of the property
48: */
49: public Class getPropertyTypeForSetter(Object object, String name);
50:
51: /**
52: * Returns the class that the getter will return when reading a property
53: *
54: * @param object - the object to check
55: * @param name - the name of the property
56: * @return The type of the property
57: */
58: public Class getPropertyTypeForGetter(Object object, String name);
59:
60: /**
61: * Checks to see if an object has a writable property by a given name
62: *
63: * @param object - the object to check
64: * @param propertyName - the property to check for
65: * @return True if the property exists and is writable
66: */
67: public boolean hasWritableProperty(Object object,
68: String propertyName);
69:
70: /**
71: * Checks to see if an object has a readable property by a given name
72: *
73: * @param object - the object to check
74: * @param propertyName - the property to check for
75: * @return True if the property exists and is readable
76: */
77: public boolean hasReadableProperty(Object object,
78: String propertyName);
79:
80: }
|