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; 020import org.androidtransfuse.processor.MergeCollection; 021 022import javax.xml.bind.annotation.XmlAttribute; 023import javax.xml.bind.annotation.XmlElement; 024import java.util.ArrayList; 025import java.util.List; 026 027/** 028 * attributes: 029 * android:icon="drawable resource" 030 * android:label="string resource" 031 * android:priority="integer" 032 * <p/> 033 * must contain: 034 * <action> 035 * <p/> 036 * can contain: 037 * <category> 038 * <data> 039 * 040 * @author John Ericksen 041 */ 042public class IntentFilter extends Mergeable { 043 044 private String icon; 045 private String label; 046 private Integer priority; 047 private List<Action> actions = new ArrayList<Action>(); 048 private List<Category> categories = new ArrayList<Category>(); 049 private List<Data> data = new ArrayList<Data>(); 050 051 @Merge("i") 052 @XmlAttribute(name = "icon", namespace = ManifestNamespaceMapper.ANDROID_URI) 053 public String getIcon() { 054 return icon; 055 } 056 057 public void setIcon(String icon) { 058 this.icon = icon; 059 } 060 061 @Merge("l") 062 @XmlAttribute(name = "label", namespace = ManifestNamespaceMapper.ANDROID_URI) 063 public String getLabel() { 064 return label; 065 } 066 067 public void setLabel(String label) { 068 this.label = label; 069 } 070 071 @Merge("p") 072 @XmlAttribute(name = "priority", namespace = ManifestNamespaceMapper.ANDROID_URI) 073 public Integer getPriority() { 074 return priority; 075 } 076 077 public void setPriority(Integer priority) { 078 this.priority = priority; 079 } 080 081 @MergeCollection(collectionType = ArrayList.class, type = Action.class) 082 @XmlElement(name = "action") 083 public List<Action> getActions() { 084 return actions; 085 } 086 087 public void setActions(List<Action> actions) { 088 this.actions = actions; 089 } 090 091 @MergeCollection(collectionType = ArrayList.class, type = Category.class) 092 @XmlElement(name = "category") 093 public List<Category> getCategories() { 094 return categories; 095 } 096 097 public void setCategories(List<Category> categories) { 098 this.categories = categories; 099 } 100 101 @MergeCollection(collectionType = ArrayList.class, type = Data.class) 102 @XmlElement(name = "data") 103 public List<Data> getData() { 104 return data; 105 } 106 107 public void setData(List<Data> data) { 108 this.data = data; 109 } 110}