This project has retired. For details please refer to its Attic page.
GenericMetadataFacet xref
View Javadoc
1   package org.apache.archiva.metadata.generic;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.archiva.metadata.model.MetadataFacet;
23  
24  import java.util.Map;
25  import java.util.TreeMap;
26  
27  public class GenericMetadataFacet
28      implements MetadataFacet
29  {
30      private Map<String, String> additionalProperties;
31  
32      public static final String FACET_ID = "org.apache.archiva.metadata.generic";
33  
34      @Override
35      public String getFacetId()
36      {
37          return FACET_ID;
38      }
39  
40      @Override
41      public String getName()
42      {
43          return "";
44      }
45  
46      @Override
47      public void fromProperties( Map<String, String> properties )
48      {
49          if ( additionalProperties == null )
50          {
51              additionalProperties = new TreeMap<String, String>();
52          }
53  
54          additionalProperties.putAll( properties );
55      }
56  
57      @Override
58      public Map<String, String> toProperties()
59      {
60          Map<String, String> properties = new TreeMap<String, String>();
61  
62          if ( additionalProperties != null )
63          {
64              for ( String key : additionalProperties.keySet() )
65              {
66                  properties.put( key, additionalProperties.get( key ) );
67              }
68          }
69  
70          return properties;
71      }
72  
73      public Map<String, String> getAdditionalProperties()
74      {
75          return additionalProperties;
76      }
77  
78      public void setAdditionalProperties( Map<String, String> additionalProperties )
79      {
80          this.additionalProperties = additionalProperties;
81      }
82  
83  }