01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: * $Header:$
18: */
19: package org.apache.beehive.controls.api.properties;
20:
21: import java.lang.annotation.Annotation;
22:
23: /**
24: * The PropertyMap interface represents a collection of ControlBean properties. Concrete
25: * implementations of this interface might derive property values from a local Map, Java 5.0
26: * annotations, external configuration, or other property sources.
27: */
28: public interface PropertyMap {
29: /**
30: * Returns the PropertySet or Control interface class associated with the PropertyMap.
31: */
32: public Class getMapClass();
33:
34: /**
35: * Sets a delegate base property map from which values will be derived if not found within
36: * the local property map.
37: */
38: public void setDelegateMap(PropertyMap delegateMap);
39:
40: /**
41: * Returns a delegate base property map from which values will be derived if not found within
42: * the local property map.
43: */
44: public PropertyMap getDelegateMap();
45:
46: /**
47: * Sets the property specifed by 'key' within this map.
48: */
49: public void setProperty(PropertyKey key, Object value);
50:
51: /**
52: * Returns the property value specified by 'key' within this map.
53: */
54: public Object getProperty(PropertyKey key);
55:
56: /**
57: * Returns true if the PropertyMap contains one or more values for the specified
58: * PropertySet, false otherwise
59: */
60: public boolean containsPropertySet(
61: Class<? extends Annotation> propertySet);
62:
63: /**
64: * Returns a PropertySet proxy instance that derives its data from the contents of
65: * the property map. Will return null if the PropertyMap does not contain any properties
66: * associated with the specified PropertySet.
67: */
68: public <T extends Annotation> T getPropertySet(Class<T> propertySet);
69: }
|