01: /* Copyright 2001 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.services.entityproperties;
07:
08: import java.util.HashMap;
09:
10: import org.jasig.portal.EntityIdentifier;
11: import org.jasig.portal.IBasicEntity;
12:
13: /**
14: * A BasicEntity implementation used interally by the EntityPropertyRegistry
15: * to cache property lookup results
16: *
17: * @author Alex Vigdor av317@columbia.edu
18: * @version $Revision: 34797 $
19: */
20: public class EntityProperties implements IBasicEntity {
21: protected String key;
22: protected HashMap props;
23:
24: public EntityProperties(String key) {
25: this .key = key;
26: this .props = new HashMap();
27: }
28:
29: public EntityIdentifier getEntityIdentifier() {
30: return new EntityIdentifier(getKey(), getType());
31: }
32:
33: public String getKey() {
34: return key;
35: }
36:
37: public Class getType() {
38: return this .getClass();
39: }
40:
41: public String getProperty(String name) {
42: return (String) props.get(name);
43: }
44:
45: public void setProperty(String name, String value) {
46: this .props.put(name, value);
47: }
48:
49: public String[] getPropertyNames() {
50: return (String[]) props.keySet().toArray(new String[0]);
51: }
52: }
|