| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.ini4j; |
| 17 | |
|
| 18 | |
import org.ini4j.Registry.Key; |
| 19 | |
|
| 20 | 0 | class BasicRegistryKey extends BasicProfileSection implements Registry.Key |
| 21 | |
{ |
| 22 | |
private static final long serialVersionUID = -1390060044244350928L; |
| 23 | |
private static final String META_TYPE = "type"; |
| 24 | |
|
| 25 | |
public BasicRegistryKey(BasicRegistry registry, String name) |
| 26 | |
{ |
| 27 | 146 | super(registry, name); |
| 28 | 146 | } |
| 29 | |
|
| 30 | |
@Override public Key getChild(String key) |
| 31 | |
{ |
| 32 | 1 | return (Key) super.getChild(key); |
| 33 | |
} |
| 34 | |
|
| 35 | |
@Override public Key getParent() |
| 36 | |
{ |
| 37 | 1 | return (Key) super.getParent(); |
| 38 | |
} |
| 39 | |
|
| 40 | |
@Override public Registry.Type getType(Object key) |
| 41 | |
{ |
| 42 | 92 | return (Registry.Type) getMeta(META_TYPE, key); |
| 43 | |
} |
| 44 | |
|
| 45 | |
@Override public Registry.Type getType(Object key, Registry.Type defaultType) |
| 46 | |
{ |
| 47 | 89 | Registry.Type type = getType(key); |
| 48 | |
|
| 49 | 89 | return (type == null) ? defaultType : type; |
| 50 | |
} |
| 51 | |
|
| 52 | |
@Override public Key addChild(String key) |
| 53 | |
{ |
| 54 | 2 | return (Key) super.addChild(key); |
| 55 | |
} |
| 56 | |
|
| 57 | |
@Override public Key lookup(String... path) |
| 58 | |
{ |
| 59 | 3 | return (Key) super.lookup(path); |
| 60 | |
} |
| 61 | |
|
| 62 | |
@Override public Registry.Type putType(String key, Registry.Type type) |
| 63 | |
{ |
| 64 | 178 | return (Registry.Type) putMeta(META_TYPE, key, type); |
| 65 | |
} |
| 66 | |
|
| 67 | |
@Override public Registry.Type removeType(Object key) |
| 68 | |
{ |
| 69 | 1 | return (Registry.Type) removeMeta(META_TYPE, key); |
| 70 | |
} |
| 71 | |
} |