1 |
alfonx |
769 |
package skrueger.geotools; |
2 |
|
|
|
3 |
|
|
import java.util.List; |
4 |
|
|
|
5 |
alfonx |
770 |
import org.geotools.feature.NameImpl; |
6 |
alfonx |
769 |
import org.opengis.feature.type.Name; |
7 |
|
|
|
8 |
|
|
import skrueger.AttributeMetadataImpl; |
9 |
|
|
|
10 |
|
|
public class AttributeMetadataImplMap extends AttributeMetadataMap<AttributeMetadataImpl> { |
11 |
|
|
|
12 |
alfonx |
770 |
private static final long serialVersionUID = 6781939984242527498L; |
13 |
|
|
|
14 |
|
|
|
15 |
alfonx |
769 |
public AttributeMetadataImplMap(List<String> langs) { |
16 |
|
|
super(langs); |
17 |
|
|
} |
18 |
|
|
|
19 |
|
|
public AttributeMetadataImplMap() { |
20 |
|
|
super(); |
21 |
|
|
} |
22 |
|
|
|
23 |
|
|
/** |
24 |
|
|
* Returns a deep-copy. @see {@link Copyable} interface |
25 |
|
|
*/ |
26 |
|
|
@Override |
27 |
|
|
public AttributeMetadataImplMap copy() { |
28 |
|
|
final AttributeMetadataImplMap copy = new AttributeMetadataImplMap(langs); |
29 |
|
|
return (AttributeMetadataImplMap) copyTo(copy); |
30 |
|
|
} |
31 |
|
|
|
32 |
|
|
|
33 |
|
|
/** |
34 |
|
|
* Returns the {@link AttributeMetadataImpl} for a given {@link Name}. Never returns |
35 |
|
|
* <code>null</code>, but rather creates a default {@link AttributeMetadataImpl} on the |
36 |
|
|
* fly. |
37 |
|
|
*/ |
38 |
|
|
@Override |
39 |
alfonx |
770 |
public AttributeMetadataImpl get(final NameImpl name) { |
40 |
alfonx |
769 |
final AttributeMetadataImpl AttributeMetadataImpl = super.get(name); |
41 |
|
|
if (AttributeMetadataImpl == null && name != null |
42 |
|
|
&& !name.getLocalPart().trim().isEmpty()) { |
43 |
|
|
|
44 |
|
|
put(name, new AttributeMetadataImpl(name, langs)); |
45 |
|
|
|
46 |
|
|
return super.get(name); |
47 |
|
|
} |
48 |
|
|
return AttributeMetadataImpl; |
49 |
|
|
} |
50 |
|
|
|
51 |
|
|
|
52 |
|
|
} |