View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.rat.anttasks;
20  
21  import org.apache.rat.DeprecationReporter;
22  import org.apache.rat.license.ILicense;
23  import org.apache.rat.license.ILicenseFamily;
24  
25  import java.util.SortedSet;
26  
27  import org.apache.rat.analysis.IHeaderMatcher;
28  
29  /**
30   * Creates a License definition.
31   * @deprecated use configuration file.
32   */
33  @Deprecated // since 0.17
34  @DeprecationReporter.Info(since = "0.17", forRemoval = true, use = "Configuration file and <config> element")// since 0.17
35  public class License {
36  
37      private final ILicense.Builder builder = ILicense.builder();
38      
39      ILicense.Builder asBuilder() {
40          return builder;
41      }
42  
43      public ILicense build(SortedSet<ILicenseFamily> context) {
44          return builder.setLicenseFamilies(context).build();
45      }
46  
47      public void setNotes(String notes) {
48          builder.setNote(notes);
49      }
50  
51      public void addNotes(String notes) {
52          builder.setNote(notes);
53      }
54      
55  
56      public void setFamily(String licenseFamilyCategory) {
57          builder.setFamily(licenseFamilyCategory);
58      }
59      
60      public void setId(String id) {
61          builder.setId(id);
62      }
63  
64      public void setName(String name) {
65          builder.setName(name);
66      }
67  
68      public void add(IHeaderMatcher.Builder builder) {
69          this.builder.setMatcher(builder);
70      }
71      
72      public void add(IHeaderMatcher matcher) {
73          this.builder.setMatcher(matcher);
74      }
75  }