001/** 002 * Copyright 2013 John Ericksen 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.androidtransfuse.model.manifest; 017 018import org.androidtransfuse.model.Mergeable; 019import org.androidtransfuse.processor.Merge; 020 021import javax.xml.bind.annotation.XmlAttribute; 022 023/** 024 * attributes: 025 * android:name="string" 026 * android:maxSdkVersion="integer" 027 * 028 * @author John Ericksen 029 */ 030public class UsesPermission extends Mergeable implements Comparable<UsesPermission> { 031 032 private String name; 033 private Integer maxSdkVersion; 034 035 @Merge("n") 036 @XmlAttribute(name = "name", namespace = ManifestNamespaceMapper.ANDROID_URI) 037 public String getName() { 038 return name; 039 } 040 041 public void setName(String name) { 042 this.name = name; 043 } 044 045 @Merge("v") 046 @XmlAttribute(name = "maxSdkVersion", namespace = ManifestNamespaceMapper.ANDROID_URI) 047 public Integer getMaxSdkVersion() { 048 return maxSdkVersion; 049 } 050 051 public void setMaxSdkVersion(Integer maxSdkVersion) { 052 this.maxSdkVersion = maxSdkVersion; 053 } 054 055 @Override 056 public int compareTo(UsesPermission usesPermission) { 057 return getName().compareTo(usesPermission.getName()); 058 } 059}