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;
023
024/**
025 * attributes:
026 * android:host="string"
027 * android:mimeType="string"
028 * android:path="string"
029 * android:pathPattern="string"
030 * android:pathPrefix="string"
031 * android:port="string"
032 * android:scheme="string"
033 *
034 * @author John Ericksen
035 */
036public class Data extends Mergeable implements Identified {
037
038    private String host;
039    private String mimeType;
040    private String path;
041    private String pathPattern;
042    private String pathPrefix;
043    private String port;
044    private String scheme;
045
046    @Merge("h")
047    @XmlAttribute(name = "host", namespace = ManifestNamespaceMapper.ANDROID_URI)
048    public String getHost() {
049        return host;
050    }
051
052    public void setHost(String host) {
053        this.host = host;
054    }
055
056    @Merge("m")
057    @XmlAttribute(name = "mimeType", namespace = ManifestNamespaceMapper.ANDROID_URI)
058    public String getMimeType() {
059        return mimeType;
060    }
061
062    public void setMimeType(String mimeType) {
063        this.mimeType = mimeType;
064    }
065
066    @Merge("a")
067    @XmlAttribute(name = "path", namespace = ManifestNamespaceMapper.ANDROID_URI)
068    public String getPath() {
069        return path;
070    }
071
072    public void setPath(String path) {
073        this.path = path;
074    }
075
076    @Merge("t")
077    @XmlAttribute(name = "pathPattern", namespace = ManifestNamespaceMapper.ANDROID_URI)
078    public String getPathPattern() {
079        return pathPattern;
080    }
081
082    public void setPathPattern(String pathPattern) {
083        this.pathPattern = pathPattern;
084    }
085
086    @Merge("x")
087    @XmlAttribute(name = "pathPrefix", namespace = ManifestNamespaceMapper.ANDROID_URI)
088    public String getPathPrefix() {
089        return pathPrefix;
090    }
091
092    public void setPathPrefix(String pathPrefix) {
093        this.pathPrefix = pathPrefix;
094    }
095
096    @Merge("p")
097    @XmlAttribute(name = "port", namespace = ManifestNamespaceMapper.ANDROID_URI)
098    public String getPort() {
099        return port;
100    }
101
102    public void setPort(String port) {
103        this.port = port;
104    }
105
106    @Merge("s")
107    @XmlAttribute(name = "scheme", namespace = ManifestNamespaceMapper.ANDROID_URI)
108    public String getScheme() {
109        return scheme;
110    }
111
112    public void setScheme(String scheme) {
113        this.scheme = scheme;
114    }
115
116    @Override
117    public String getIdentifier() {
118        return host + mimeType + path + pathPattern + pathPrefix + port + scheme;
119    }
120}