Repository navigation
Expand file tree
/
Copy pathAndroidManifest.java
More file actions
139 lines (113 loc) · 4.88 KB
/
Copy pathAndroidManifest.java
File metadata and controls
139 lines (113 loc) · 4.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/**
* Copyright (C) 2010-2016 eBusiness Information, Excilys Group
* Copyright (C) 2016 the AndroidAnnotations project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed To in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.androidannotations.helper;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public final class AndroidManifest {
private final String applicationPackage;
private final List<String> componentQualifiedNames;
private final Map<String, MetaDataInfo> metaDataQualifiedNames;
private final List<String> permissionQualifiedNames;
private final String applicationClassName;
private final boolean libraryProject;
private final boolean debugabble;
private final int minSdkVersion;
private final int maxSdkVersion;
private final int targetSdkVersion;
@Override
public String toString() {
return "AndroidManifest [applicationPackage=" + applicationPackage + ", componentQualifiedNames=" + componentQualifiedNames
+ ", metaDataQualifiedNames=" + metaDataQualifiedNames + ", permissionQualifiedNames=" + permissionQualifiedNames
+ ", applicationClassName=" + applicationClassName + ", libraryProject=" + libraryProject + ", debugabble=" + debugabble
+ ", minSdkVersion=" + minSdkVersion + ", maxSdkVersion=" + maxSdkVersion + ", targetSdkVersion=" + targetSdkVersion + "]";
}
// CHECKSTYLE:OFF
public static AndroidManifest createManifest(String applicationPackage, String applicationClassName, List<String> componentQualifiedNames, Map<String, MetaDataInfo> metaDataQualifiedNames, List<String> permissionQualifiedNames, int minSdkVersion, int maxSdkVersion, int targetSdkVersion, boolean debugabble) {
return new AndroidManifest(false, applicationPackage, applicationClassName, componentQualifiedNames, metaDataQualifiedNames, permissionQualifiedNames, minSdkVersion, maxSdkVersion, targetSdkVersion, debugabble);
}
public static AndroidManifest createLibraryManifest(String applicationPackage, int minSdkVersion, int maxSdkVersion, int targetSdkVersion) {
return new AndroidManifest(true, applicationPackage, "", Collections.<String> emptyList(), new HashMap<String, MetaDataInfo>(), Collections.<String> emptyList(), minSdkVersion, maxSdkVersion, targetSdkVersion, false);
}
private AndroidManifest(boolean libraryProject, String applicationPackage, String applicationClassName, List<String> componentQualifiedNames, Map<String, MetaDataInfo> metaDataQualifiedNames, List<String> permissionQualifiedNames, int minSdkVersion, int maxSdkVersion, int targetSdkVersion, boolean debuggable) {
this.libraryProject = libraryProject;
this.applicationPackage = applicationPackage;
this.applicationClassName = applicationClassName;
this.componentQualifiedNames = componentQualifiedNames;
this.metaDataQualifiedNames = metaDataQualifiedNames;
this.permissionQualifiedNames = permissionQualifiedNames;
this.minSdkVersion = minSdkVersion;
this.maxSdkVersion = maxSdkVersion;
this.targetSdkVersion = targetSdkVersion;
this.debugabble = debuggable;
}
// CHECKSTYLE:ON
public String getApplicationPackage() {
return applicationPackage;
}
public List<String> getComponentQualifiedNames() {
return Collections.unmodifiableList(componentQualifiedNames);
}
public Map<String, MetaDataInfo> getMetaDataQualifiedNames() {
return Collections.unmodifiableMap(metaDataQualifiedNames);
}
public List<String> getPermissionQualifiedNames() {
return Collections.unmodifiableList(permissionQualifiedNames);
}
public String getApplicationClassName() {
return applicationClassName;
}
public boolean isLibraryProject() {
return libraryProject;
}
public boolean isDebuggable() {
return debugabble;
}
public int getMinSdkVersion() {
return minSdkVersion;
}
public int getMaxSdkVersion() {
return maxSdkVersion;
}
public int getTargetSdkVersion() {
return targetSdkVersion;
}
public static final class MetaDataInfo {
private final String name;
private final String value;
private final String resource;
public MetaDataInfo(String name, String value, String resource) {
this.name = name;
this.value = value;
this.resource = resource;
}
public String getName() {
return name;
}
public String getValue() {
return value;
}
public String getResource() {
return resource;
}
@Override
public String toString() {
return "{" + "name='" + name + '\'' + ", value='" + value + '\'' + ", resource='" + resource + '\'' + '}';
}
}
}