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.Identified;
019import org.androidtransfuse.model.Mergeable;
020import org.androidtransfuse.processor.Merge;
021
022import javax.xml.bind.annotation.XmlAttribute;
023import javax.xml.bind.annotation.XmlTransient;
024import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
025
026/**
027 * attributes:
028 * android:name="string"
029 * android:required=["true" | "false"]
030 * android:glEsVersion="integer"
031 *
032 * @author John Ericksen
033 */
034public class UsesFeature extends Mergeable implements Identified {
035
036    private String name;
037    private Boolean required;
038    private Integer glEsVersion;
039
040    @Merge("n")
041    @XmlAttribute(name = "name", namespace = ManifestNamespaceMapper.ANDROID_URI)
042    public String getName() {
043        return name;
044    }
045
046    public void setName(String name) {
047        this.name = name;
048    }
049
050    @Merge("r")
051    @XmlAttribute(name = "required", namespace = ManifestNamespaceMapper.ANDROID_URI)
052    public Boolean getRequired() {
053        return required;
054    }
055
056    public void setRequired(Boolean required) {
057        this.required = required;
058    }
059
060    @Merge("g")
061    @XmlAttribute(name = "glEsVersion", namespace = ManifestNamespaceMapper.ANDROID_URI)
062    @XmlJavaTypeAdapter(HexadecimalIntegerConverter.class)
063    public Integer getGlEsVersion() {
064        return glEsVersion;
065    }
066
067    public void setGlEsVersion(Integer glEsVersion) {
068        this.glEsVersion = glEsVersion;
069    }
070
071    @XmlTransient
072    public String getIdentifier(){
073        return name + glEsVersion;
074    }
075    
076}