01: /**
02: * Copyright 2007 Jens Dietrich Licensed under the Apache License, Version 2.0 (the "License");
03: * you may not use this file except in compliance with the License.
04: * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
05: * Unless required by applicable law or agreed to in writing, software distributed under the
06: * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
07: * either express or implied. See the License for the specific language governing permissions
08: * and limitations under the License.
09: */package nz.org.take;
10:
11: import java.util.Map;
12:
13: /**
14: * Interface for classes that can be annotated.
15: * @author <a href="http://www-ist.massey.ac.nz/JBDietrich/">Jens Dietrich</a>
16: */
17:
18: public interface Annotatable {
19:
20: /**
21: * Add a new annotation.
22: * @param key
23: * @param value
24: */
25: public abstract void addAnnotation(String key, String value);
26:
27: /**
28: * Removes an annotation.
29: * @param key
30: * @return the value of the removed annotation or null if there is no such annotation
31: */
32: public abstract String removeAnnotation(String key);
33:
34: /**
35: * Get the annotation value for a given key.
36: * @param key the key
37: * @return the value or null if there is no such annotation
38: */
39: public abstract String getAnnotation(String key);
40:
41: /**
42: * Add all Annotations.
43: * @param newAnnotations
44: */
45: public void addAnnotations(Map<String, String> newAnnotations);
46:
47: public abstract Map<String, String> getAnnotations();
48:
49: }
|